|
seq is used to create seq 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]. More... | |
~seq () | |
Destructor. More... | |
seq (double begin, double end, double step=1) | |
Creates a sequence starting at begin, ending at or before end (inclusive) with increments as step. More... | |
seq (seq afs, bool is_gfor) | |
Copy constructor. More... | |
seq (const af_seq &s_) | |
Create a seq object from an af_seq struct. More... | |
seq & | operator= (const af_seq &s) |
Assignment operator to create a new sequence from an af_seq. More... | |
seq | operator- () |
Negation operator creates a sequence with the signs negated. More... | |
seq | operator+ (double x) |
Addition operator offsets the begin and end by x. More... | |
seq | operator- (double x) |
Subtraction operator offsets the begin and end by x. More... | |
seq | operator* (double x) |
Multiplication operator spaces the sequence by a factor x. More... | |
operator array () const | |
Implicit conversion operator from seq to af::array. More... | |
Data Fields | |
af_seq | s |
Get the af_seq C-style struct. More... | |
size_t | size |
Get's the length of the sequence. More... | |
bool | m_gfor |
Flag for gfor. More... | |
Friends | |
seq | operator+ (double x, seq y) |
seq | operator- (double x, seq y) |
seq | operator* (double x, seq y) |
seq is used to create seq for indexing af::array
seq | ( | double | length = 0 | ) |
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.
seq | ( | double | begin, |
double | end, | ||
double | step = 1 |
||
) |
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] | afs | seqence to be copies |
[in] | is_gfor | is the gfor flag |
operator array | ( | ) | const |
|
inline |
Multiplication operator spaces the sequence by a factor x.
begin is changed to begin * x end is changed to end * x step is changed to step * x
|
inline |
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
|
inline |
Negation operator creates a sequence with the signs negated.
begin is changed to -begin end is changed to -end step is changed to -step
|
inline |
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 |
bool m_gfor |
Flag for gfor.
size_t size |
Get's the length of the sequence.