Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Friends | List of all members
CDPL::Math::ZeroVector< T > Class Template Reference

Constant vector expression whose elements are all zero. More...

#include <Vector.hpp>

+ Inheritance diagram for CDPL::Math::ZeroVector< T >:

Public Types

typedef T ValueType
 The scalar value type. More...
 
typedef const T & Reference
 Reference type (always a const reference — all elements are zero). More...
 
typedef const T & ConstReference
 Constant reference type to the zero element. More...
 
typedef std::size_t SizeType
 The unsigned size type. More...
 
typedef std::ptrdiff_t DifferenceType
 The signed difference type. More...
 
typedef VectorReference< SelfTypeClosureType
 Closure type used when this vector appears inside another expression. More...
 
typedef const VectorReference< const SelfTypeConstClosureType
 Constant closure type used when this vector appears inside another expression. More...
 
typedef Vector< T > VectorTemporaryType
 Concrete temporary vector type used by expression-template machinery. More...
 
- Public Types inherited from CDPL::Math::VectorContainer< ZeroVector< T > >
typedef ZeroVector< T > ContainerType
 The derived vector container type. More...
 
- Public Types inherited from CDPL::Math::VectorExpression< E >
typedef E ExpressionType
 The derived vector expression type. More...
 
- Public Types inherited from CDPL::Math::Expression< E >
typedef E ExpressionType
 The derived expression type (made available to expression-template machinery). More...
 

Public Member Functions

 ZeroVector ()
 Constructs an empty zero vector. More...
 
 ZeroVector (SizeType n)
 Constructs a zero vector of size n. More...
 
 ZeroVector (const ZeroVector &v)
 Constructs a copy of the zero vector v. More...
 
ConstReference operator[] (SizeType i) const
 Returns a const reference to the zero element (alias for operator()). More...
 
ConstReference operator() (SizeType i) const
 Returns a const reference to the zero element. More...
 
bool isEmpty () const
 Tells whether the vector has zero logical size. More...
 
SizeType getSize () const
 Returns the logical element count. More...
 
SizeType getMaxSize () const
 Returns the maximum representable element count. More...
 
ZeroVectoroperator= (const ZeroVector &v)
 Copy-assigns the logical size from v. More...
 
void resize (SizeType n)
 Resizes the logical element count to n. More...
 
void swap (ZeroVector &v)
 Swaps the logical sizes with v. More...
 
- Public Member Functions inherited from CDPL::Math::VectorContainer< ZeroVector< T > >
const ContainerTypeoperator() () const
 Returns a const reference to the derived vector container. More...
 
ContainerTypeoperator() ()
 Returns a reference to the derived vector container. More...
 
- Public Member Functions inherited from CDPL::Math::VectorExpression< E >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived vector expression. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived vector expression. More...
 

Friends

void swap (ZeroVector &v1, ZeroVector &v2)
 ADL-enabled free-function form of swap(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::VectorContainer< ZeroVector< T > >
 VectorContainer ()
 
 ~VectorContainer ()
 
- Protected Member Functions inherited from CDPL::Math::VectorExpression< E >
 VectorExpression ()
 
 ~VectorExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

template<typename T>
class CDPL::Math::ZeroVector< T >

Constant vector expression whose elements are all zero.

Template Parameters
TThe scalar value type.

Member Typedef Documentation

◆ ValueType

template<typename T >
typedef T CDPL::Math::ZeroVector< T >::ValueType

The scalar value type.

◆ Reference

template<typename T >
typedef const T& CDPL::Math::ZeroVector< T >::Reference

Reference type (always a const reference — all elements are zero).

◆ ConstReference

template<typename T >
typedef const T& CDPL::Math::ZeroVector< T >::ConstReference

Constant reference type to the zero element.

◆ SizeType

template<typename T >
typedef std::size_t CDPL::Math::ZeroVector< T >::SizeType

The unsigned size type.

◆ DifferenceType

template<typename T >
typedef std::ptrdiff_t CDPL::Math::ZeroVector< T >::DifferenceType

The signed difference type.

◆ ClosureType

template<typename T >
typedef VectorReference<SelfType> CDPL::Math::ZeroVector< T >::ClosureType

Closure type used when this vector appears inside another expression.

◆ ConstClosureType

template<typename T >
typedef const VectorReference<const SelfType> CDPL::Math::ZeroVector< T >::ConstClosureType

Constant closure type used when this vector appears inside another expression.

◆ VectorTemporaryType

template<typename T >
typedef Vector<T> CDPL::Math::ZeroVector< T >::VectorTemporaryType

Concrete temporary vector type used by expression-template machinery.

Constructor & Destructor Documentation

◆ ZeroVector() [1/3]

template<typename T >
CDPL::Math::ZeroVector< T >::ZeroVector ( )
inline

Constructs an empty zero vector.

◆ ZeroVector() [2/3]

template<typename T >
CDPL::Math::ZeroVector< T >::ZeroVector ( SizeType  n)
inlineexplicit

Constructs a zero vector of size n.

Parameters
nThe element count.

◆ ZeroVector() [3/3]

template<typename T >
CDPL::Math::ZeroVector< T >::ZeroVector ( const ZeroVector< T > &  v)
inline

Constructs a copy of the zero vector v.

Parameters
vThe zero vector to copy.

Member Function Documentation

◆ operator[]()

template<typename T >
ConstReference CDPL::Math::ZeroVector< T >::operator[] ( SizeType  i) const
inline

Returns a const reference to the zero element (alias for operator()).

Parameters
iThe zero-based element index.
Returns
A const reference to the zero element.
Exceptions
Base::IndexErrorif i is out of range.

◆ operator()()

template<typename T >
ConstReference CDPL::Math::ZeroVector< T >::operator() ( SizeType  i) const
inline

Returns a const reference to the zero element.

Parameters
iThe zero-based element index.
Returns
A const reference to the zero element.
Exceptions
Base::IndexErrorif i is out of range.

◆ isEmpty()

template<typename T >
bool CDPL::Math::ZeroVector< T >::isEmpty ( ) const
inline

Tells whether the vector has zero logical size.

Returns
true if the logical size is zero, and false otherwise.

◆ getSize()

template<typename T >
SizeType CDPL::Math::ZeroVector< T >::getSize ( ) const
inline

Returns the logical element count.

Returns
The element count.

◆ getMaxSize()

template<typename T >
SizeType CDPL::Math::ZeroVector< T >::getMaxSize ( ) const
inline

Returns the maximum representable element count.

Returns
The maximum element count.

◆ operator=()

template<typename T >
ZeroVector& CDPL::Math::ZeroVector< T >::operator= ( const ZeroVector< T > &  v)
inline

Copy-assigns the logical size from v.

Parameters
vThe source zero vector.
Returns
A reference to itself.

◆ resize()

template<typename T >
void CDPL::Math::ZeroVector< T >::resize ( SizeType  n)
inline

Resizes the logical element count to n.

Parameters
nThe new element count.

◆ swap()

template<typename T >
void CDPL::Math::ZeroVector< T >::swap ( ZeroVector< T > &  v)
inline

Swaps the logical sizes with v.

Parameters
vThe zero vector to swap with.

Friends And Related Function Documentation

◆ swap

template<typename T >
void swap ( ZeroVector< T > &  v1,
ZeroVector< T > &  v2 
)
friend

ADL-enabled free-function form of swap().

Parameters
v1The first zero vector.
v2The second zero vector.

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