ArrayFire: seq Class Reference
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]. 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 other, 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 sequences for indexing af::array
- Examples
- computer_vision/fast.cpp, computer_vision/harris.cpp, computer_vision/matching.cpp, computer_vision/susan.cpp, getting_started/rainfall.cpp, getting_started/vectorize.cpp, graphics/field.cpp, graphics/gravity_sim.cpp, graphics/plot2d.cpp, graphics/plot3.cpp, helloworld/helloworld.cpp, image_processing/binary_thresholding.cpp, image_processing/confidence_connected_components.cpp, image_processing/filters.cpp, image_processing/image_editing.cpp, image_processing/morphing.cpp, image_processing/pyramids.cpp, lin_algebra/svd.cpp, machine_learning/bagging.cpp, machine_learning/deep_belief_net.cpp, machine_learning/geneticalgorithm.cpp, machine_learning/kmeans.cpp, machine_learning/neural_network.cpp, machine_learning/rbm.cpp, and pde/bhrt.cpp.
◆ seq() [1/4]
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.
- Note
- When doing seq(-n), where n is > 0, then the sequence is generated as 0...-n but step remains +1. This is because when such a sequence is used for indexing af::array, then -n represents n elements from the end. That is, seq(-2) will imply indexing an array 0...dimSize - 2.
seq a(10);
seq is used to create sequences for indexing af::array
- Parameters
-
[in] length is the size of the seq to be created.
◆ seq() [2/4]
| 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.
- Parameters
-
[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)
◆ seq() [3/4]
Copy constructor.
Creates a copy seq from another sequence.
- Parameters
-
[in] other seqence to be copies [in] is_gfor is the gfor flag
◆ seq() [4/4]
Create a seq object from an af_seq struct.
- Parameters
◆ operator array()
Implicit conversion operator from seq to af::array.
Convertes a seq object into an af::array object. The contents of the af:array will be the explicit values from the seq.
- Note
- Do not use this to create arrays of sequences. Use range.
◆ operator*()
|
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
Definition at line 199 of file seq.h.
seq(double length=0)
Creates a sequence of size length as [0, 1, 2..., length - 1].
double end
End position of the sequence (inclusive)
double step
Step size between sequence values.
double begin
Start position of the sequence.
◆ operator+()
|
inline |
◆ operator-() [1/2]
Negation operator creates a sequence with the signs negated.
begin is changed to -begin end is changed to -end step is changed to -step
◆ operator-() [2/2]
|
inline |
◆ operator=()
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.
- Parameters
-
[in] s is the input sequence
◆ operator*
◆ operator+
◆ operator-
◆ m_gfor
◆ s
◆ size
The documentation for this class was generated from the following file: