I was reading the boost documentation and I came across this:
fibonacci_dataset() ^ bdata::make( { 1, 2, 3, 5, 8, 13, 21, 35, 56 } )
The ^ operator seems to concatenate two datasets together. Is there documentation on this, or do I have to source dive?
What you're referring to is actually a zip operation on a pair of datasets.
From the documentation page of dataset operations:
A zip, denoted
^, is an operation on two datasets dsa and dsb of same arity and same size, resulting in a dataset where the k-th sample of dsa is paired with the corresponding k-th sample of dsb. The resulting dataset samples order follows the left to right order against the symbol ^.dsa = (a_1, a_2, ... a_i) dsb = (b_1, b_2, ... b_i) dsa ^ dsb = ( (a_1, b_1), (a_2, b_2) ... (a_i, b_i) )
Hence, in the example you mention, the result is a sequence of pairs of calculated and expected Fibonacci values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With