seq is used to create sequences for indexing af::array More...
#include <seq.h>
Public Member Functions | |
seq (double length=0) | |
Creates a sequence of size length as [0, 1, 2..., length - 1]. | |
~seq () | |
Destructor. | |
seq (double begin, double end, double step=1) | |
Creates a sequence starting at begin, ending at or before end (inclusive) with increments as step. | |
seq (seq other, bool is_gfor) | |
Copy constructor. | |
seq (const af_seq &s_) | |
Create a seq object from an af_seq struct. | |
seq & | operator= (const af_seq &s) |
Assignment operator to create a new sequence from an af_seq. | |
seq | operator- () |
Negation operator creates a sequence with the signs negated. | |
seq | operator+ (double x) |
Addition operator offsets the begin and end by x. | |
seq | operator- (double x) |
Subtraction operator offsets the begin and end by x. | |
seq | operator* (double x) |
Multiplication operator spaces the sequence by a factor x. | |
operator array () const | |
Implicit conversion operator from seq to af::array. | |
Data Fields | |
af_seq | s |
Get the af_seq C-style struct. | |
size_t | size |
Get's the length of the sequence. | |
bool | m_gfor |
Flag for gfor. | |
Friends | |
seq | operator+ (double x, seq y) |
seq | operator- (double x, seq y) |
seq | operator* (double x, seq y) |
seq is used to create sequences for indexing af::array
Creates a sequence of size length as [0, 1, 2..., length - 1].
The sequence has begin as 0, end as length - 1 and step as 1.
[in] | length | is the size of the seq to be created. |
~seq | ( | ) |
Destructor.
Creates a sequence starting at begin, ending at or before end (inclusive) with increments as step.
The sequence will be [begin, begin + step, begin + 2 * step...., begin + n * step] where the begin + n * step <= end.
[in] | begin | is the start of the sequence |
[in] | end | is the maximum value a sequence can take (inclusive) |
[in] | step | is the increment or decrement size (default is 1) |
Copy constructor.
Creates a copy seq from another sequence.
[in] | other | seqence to be copies |
[in] | is_gfor | is the gfor flag |
Addition operator offsets the begin and end by x.
There is no change in step.
begin is changed to begin + x end is changed to end + x
Negation operator creates a sequence with the signs negated.
begin is changed to -begin end is changed to -end step is changed to -step
Subtraction operator offsets the begin and end by x.
There is no change in step.
begin is changed to begin - x end is changed to end - x
Assignment operator to create a new sequence from an af_seq.
This operator creates a new sequence using the begin, end and step from the input sequence.
[in] | s | is the input sequence |