ndarray
NumPy-friendly multidimensional arrays in C++
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
ndarray::Vector< T, 0 > Struct Template Reference

PArtial specialization for zero-size vectors to avoid compiler errors on some platforms. More...

#include <Vector.h>

Public Types

typedef T Element
 
typedef T Value
 
typedef T & Reference
 
typedef T const & ConstReference
 
typedef T * Iterator
 
typedef T const * ConstIterator
 
typedef Value value_type
 
typedef Iterator iterator
 
typedef ConstIterator const_iterator
 
typedef Reference reference
 
typedef ConstReference const_reference
 
typedef boost::reverse_iterator< T * > reverse_iterator
 
typedef boost::reverse_iterator< const T * > const_reverse_iterator
 
typedef T * pointer
 
typedef int difference_type
 
typedef int size_type
 
typedef boost::mpl::int_< 0 > ND
 

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.
 

Detailed Description

template<typename T>
struct ndarray::Vector< T, 0 >

PArtial specialization for zero-size vectors to avoid compiler errors on some platforms.

Constructor & Destructor Documentation

◆ Vector()

template<typename T >
ndarray::Vector< T, 0 >::Vector ( )
inline

Default constructor.

Initializes the elements to zero.


The documentation for this struct was generated from the following file: