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

Sparse vector that stores only non-default entries in an associative key-to-value container. More...

#include <Vector.hpp>

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

Public Types

typedef T ValueType
 
typedef std::size_t SizeType
 The unsigned size type. More...
 
typedef std::ptrdiff_t DifferenceType
 The signed difference type. More...
 
typedef A::key_type KeyType
 The key type used by the underlying associative container. More...
 
typedef const T & ConstReference
 Constant reference type to a stored element value. More...
 
typedef SparseContainerElement< SelfType, KeyTypeReference
 Mutable reference type (a proxy object that inserts on assignment to a previously-absent key). More...
 
typedef A ArrayType
 The underlying associative container type. More...
 
typedef T * Pointer
 Pointer type for raw access to stored entries. More...
 
typedef const T * ConstPointer
 Constant pointer type for raw access to stored entries. 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 SelfType VectorTemporaryType
 Concrete temporary vector type used by expression-template machinery. More...
 
typedef std::shared_ptr< SelfTypeSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated SparseVector instances. More...
 
typedef std::initializer_list< T > InitializerListType
 The initializer-list type accepted by constructors and assignment. More...
 
- 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
 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

 SparseVector ()
 Constructs an empty sparse vector (size zero, no stored entries). More...
 
 SparseVector (SizeType n)
 Constructs a sparse vector of size n with no stored entries (every position reads as the default value). More...
 
 SparseVector (const SparseVector &v)
 Constructs a copy of the sparse vector v. More...
 
 SparseVector (SparseVector &&v)
 Move-constructs from v (v is left in a valid empty state). More...
 
 SparseVector (InitializerListType l)
 Constructs a sparse vector with the contents of the initializer list l. More...
 
template<typename E >
 SparseVector (const VectorExpression< E > &e)
 Constructs a sparse vector from the vector expression e. More...
 
Reference operator[] (SizeType i)
 Returns a mutable proxy reference to the element at index i (alias for operator()). More...
 
ConstReference operator[] (SizeType i) const
 Returns a const reference to the element at index i (alias for operator()). More...
 
Reference operator() (SizeType i)
 Returns a mutable proxy reference to the element at index i. More...
 
ConstReference operator() (SizeType i) const
 Returns a const reference to the element at index i. More...
 
SizeType getNumElements () const
 Returns the number of explicitly stored (non-default) entries. More...
 
bool isEmpty () const
 Tells whether the vector's logical size is zero. More...
 
SizeType getSize () const
 Returns the logical element count. More...
 
SizeType getMaxSize () const
 Returns the maximum number of stored entries the underlying associative container can hold. More...
 
ArrayTypegetData ()
 Returns a mutable reference to the underlying associative container of stored entries. More...
 
const ArrayTypegetData () const
 Returns a const reference to the underlying associative container of stored entries. More...
 
SparseVectoroperator= (const SparseVector &v)
 Copy-assigns the contents of v to this sparse vector. More...
 
SparseVectoroperator= (SparseVector &&v)
 Move-assigns the contents of v to this sparse vector. More...
 
SparseVectoroperator= (InitializerListType l)
 Assigns the contents of the initializer list l to this sparse vector. More...
 
template<typename C >
SparseVectoroperator= (const VectorContainer< C > &c)
 Assigns the contents of the vector container c to this sparse vector (no alias check needed). More...
 
template<typename E >
SparseVectoroperator= (const VectorExpression< E > &e)
 Assigns the vector expression e to this sparse vector (via a temporary to handle aliasing). More...
 
template<typename C >
SparseVectoroperator+= (const VectorContainer< C > &c)
 Adds the contents of the vector container c element-wise to this sparse vector (no alias check needed). More...
 
SparseVectoroperator+= (InitializerListType l)
 Adds the contents of the initializer list l element-wise to this sparse vector. More...
 
template<typename E >
SparseVectoroperator+= (const VectorExpression< E > &e)
 Adds the vector expression e element-wise to this sparse vector (via a temporary to handle aliasing). More...
 
template<typename C >
SparseVectoroperator-= (const VectorContainer< C > &c)
 Subtracts the contents of the vector container c element-wise from this sparse vector (no alias check needed). More...
 
SparseVectoroperator-= (InitializerListType l)
 Subtracts the contents of the initializer list l element-wise from this sparse vector. More...
 
template<typename E >
SparseVectoroperator-= (const VectorExpression< E > &e)
 Subtracts the vector expression e element-wise from this sparse vector (via a temporary to handle aliasing). More...
 
template<typename T1 >
std::enable_if< IsScalar< T1 >::value, SparseVector >::type & operator*= (const T1 &t)
 Multiplies every stored entry by the scalar t. More...
 
template<typename T1 >
std::enable_if< IsScalar< T1 >::value, SparseVector >::type & operator/= (const T1 &t)
 Divides every stored entry by the scalar t. More...
 
template<typename E >
SparseVectorassign (const VectorExpression< E > &e)
 Resizes this vector to match e and assigns the elements of e without intermediate temporary. More...
 
SparseVectorassign (InitializerListType l)
 Resizes this vector to match l and assigns the elements of l. More...
 
template<typename E >
SparseVectorplusAssign (const VectorExpression< E > &e)
 Adds the elements of the vector expression e to this vector without intermediate temporary. More...
 
SparseVectorplusAssign (InitializerListType l)
 Adds the contents of the initializer list l element-wise to this vector without intermediate temporary. More...
 
template<typename E >
SparseVectorminusAssign (const VectorExpression< E > &e)
 Subtracts the elements of the vector expression e from this vector without intermediate temporary. More...
 
SparseVectorminusAssign (InitializerListType l)
 Subtracts the contents of the initializer list l element-wise from this vector without intermediate temporary. More...
 
void swap (SparseVector &v)
 Swaps the contents of this sparse vector with those of v. More...
 
void clear ()
 Removes all explicitly stored entries (the logical size remains unchanged). More...
 
void resize (SizeType n)
 Resizes the logical element count to n, dropping any stored entries at indices beyond n. More...
 
- Public Member Functions inherited from CDPL::Math::VectorContainer< SparseVector< T, std::unordered_map< std::size_t, 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 (SparseVector &v1, SparseVector &v2)
 ADL-enabled free-function form of swap(). More...
 

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< E >
 VectorExpression ()
 
 ~VectorExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

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

Sparse vector that stores only non-default entries in an associative key-to-value container.

Template Parameters
TThe scalar value type.
AThe underlying associative container type (default: std::unordered_map).

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

The unsigned size type.

◆ DifferenceType

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

The signed difference type.

◆ KeyType

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

The key type used by the underlying associative container.

◆ ConstReference

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

Constant reference type to a stored element value.

◆ Reference

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

Mutable reference type (a proxy object that inserts on assignment to a previously-absent key).

◆ ArrayType

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

The underlying associative container type.

◆ Pointer

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

Pointer type for raw access to stored entries.

◆ ConstPointer

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

Constant pointer type for raw access to stored entries.

◆ ClosureType

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

Closure type used when this vector appears inside another expression.

◆ ConstClosureType

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

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

◆ VectorTemporaryType

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

Concrete temporary vector type used by expression-template machinery.

◆ SharedPointer

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

A reference-counted smart pointer [SHPTR] for dynamically allocated SparseVector instances.

◆ InitializerListType

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

The initializer-list type accepted by constructors and assignment.

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

Constructs an empty sparse vector (size zero, no stored entries).

◆ SparseVector() [2/6]

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

Constructs a sparse vector of size n with no stored entries (every position reads as the default value).

Parameters
nThe logical element count.

◆ 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

Constructs a copy of the sparse vector v.

Parameters
vThe sparse vector to copy.

◆ 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

Move-constructs from v (v is left in a valid empty state).

Parameters
vThe sparse vector to move from.

◆ SparseVector() [5/6]

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

Constructs a sparse vector with the contents of the initializer list l.

Parameters
lThe initializer list providing the initial elements.

◆ 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

Constructs a sparse vector from the vector expression e.

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.

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

Returns a mutable proxy reference to the element at index i (alias for operator()).

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

◆ 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

Returns a const reference to the element at index i (alias for operator()).

Parameters
iThe zero-based element index.
Returns
A const reference to the element (or to the zero element if no entry is stored at i).
Exceptions
Base::IndexErrorif i is out of range.

◆ 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

Returns a mutable proxy reference to the element at index i.

Parameters
iThe zero-based element index.
Returns
A mutable proxy reference (creates a stored entry on first assignment).
Exceptions
Base::IndexErrorif i is out of range.

