LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
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. More...
 
size_type max_size () const
 Return the size of the Vector. More...
 
bool empty () const
 Return true if size() == 0. More...
 
iterator begin ()
 Return an iterator to the beginning of the Vector. More...
 
const_iterator begin () const
 Return a const_iterator to the beginning of the Vector. More...
 
iterator end ()
 Return an iterator to the end of the Vector. More...
 
const_iterator end () const
 Return a const_iterator to the end of the Vector. More...
 
reverse_iterator rbegin ()
 Return a reverse_iterator to the beginning of the reversed Vector. More...
 
const_reverse_iterator rbegin () const
 Return a const_reverse_iterator to the beginning of the reversed Vector. More...
 
reverse_iterator rend ()
 Return a reverse_iterator to the end of the reversed Vector. More...
 
const_reverse_iterator rend () const
 Return a const_reverse_iterator to the end of the reversed Vector. More...
 
reference front ()
 Return a reference to the first element. More...
 
reference back ()
 Return a reference to the last element. More...
 
const_reference front () const
 Return a const_reference to the first element. More...
 
const_reference back () const
 Return a const_reference to the last element. More...
 
reference operator[] (int i)
 Return a reference to the element with the given index. More...
 
const_reference operator[] (int i) const
 Return a const_reference to the element with the given index. More...
 
template<int Start, int Stop>
Vector< T, Stop-Start > getRange () const
 Create a new Vector that is a subset of this. More...
 
template<int M>
Vector< T, M > first () const
 Create a new Vector from the first M elements of this. More...
 
template<int M>
Vector< T, M > last () const
 Create a new Vector from the last M elements of this. More...
 
 Vector ()
 Default constructor. More...
 
template<typename U >
 Vector (U scalar)
 Construct with copies of a scalar. More...
 
template<typename U >
 Vector (Vector< U, 0 > const &other)
 Converting copy constructor. More...
 
bool operator== (Vector const &other) const
 Return true if elements of other are equal to the elements of this. More...
 
bool operator!= (Vector const &other) const
 Return false if any elements of other are not equal to the elements of this. More...
 
sum () const
 Return the sum of all elements. More...
 
product () const
 Return the product of all elements. More...
 
Vector reverse () const
 Return a Vector with the elements reversed. More...
 

Friends

std::ostream & operator<< (std::ostream &os, Vector< T, 0 > const &obj)
 Stream output. More...
 

Detailed Description

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

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

Definition at line 411 of file Vector.h.

Member Typedef Documentation

template<typename T >
typedef ConstIterator ndarray::Vector< T, 0 >::const_iterator

Definition at line 422 of file Vector.h.

template<typename T >
typedef ConstReference ndarray::Vector< T, 0 >::const_reference

Definition at line 424 of file Vector.h.

template<typename T >
typedef boost::reverse_iterator<const T*> ndarray::Vector< T, 0 >::const_reverse_iterator

Definition at line 426 of file Vector.h.

template<typename T >
typedef T const* ndarray::Vector< T, 0 >::ConstIterator

Definition at line 418 of file Vector.h.

template<typename T >
typedef T const& ndarray::Vector< T, 0 >::ConstReference

Definition at line 416 of file Vector.h.

template<typename T >
typedef int ndarray::Vector< T, 0 >::difference_type

Definition at line 428 of file Vector.h.

template<typename T >
typedef T ndarray::Vector< T, 0 >::Element

Definition at line 413 of file Vector.h.

template<typename T >
typedef T* ndarray::Vector< T, 0 >::Iterator

Definition at line 417 of file Vector.h.

template<typename T >
typedef Iterator ndarray::Vector< T, 0 >::iterator

Definition at line 421 of file Vector.h.

template<typename T >
typedef boost::mpl::int_<0> ndarray::Vector< T, 0 >::ND

Definition at line 432 of file Vector.h.

template<typename T >
typedef T* ndarray::Vector< T, 0 >::pointer

Definition at line 427 of file Vector.h.

template<typename T >
typedef T& ndarray::Vector< T, 0 >::Reference

Definition at line 415 of file Vector.h.

template<typename T >
typedef Reference ndarray::Vector< T, 0 >::reference

Definition at line 423 of file Vector.h.

template<typename T >
typedef boost::reverse_iterator<T*> ndarray::Vector< T, 0 >::reverse_iterator

Definition at line 425 of file Vector.h.

template<typename T >
typedef int ndarray::Vector< T, 0 >::size_type

Definition at line 429 of file Vector.h.

template<typename T >
typedef T ndarray::Vector< T, 0 >::Value

Definition at line 414 of file Vector.h.

template<typename T >
typedef Value ndarray::Vector< T, 0 >::value_type

Definition at line 420 of file Vector.h.

Constructor & Destructor Documentation

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

Default constructor.

Initializes the elements to zero.

Definition at line 494 of file Vector.h.

494 {}
template<typename T >
template<typename U >
ndarray::Vector< T, 0 >::Vector ( scalar)
inlineexplicit

Construct with copies of a scalar.

Definition at line 498 of file Vector.h.

498 {}
template<typename T >
template<typename U >
ndarray::Vector< T, 0 >::Vector ( Vector< U, 0 > const &  other)
inlineexplicit

Converting copy constructor.

Definition at line 502 of file Vector.h.

502 {}

Member Function Documentation

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

Return a reference to the last element.

Definition at line 457 of file Vector.h.

457 { return NDARRAY_ASSERT(false); return 0; }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
template<typename T >
const_reference ndarray::Vector< T, 0 >::back ( ) const
inline

Return a const_reference to the last element.

Definition at line 461 of file Vector.h.

