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

#include <Vector.hpp>

+ Inheritance diagram for CDPL::Math::SparseVector< T, A >:

Public Types

typedef T ValueType
 
typedef std::size_t SizeType
 
typedef std::ptrdiff_t DifferenceType
 
typedef A::key_type KeyType
 
typedef const T & ConstReference
 
typedef SparseContainerElement< SelfType, KeyTypeReference
 
typedef A ArrayType
 
typedef T * Pointer
 
typedef const T * ConstPointer
 
typedef VectorReference< SelfTypeClosureType
 
typedef const VectorReference< const SelfTypeConstClosureType
 
typedef SelfType VectorTemporaryType
 
typedef std::shared_ptr< SelfTypeSharedPointer
 
typedef std::initializer_list< T > InitializerListType
 
- Public Types inherited from CDPL::Math::VectorContainer< SparseVector< T, std::unordered_map< std::size_t, T > > >
typedef SparseVector< T, std::unordered_map< std::size_t, T > > ContainerType
 
- Public Types inherited from CDPL::Math::VectorExpression< SparseVector< T, std::unordered_map< std::size_t, T > > >
typedef SparseVector< T, std::unordered_map< std::size_t, T > > ExpressionType
 
- Public Types inherited from CDPL::Math::Expression< SparseVector< T, std::unordered_map< std::size_t, T > > >
typedef SparseVector< T, std::unordered_map< std::size_t, T > > ExpressionType
 

Public Member Functions

 SparseVector ()
 
 SparseVector (SizeType n)
 
 SparseVector (const SparseVector &v)
 
 SparseVector (SparseVector &&v)
 
 SparseVector (InitializerListType l)
 
template<typename E >
 SparseVector (const VectorExpression< E > &e)
 
Reference operator[] (SizeType i)
 
ConstReference operator[] (SizeType i) const
 
Reference operator() (SizeType i)
 
ConstReference operator() (SizeType i) const
 
SizeType getNumElements () const
 
bool isEmpty () const
 
SizeType getSize () const
 
SizeType getMaxSize () const
 
ArrayTypegetData ()
 
const ArrayTypegetData () const
 
SparseVectoroperator= (const SparseVector &v)
 
SparseVectoroperator= (SparseVector &&v)
 
SparseVectoroperator= (InitializerListType l)
 
template<typename C >
SparseVectoroperator= (const VectorContainer< C > &c)
 
template<typename E >
SparseVectoroperator= (const VectorExpression< E > &e)
 
template<typename C >
SparseVectoroperator+= (const VectorContainer< C > &c)
 
SparseVectoroperator+= (InitializerListType l)
 
template<typename E >
SparseVectoroperator+= (const VectorExpression< E > &e)
 
template<typename C >
SparseVectoroperator-= (const VectorContainer< C > &c)
 
SparseVectoroperator-= (InitializerListType l)
 
template<typename E >
SparseVectoroperator-= (const VectorExpression< E > &e)
 
template<typename T1 >
std::enable_if< IsScalar< T1 >::value, SparseVector >::type & operator*= (const T1 &t)
 
template<typename T1 >
std::enable_if< IsScalar< T1 >::value, SparseVector >::type & operator/= (const T1 &t)
 
template<typename E >
SparseVectorassign (const VectorExpression< E > &e)
 
SparseVectorassign (InitializerListType l)
 
template<typename E >
SparseVectorplusAssign (const VectorExpression< E > &e)
 
SparseVectorplusAssign (InitializerListType l)
 
template<typename E >
SparseVectorminusAssign (const VectorExpression< E > &e)
 
SparseVectorminusAssign (InitializerListType l)
 
void swap (SparseVector &v)
 
void clear ()
 
void resize (SizeType n)
 
- Public Member Functions inherited from CDPL::Math::VectorContainer< SparseVector< T, std::unordered_map< std::size_t, T > > >
const ContainerTypeoperator() () const
 
ContainerTypeoperator() ()
 
- Public Member Functions inherited from CDPL::Math::VectorExpression< SparseVector< T, std::unordered_map< std::size_t, T > > >
const ExpressionTypeoperator() () const
 
ExpressionTypeoperator() ()
 

Friends

void swap (SparseVector &v1, SparseVector &v2)
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::VectorContainer< SparseVector< T, std::unordered_map< std::size_t, T > > >
 VectorContainer ()
 
 ~VectorContainer ()
 
- Protected Member Functions inherited from CDPL::Math::VectorExpression< SparseVector< T, std::unordered_map< std::size_t, T > > >
 VectorExpression ()
 
 ~VectorExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< SparseVector< T, std::unordered_map< std::size_t, T > > >
 Expression ()
 
 ~Expression ()
 

Member Typedef Documentation

◆ ValueType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef T CDPL::Math::SparseVector< T, A >::ValueType

◆ SizeType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef std::size_t CDPL::Math::SparseVector< T, A >::SizeType

◆ DifferenceType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef std::ptrdiff_t CDPL::Math::SparseVector< T, A >::DifferenceType

◆ KeyType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef A::key_type CDPL::Math::SparseVector< T, A >::KeyType

◆ ConstReference

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef const T& CDPL::Math::SparseVector< T, A >::ConstReference

◆ Reference

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef SparseContainerElement<SelfType, KeyType> CDPL::Math::SparseVector< T, A >::Reference

◆ ArrayType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef A CDPL::Math::SparseVector< T, A >::ArrayType

◆ Pointer

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef T* CDPL::Math::SparseVector< T, A >::Pointer

◆ ConstPointer

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef const T* CDPL::Math::SparseVector< T, A >::ConstPointer

◆ ClosureType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef VectorReference<SelfType> CDPL::Math::SparseVector< T, A >::ClosureType

◆ ConstClosureType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef const VectorReference<const SelfType> CDPL::Math::SparseVector< T, A >::ConstClosureType

◆ VectorTemporaryType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef SelfType CDPL::Math::SparseVector< T, A >::VectorTemporaryType

◆ SharedPointer

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef std::shared_ptr<SelfType> CDPL::Math::SparseVector< T, A >::SharedPointer

◆ InitializerListType

template<typename T , typename A = std::unordered_map<std::size_t, T>>
typedef std::initializer_list<T> CDPL::Math::SparseVector< T, A >::InitializerListType

Constructor & Destructor Documentation

◆ SparseVector() [1/6]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
CDPL::Math::SparseVector< T, A >::SparseVector ( )
inline

◆ SparseVector() [2/6]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
CDPL::Math::SparseVector< T, A >::SparseVector ( SizeType  n)
inlineexplicit

◆ SparseVector() [3/6]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
CDPL::Math::SparseVector< T, A >::SparseVector ( const SparseVector< T, A > &  v)
inline

◆ SparseVector() [4/6]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
CDPL::Math::SparseVector< T, A >::SparseVector ( SparseVector< T, A > &&  v)
inline

◆ SparseVector() [5/6]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
CDPL::Math::SparseVector< T, A >::SparseVector ( InitializerListType  l)
inline

◆ SparseVector() [6/6]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
CDPL::Math::SparseVector< T, A >::SparseVector ( const VectorExpression< E > &  e)
inline

Member Function Documentation