◆ 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

Returns a const reference to the element at index i.

Parameters
iThe zero-based element index.
Returns
A const reference to the stored value, or to the zero element if no entry exists at i.
Exceptions
Base::IndexErrorif i is out of range.

◆ getNumElements()

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

Returns the number of explicitly stored (non-default) entries.

Returns
The number of stored entries.

◆ isEmpty()

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

Tells whether the vector's logical size is zero.

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

◆ getSize()

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

Returns the logical element count.

Returns
The number of elements.

◆ getMaxSize()

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

Returns the maximum number of stored entries the underlying associative container can hold.

Returns
The maximum entry count.

◆ getData() [1/2]

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

Returns a mutable reference to the underlying associative container of stored entries.

Returns
A mutable reference to the storage container.

◆ 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

Returns a const reference to the underlying associative container of stored entries.

Returns
A const reference to the storage container.

◆ 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

Copy-assigns the contents of v to this sparse vector.

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

◆ 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

Move-assigns the contents of v to this sparse vector.

Parameters
vThe source sparse vector (left in a valid but unspecified state).
Returns
A reference to itself.

◆ 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

Assigns the contents of the initializer list l to this sparse vector.

Parameters
lThe initializer list providing the new elements.
Returns
A reference to itself.

◆ 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

Assigns the contents of the vector container c to this sparse vector (no alias check needed).

Template Parameters
CThe source vector container type.
Parameters
cThe source vector container.
Returns
A reference to itself.

◆ 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

Assigns the vector expression e to this sparse vector (via a temporary to handle aliasing).

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.
Returns
A reference to itself.

◆ 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

Adds the contents of the vector container c element-wise to this sparse vector (no alias check needed).

Template Parameters
CThe source vector container type.
Parameters
cThe source vector container.
Returns
A reference to itself.

◆ 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

Adds the contents of the initializer list l element-wise to this sparse vector.

Parameters
lThe initializer list providing the addends.
Returns
A reference to itself.

◆ 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

Adds the vector expression e element-wise to this sparse vector (via a temporary to handle aliasing).

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.
Returns
A reference to itself.

◆ 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

Subtracts the contents of the vector container c element-wise from this sparse vector (no alias check needed).

Template Parameters
CThe source vector container type.
Parameters
cThe source vector container.
Returns
A reference to itself.

◆ 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

Subtracts the contents of the initializer list l element-wise from this sparse vector.

Parameters
lThe initializer list providing the subtrahends.
Returns
A reference to itself.

◆ 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

Subtracts the vector expression e element-wise from this sparse vector (via a temporary to handle aliasing).

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.
Returns
A reference to itself.

◆ 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

Multiplies every stored entry by the scalar t.

Template Parameters
T1The scalar type.
Parameters
tThe scalar multiplier.
Returns
A reference to itself.

◆ 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

Divides every stored entry by the scalar t.

Template Parameters
T1The scalar type.
Parameters
tThe scalar divisor.
Returns
A reference to itself.

◆ 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

Resizes this vector to match e and assigns the elements of e without intermediate temporary.

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.
Returns
A reference to itself.

◆ 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

Resizes this vector to match l and assigns the elements of l.

Parameters
lThe initializer list providing the new elements.
Returns
A reference to itself.

◆ 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

Adds the elements of the vector expression e to this vector without intermediate temporary.

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.
Returns
A reference to itself.

◆ 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

Adds the contents of the initializer list l element-wise to this vector without intermediate temporary.

Parameters
lThe initializer list providing the addends.
Returns
A reference to itself.

◆ 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

Subtracts the elements of the vector expression e from this vector without intermediate temporary.

Template Parameters
EThe source vector expression type.
Parameters
eThe source vector expression.
Returns
A reference to itself.

◆ 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

Subtracts the contents of the initializer list l element-wise from this vector without intermediate temporary.

Parameters
lThe initializer list providing the subtrahends.
Returns
A reference to itself.

◆ 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

Swaps the contents of this sparse vector with those of v.

Parameters
vThe sparse vector to swap with.

◆ clear()

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

Removes all explicitly stored entries (the logical size remains unchanged).

◆ resize()

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

Resizes the logical element count to n, dropping any stored entries at indices beyond n.

Parameters
nThe new logical element count.

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

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

Parameters
v1The first sparse vector.
v2The second sparse vector.

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