|
ndarray
NumPy-friendly multidimensional arrays in C++
|
PArtial specialization for zero-size vectors to avoid compiler errors on some platforms. More...
#include <Vector.h>
Public Member Functions | |
| size_type | size () const |
| Return the size of the Vector. | |
| size_type | max_size () const |
| Return the size of the Vector. | |
| bool | empty () const |
| Return true if size() == 0. | |
| iterator | begin () |
| Return an iterator to the beginning of the Vector. | |
| const_iterator | begin () const |
| Return a const_iterator to the beginning of the Vector. | |
| iterator | end () |
| Return an iterator to the end of the Vector. | |
| const_iterator | end () const |
| Return a const_iterator to the end of the Vector. | |
| reverse_iterator | rbegin () |
| Return a reverse_iterator to the beginning of the reversed Vector. | |
| const_reverse_iterator | rbegin () const |
| Return a const_reverse_iterator to the beginning of the reversed Vector. | |
| reverse_iterator | rend () |
| Return a reverse_iterator to the end of the reversed Vector. | |
| const_reverse_iterator | rend () const |
| Return a const_reverse_iterator to the end of the reversed Vector. | |
| reference | front () |
| Return a reference to the first element. | |
| reference | back () |
| Return a reference to the last element. | |
| const_reference | front () const |
| Return a const_reference to the first element. | |
| const_reference | back () const |
| Return a const_reference to the last element. | |
| reference | operator[] (int i) |
| Return a reference to the element with the given index. | |
| const_reference | operator[] (int i) const |
| Return a const_reference to the element with the given index. | |
| template<int Start, int Stop> | |
| Vector< T, Stop-Start > | getRange () const |
| Create a new Vector that is a subset of this. | |
| template<int M> | |
| Vector< T, M > | first () const |
| Create a new Vector from the first M elements of this. | |
| template<int M> | |
| Vector< T, M > | last () const |
| Create a new Vector from the last M elements of this. | |
| Vector () | |
| Default constructor. | |
| Vector (T scalar) | |
| Construct with copies of a scalar. | |
| template<typename U > | |
| Vector (Vector< U, 0 > const &other) | |
| Converting copy constructor. | |
| bool | operator== (Vector const &other) const |
| Return true if elements of other are equal to the elements of this. | |
| bool | operator!= (Vector const &other) const |
| Return false if any elements of other are not equal to the elements of this. | |
| T | sum () const |
| Return the sum of all elements. | |
| T | product () const |
| Return the product of all elements. | |
| Vector | reverse () const |
| Return a Vector with the elements reversed. | |
| template<typename U > | |
| Vector< U, 0 > | cast () const |
| Cast the vector element-wise to another type. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, Vector< T, 0 > const &obj) |
| Stream output. | |
PArtial specialization for zero-size vectors to avoid compiler errors on some platforms.
|
inline |
Default constructor.
Initializes the elements to zero.