Toast++  1.0.2 (r.539)
Forward and inverse modelling in optical tomography
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cuspTVector< VT > Class Template Reference
Inheritance diagram for cuspTVector< VT >:
TVector< VT >

Public Member Functions

 cuspTVector (int dim, VT *values)
 
void Set (const TVector< VT > &v)
 
TVector< VT > & Get ()
 
cuspTVector< VT > & operator= (const cuspTVector< VT > &v)
 
- Public Member Functions inherited from TVector< VT >
 TVector ()
 Constructor. Creates a vector of length 0.
 
 TVector (int dim)
 Constructor. Create a vector of length 'dim' and zero all elements. More...
 
 TVector (int dim, const VT s)
 Constructor. Creates a vector of length 'dim' and set all values to 's'. More...
 
 TVector (int dim, VT *values, CopyMode cmode=DEEP_COPY)
 Constructor. Create a vector of length 'dim' and initialise from 'values' array. More...
 
 TVector (int dim, const char *init)
 Constructor. Create a vector of length 'dim' and initialise values from a text string. More...
 
 TVector (const TVector< VT > &v)
 Copy constructor. Create vector as copy of another vector. More...
 
 TVector (const TVector< VT > &v, int ofs, int dim)
 Reference constructor. Create a vector which shares its data block with vector v. More...
 
 ~TVector ()
 Destructor. Delete vector and deallocate data block.
 
int Dim () const
 Returns the size of the vector. More...
 
VT & operator[] (int i) const
 Vector element access operator (read and write) More...
 
TVectoroperator= (const TVector &v)
 Assignment operator. More...
 
TVectoroperator= (VT s)
 Scalar assignment. All vector elements are set to 's'.
 
void Copy (const TVector &v)
 Vector copy. Replaces the vector with a copy of 'v'. More...
 
void Copy (const TVector &v, int tofs, int sofs, int n)
 Partial vector copy. Replaces the vector with a part of 'v'. More...
 
void New (int dim)
 Resize the vector. More...
 
void Clear ()
 Zeroes all elements. More...
 
void Relink (const TVector &v)
 Link the vector to the data block of another vector. More...
 
void Relink (const TVector &v, int ofs, int n)
 Link the vector to part of the data block of another vector. More...
 
void Relink (VT *values, int dim)
 Link vector to an external data array. More...
 
VT * data_buffer ()
 Direct access to vector data array. More...
 
const VT * data_buffer () const
 Direct access to vector data array. More...
 
bool Clip (VT vmin, VT vmax)
 Truncate vector elements to specified range. More...
 
void ShiftLeft (int n)
 Move vector elements left. More...
 
void ShiftRight (int n)
 Move vector elements right. More...
 
TVector operator+ (const TVector &v) const
 Element-wise addition of vectors. More...
 
TVector operator- (const TVector &v) const
 Element-wise subtraction of vectors. More...
 
TVector operator* (const TVector &v) const
 Element-wise multiplication of vectors. More...
 
TVector operator/ (const TVector &v) const
 Element-wise division of vectors. More...
 
TVector operator+ (const VT &s) const
 Element-wise addition with a scalar. More...
 
TVector operator- (const VT &s) const
 Element-wise subtraction of a scalar. More...
 
TVector operator* (const VT &s) const
 Element-wise multiplication with a scalar. More...
 
TVector operator/ (const VT &s) const
 Element-wise division by a scalar. More...
 
TVector operator- () const
 Unary minus. More...
 
VT operator& (const TVector &v) const
 Dot product of two vectors. More...
 
TVectoroperator+= (const TVector &v)
 Element-wise addition/assignment of vectors. More...
 
TVectoroperator-= (const TVector &v)
 Element-wise subtraction/assignment of vectors. More...
 
TVectoroperator*= (const TVector &v)
 Element-wise multiplication/assignment of vectors. More...
 
TVectoroperator/= (const TVector &v)
 Element-wise division/assignment of vectors. More...
 
TVectoroperator+= (const VT &s)
 Element-wise addition/assignment with a scalar. More...
 
TVectoroperator-= (const VT &s)
 Element-wise subtraction/assignment of a scalar. More...
 
TVectoroperator*= (const VT &s)
 Element-wise multiplication/assignment with a scalar. More...
 
TVectoroperator/= (const VT &s)
 Element-wise division/assignment of a scalar. More...
 
void Read (std::istream &is, int start=0, int n=-1)
 Read vector from stream. More...
 
void ReadIndexed (std::istream &is, int n=-1)
 Read indexed vector elements from stream. More...
 
void Scan (const char *cbuf, int nmax=0)
 Initialise vector elements from a string. More...
 

Protected Member Functions

void MapHostToDev ()
 
void MapDevToHost ()
 
- Protected Member Functions inherited from TVector< VT >
void Allocate (int dim)
 Allocate data buffer. More...
 
void Link (const TVector< VT > &vec)
 Link the vector to the data block of another vector. More...
 
void Link (const TVector< VT > &vec, int ofs, int dim)
 Link the vector to part of the data block of another vector. More...
 
void Link (VT *values, int dim)
 Link vector to an external data buffer. More...
 
void Unlink ()
 Unlink vector from its data block. More...
 

Protected Attributes

cusp::array1d< VT,
cusp::device_memory > 
dv
 
- Protected Attributes inherited from TVector< VT >
int size
 vector length
 
int * base_size
 pointer to length of linked data block
 
int * base_nref
 pointer to data block reference counter
 
VT * data
 pointer to first vector element
 
VT * base_data
 pointer to linked data block
 

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