◆ operator[]() [1/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
Reference CDPL::Math::SparseVector< T, A >::operator[] ( SizeType  i)
inline

◆ operator[]() [2/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
ConstReference CDPL::Math::SparseVector< T, A >::operator[] ( SizeType  i) const
inline

◆ operator()() [1/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
Reference CDPL::Math::SparseVector< T, A >::operator() ( SizeType  i)
inline

◆ operator()() [2/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
ConstReference CDPL::Math::SparseVector< T, A >::operator() ( SizeType  i) const
inline

◆ getNumElements()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SizeType CDPL::Math::SparseVector< T, A >::getNumElements ( ) const
inline

◆ isEmpty()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
bool CDPL::Math::SparseVector< T, A >::isEmpty ( ) const
inline

◆ getSize()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SizeType CDPL::Math::SparseVector< T, A >::getSize ( ) const
inline

◆ getMaxSize()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SizeType CDPL::Math::SparseVector< T, A >::getMaxSize ( ) const
inline

◆ getData() [1/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
ArrayType& CDPL::Math::SparseVector< T, A >::getData ( )
inline

◆ getData() [2/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
const ArrayType& CDPL::Math::SparseVector< T, A >::getData ( ) const
inline

◆ operator=() [1/5]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::operator= ( const SparseVector< T, A > &  v)
inline

◆ operator=() [2/5]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::operator= ( SparseVector< T, A > &&  v)
inline

◆ operator=() [3/5]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::operator= ( InitializerListType  l)
inline

◆ operator=() [4/5]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename C >
SparseVector& CDPL::Math::SparseVector< T, A >::operator= ( const VectorContainer< C > &  c)
inline

◆ operator=() [5/5]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
SparseVector& CDPL::Math::SparseVector< T, A >::operator= ( const VectorExpression< E > &  e)
inline

◆ operator+=() [1/3]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename C >
SparseVector& CDPL::Math::SparseVector< T, A >::operator+= ( const VectorContainer< C > &  c)
inline

◆ operator+=() [2/3]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::operator+= ( InitializerListType  l)
inline

◆ operator+=() [3/3]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
SparseVector& CDPL::Math::SparseVector< T, A >::operator+= ( const VectorExpression< E > &  e)
inline

◆ operator-=() [1/3]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename C >
SparseVector& CDPL::Math::SparseVector< T, A >::operator-= ( const VectorContainer< C > &  c)
inline

◆ operator-=() [2/3]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::operator-= ( InitializerListType  l)
inline

◆ operator-=() [3/3]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
SparseVector& CDPL::Math::SparseVector< T, A >::operator-= ( const VectorExpression< E > &  e)
inline

◆ operator*=()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename T1 >
std::enable_if<IsScalar<T1>::value, SparseVector>::type& CDPL::Math::SparseVector< T, A >::operator*= ( const T1 &  t)
inline

◆ operator/=()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename T1 >
std::enable_if<IsScalar<T1>::value, SparseVector>::type& CDPL::Math::SparseVector< T, A >::operator/= ( const T1 &  t)
inline

◆ assign() [1/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
SparseVector& CDPL::Math::SparseVector< T, A >::assign ( const VectorExpression< E > &  e)
inline

◆ assign() [2/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::assign ( InitializerListType  l)
inline

◆ plusAssign() [1/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
SparseVector& CDPL::Math::SparseVector< T, A >::plusAssign ( const VectorExpression< E > &  e)
inline

◆ plusAssign() [2/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::plusAssign ( InitializerListType  l)
inline

◆ minusAssign() [1/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
template<typename E >
SparseVector& CDPL::Math::SparseVector< T, A >::minusAssign ( const VectorExpression< E > &  e)
inline

◆ minusAssign() [2/2]

template<typename T , typename A = std::unordered_map<std::size_t, T>>
SparseVector& CDPL::Math::SparseVector< T, A >::minusAssign ( InitializerListType  l)
inline

◆ swap()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
void CDPL::Math::SparseVector< T, A >::swap ( SparseVector< T, A > &  v)
inline

◆ clear()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
void CDPL::Math::SparseVector< T, A >::clear ( )
inline

◆ resize()

template<typename T , typename A = std::unordered_map<std::size_t, T>>
void CDPL::Math::SparseVector< T, A >::resize ( SizeType  n)
inline

Friends And Related Function Documentation

◆ swap

template<typename T , typename A = std::unordered_map<std::size_t, T>>
void swap ( SparseVector< T, A > &  v1,
SparseVector< T, A > &  v2 
)
friend

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