VectorHelperFunctions.hpp File Reference

#include <cassert>
#include <vector>
#include <nvector/nvector_serial.h>

Include dependency graph for VectorHelperFunctions.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename VECTOR>
double GetVectorComponent (const VECTOR &rVec, unsigned index)
template<typename VECTOR>
void SetVectorComponent (VECTOR &rVec, unsigned index, double value)
template<typename VECTOR>
unsigned GetVectorSize (const VECTOR &rVec)
template<typename VECTOR>
void InitialiseEmptyVector (VECTOR &rVec)
template<typename VECTOR>
void DeleteVector (VECTOR &rVec)
template<>
double GetVectorComponent (const std::vector< double > &rVec, unsigned index)
template<>
void SetVectorComponent (std::vector< double > &rVec, unsigned index, double value)
template<>
unsigned GetVectorSize (const std::vector< double > &rVec)
template<>
void InitialiseEmptyVector (std::vector< double > &rVec)
template<>
void DeleteVector (std::vector< double > &rVec)
template<>
double GetVectorComponent (const N_Vector &rVec, unsigned index)
template<>
void SetVectorComponent (N_Vector &rVec, unsigned index, double value)
template<>
unsigned GetVectorSize (const N_Vector &rVec)
template<>
void InitialiseEmptyVector (N_Vector &rVec)
template<>
void DeleteVector (N_Vector &rVec)


Detailed Description

A selection of helper functions to be able to access std::vector<double> and CVODE's N_Vector types using the same interface. These are used by AbstractParameterisedSystem and some tests.

Definition in file VectorHelperFunctions.hpp.


Function Documentation

template<>
void DeleteVector ( N_Vector &  rVec  )  [inline]

Specialisation for CVODE's N_Vector type.

Parameters:
rVec 

Definition at line 221 of file VectorHelperFunctions.hpp.

template<>
void DeleteVector ( std::vector< double > &  rVec  )  [inline]

Specialisation for std::vector<double>.

Parameters:
rVec 

Definition at line 160 of file VectorHelperFunctions.hpp.

template<typename VECTOR>
void DeleteVector ( VECTOR &  rVec  )  [inline]

Helper function to delete a vector.

This isn't a member so that we can specialise it without having to specialise the whole class.

Parameters:
rVec the vector

Referenced by AbstractParameterisedSystem< VECTOR >::GetAnyVariable().

template<>
double GetVectorComponent ( const N_Vector &  rVec,
unsigned  index 
) [inline]

Specialisation for CVODE's N_Vector type.

Parameters:
rVec 
index 

Definition at line 176 of file VectorHelperFunctions.hpp.

template<>
double GetVectorComponent ( const std::vector< double > &  rVec,
unsigned  index 
) [inline]

Specialisation for std::vector<double>.

Parameters:
rVec 
index 

Definition at line 117 of file VectorHelperFunctions.hpp.

template<typename VECTOR>
double GetVectorComponent ( const VECTOR &  rVec,
unsigned  index 
) [inline]

Helper function to get a vector component.

This isn't a member so that we can specialise it without having to specialise the whole class.

Parameters:
rVec the vector to access
index the index of the component to get

Referenced by AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), AbstractParameterisedSystem< VECTOR >::GetParameter(), and AbstractParameterisedSystem< VECTOR >::GetStateVariable().

template<>
unsigned GetVectorSize ( const N_Vector &  rVec  )  [inline]

Specialisation for CVODE's N_Vector type.

Parameters:
rVec 

Definition at line 200 of file VectorHelperFunctions.hpp.

template<>
unsigned GetVectorSize ( const std::vector< double > &  rVec  )  [inline]

Specialisation for std::vector<double>.

Parameters:
rVec 

Definition at line 141 of file VectorHelperFunctions.hpp.

template<typename VECTOR>
unsigned GetVectorSize ( const VECTOR &  rVec  )  [inline]

Helper function to determine a vector's size.

This isn't a member so that we can specialise it without having to specialise the whole class.

Parameters:
rVec the vector
Returns:
its size

Referenced by AbstractParameterisedSystem< VECTOR >::GetAnyVariable(), AbstractParameterisedSystem< VECTOR >::GetNumberOfParameters(), AbstractParameterisedSystem< VECTOR >::GetParameter(), and AbstractParameterisedSystem< VECTOR >::SetParameter().

template<>
void InitialiseEmptyVector ( N_Vector &  rVec  )  [inline]

Specialisation for CVODE's N_Vector type.

Parameters:
rVec 

Definition at line 211 of file VectorHelperFunctions.hpp.

template<>
void InitialiseEmptyVector ( std::vector< double > &  rVec  )  [inline]

Specialisation for std::vector<double>.

Parameters:
rVec 

Definition at line 151 of file VectorHelperFunctions.hpp.

template<typename VECTOR>
void InitialiseEmptyVector ( VECTOR &  rVec  )  [inline]

Helper function to initialise a vector to be empty/unset.

This isn't a member so that we can specialise it without having to specialise the whole class.

Parameters:
rVec the vector

Referenced by AbstractParameterisedSystem< VECTOR >::AbstractParameterisedSystem().

template<>
void SetVectorComponent ( N_Vector &  rVec,
unsigned  index,
double  value 
) [inline]

Specialisation for CVODE's N_Vector type.

Parameters:
rVec 
index 
value 

Definition at line 189 of file VectorHelperFunctions.hpp.

template<>
void SetVectorComponent ( std::vector< double > &  rVec,
unsigned  index,
double  value 
) [inline]

Specialisation for std::vector<double>.

Parameters:
rVec 
index 
value 

Definition at line 130 of file VectorHelperFunctions.hpp.

template<typename VECTOR>
void SetVectorComponent ( VECTOR &  rVec,
unsigned  index,
double  value 
) [inline]

Helper function to set a vector component.

This isn't a member so that we can specialise it without having to specialise the whole class.

Parameters:
rVec the vector to modify
index the index of the component to set
value the new value

Referenced by AbstractParameterisedSystem< VECTOR >::SetParameter(), and AbstractParameterisedSystem< VECTOR >::SetStateVariable().


Generated on Mon Nov 1 12:35:25 2010 for Chaste by  doxygen 1.5.5