461 { NDARRAY_ASSERT(false); return 0; }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
template<typename T >
iterator ndarray::Vector< T, 0 >::begin ( )
inline

Return an iterator to the beginning of the Vector.

Definition at line 438 of file Vector.h.

438 { return 0; }
template<typename T >
const_iterator ndarray::Vector< T, 0 >::begin ( ) const
inline

Return a const_iterator to the beginning of the Vector.

Definition at line 440 of file Vector.h.

440 { return 0; }
template<typename T >
bool ndarray::Vector< T, 0 >::empty ( ) const
inline

Return true if size() == 0.

Definition at line 436 of file Vector.h.

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

Return an iterator to the end of the Vector.

Definition at line 442 of file Vector.h.

442 { return 0; }
template<typename T >
const_iterator ndarray::Vector< T, 0 >::end ( ) const
inline

Return a const_iterator to the end of the Vector.

Definition at line 444 of file Vector.h.

444 { return 0; }
template<typename T >
template<int M>
Vector<T,M> ndarray::Vector< T, 0 >::first ( ) const
inline

Create a new Vector from the first M elements of this.

Definition at line 475 of file Vector.h.

475  {
476  return Vector<T,M>();
477  }
template<typename T >
reference ndarray::Vector< T, 0 >::front ( )
inline

Return a reference to the first element.

Definition at line 455 of file Vector.h.

455 { NDARRAY_ASSERT(false); return 0; }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
template<typename T >
const_reference ndarray::Vector< T, 0 >::front ( ) const
inline

Return a const_reference to the first element.

Definition at line 459 of file Vector.h.

459 { NDARRAY_ASSERT(false); return 0; }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
template<typename T >
template<int Start, int Stop>
Vector<T,Stop-Start> ndarray::Vector< T, 0 >::getRange ( ) const
inline

Create a new Vector that is a subset of this.

Definition at line 470 of file Vector.h.

470  {
471  return Vector<T,Stop-Start>();
472  }
Vector()
Default constructor.
Definition: Vector.h:494
template<typename T >
template<int M>
Vector<T,M> ndarray::Vector< T, 0 >::last ( ) const
inline

Create a new Vector from the last M elements of this.

Definition at line 480 of file Vector.h.

480  {
481  return Vector<T,M>();
482  }
template<typename T >
size_type ndarray::Vector< T, 0 >::max_size ( ) const
inline

Return the size of the Vector.

Definition at line 435 of file Vector.h.

template<typename T >
bool ndarray::Vector< T, 0 >::operator!= ( Vector< T, 0 > const &  other) const
inline

Return false if any elements of other are not equal to the elements of this.

Definition at line 508 of file Vector.h.

508 { return false; }
template<typename T >
bool ndarray::Vector< T, 0 >::operator== ( Vector< T, 0 > const &  other) const
inline

Return true if elements of other are equal to the elements of this.

Definition at line 505 of file Vector.h.

505 { return true; }
template<typename T >
reference ndarray::Vector< T, 0 >::operator[] ( int  i)
inline

Return a reference to the element with the given index.

Definition at line 464 of file Vector.h.

464 { NDARRAY_ASSERT(false); return 0; }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
template<typename T >
const_reference ndarray::Vector< T, 0 >::operator[] ( int  i) const
inline

Return a const_reference to the element with the given index.

Definition at line 466 of file Vector.h.

466 { NDARRAY_ASSERT(false); return 0; }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
template<typename T >
T ndarray::Vector< T, 0 >::product ( ) const
inline

Return the product of all elements.

Definition at line 514 of file Vector.h.

514 { return 1; }
template<typename T >
reverse_iterator ndarray::Vector< T, 0 >::rbegin ( )
inline

Return a reverse_iterator to the beginning of the reversed Vector.

Definition at line 446 of file Vector.h.

446 { return reverse_iterator(); }
boost::reverse_iterator< T * > reverse_iterator
Definition: Vector.h:425
template<typename T >
const_reverse_iterator ndarray::Vector< T, 0 >::rbegin ( ) const
inline

Return a const_reverse_iterator to the beginning of the reversed Vector.

Definition at line 448 of file Vector.h.

448 { return const_reverse_iterator(); }
boost::reverse_iterator< const T * > const_reverse_iterator
Definition: Vector.h:426
template<typename T >
reverse_iterator ndarray::Vector< T, 0 >::rend ( )
inline

Return a reverse_iterator to the end of the reversed Vector.

Definition at line 450 of file Vector.h.

450 { return reverse_iterator(); }
boost::reverse_iterator< T * > reverse_iterator
Definition: Vector.h:425
template<typename T >
const_reverse_iterator ndarray::Vector< T, 0 >::rend ( ) const
inline

Return a const_reverse_iterator to the end of the reversed Vector.

Definition at line 452 of file Vector.h.

452 { return const_reverse_iterator(); }
boost::reverse_iterator< const T * > const_reverse_iterator
Definition: Vector.h:426
template<typename T >
Vector ndarray::Vector< T, 0 >::reverse ( ) const
inline

Return a Vector with the elements reversed.

Definition at line 517 of file Vector.h.

517 { return Vector(); }
Vector()
Default constructor.
Definition: Vector.h:494
template<typename T >
size_type ndarray::Vector< T, 0 >::size ( ) const
inline

Return the size of the Vector.

Definition at line 434 of file Vector.h.

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

Return the sum of all elements.

Definition at line 511 of file Vector.h.

511 { return 0; }

Friends And Related Function Documentation

template<typename T >
std::ostream& operator<< ( std::ostream &  os,
Vector< T, 0 > const &  obj 
)
friend

Stream output.

Definition at line 485 of file Vector.h.

485  {
486  return os << "()";
487  }

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