ivl 679
|
A range of Numbers. More...
#include <range.hpp>
Public Types | |
typedef ptrdiff_t | diff_type |
difference type of iterators | |
typedef size_t | size_type |
parameter of resize, in each class of the hierarchy | |
Public Member Functions | |
void | reshape (size_t len) |
Reshape is same as resize for 1-d arrays. | |
Constructors | |
< the distance between elements | |
range () | |
Default Constructor. | |
range (T s, T e) | |
Construct a range (default step) | |
range (T s, step_type st, T e) | |
Construct a range. | |
init member function | |
void | init () |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (size_t count) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (int count) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (long int count) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (size_t count, const T &s) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (size_t count, const T *ptr) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (const internal::tuple_rvalue< J > &r) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (const array &a) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (const array< J, S > &a, size_t n) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (const array< J, S > &a) |
Init is behaves exactly like the constructor. See constructor reference. | |
void | init (size_t count, const array< J, S > &a) |
Init is behaves exactly like the constructor. See constructor reference. | |
Size functions | |
size_t | length () const |
Get the length of the element sequence. | |
size_type | size () const |
Get the size of the array. generic-class function. | |
size_t | numel () const |
Get the length of the element sequence. | |
Element access | |
Access a unique element by specifying the position | |
std::vector< T >::const_reference | operator[] (size_t offset) const |
Returns the const element found at position offset. | |
std::vector< T >::reference | operator[] (size_t offset) |
Returns the element found at position offset. |
A range of Numbers.
eg: 1:2:9 = [1 3 5 7 9]
ivl::range< T >::range | ( | T | s, |
T | e | ||
) | [inline] |
Construct a range (default step)
s | Start - The starting element of the range. |
e | End - The ending element of the range. |
ivl::range< T >::range | ( | T | s, |
step_type | st, | ||
T | e | ||
) | [inline] |
Construct a range.
s | Start - The starting element of the range. |
st | Step - The distance between two consecutive elements. |
e | End - The ending element of the range |