PSCF v1.1
List of all members
Pscf::IntVec< D, T > Class Template Reference

An IntVec<D, T> is a D-component vector of elements of integer type T. More...

#include <IntVec.h>

Inheritance diagram for Pscf::IntVec< D, T >:
Pscf::Vec< D, T >

Constructors

static const int Width = 10
 Width of field per Cartesian coordinate in stream IO. More...
 
 IntVec ()
 Default constructor. More...
 
 IntVec (const IntVec< D, T > &v)
 Copy constructor. More...
 
 IntVec (T const *v)
 Construct from C array. More...
 
 IntVec (T s)
 Constructor, initialize all elements to a scalar value. More...
 

Additional Inherited Members

- Public Member Functions inherited from Pscf::Vec< D, T >
 Vec ()
 Default constructor. More...
 
 Vec (const Vec< D, T > &v)
 Copy constructor. More...
 
 Vec (T const *v)
 Constructor from a C-array. More...
 
 Vec (T s)
 Constructor, initialize all elements to a common scalar value. More...
 
Vec< D, T > & operator= (const Vec< D, T > &v)
 Copy assignment. More...
 
Vec< D, T > & operator= (T s)
 Assignment all elements to the same scalar T value. More...
 
Vec< D, T > & setToZero ()
 Set all elements to zero. More...
 
void operator+= (const Vec< D, T > &dv)
 Add vector dv to this vector. More...
 
void operator-= (const Vec< D, T > &dv)
 Subtract vector dv from this vector. More...
 
void operator+= (T s)
 Add a common scalar to all components. More...
 
void operator-= (T s)
 Subtract a common scalar from all components. More...
 
void operator*= (T s)
 Multiply this vector by scalar s. More...
 
const T & operator[] (int i) const
 Return one Cartesian element by value. More...
 
T & operator[] (int i)
 Return one element of the vector by references. More...
 
Vec< D, T > & add (const Vec< D, T > &v1, const Vec< D, T > &v2)
 Add vectors v1 and v2. More...
 
Vec< D, T > & subtract (const Vec< D, T > &v1, const Vec< D, T > &v2)
 Subtract vector v2 from v1. More...
 
Vec< D, T > & multiply (const Vec< D, T > &v, T s)
 Multiply a vector v by a scalar s. More...
 
Vec< D, T > & negate (const Vec< D, T > &v)
 Return negative of vector v. More...
 
Vec< D, T > & negate ()
 Negate all elements of this vector. More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize to/from an archive. More...
 

Detailed Description

template<int D, typename T = int>
class Pscf::IntVec< D, T >

An IntVec<D, T> is a D-component vector of elements of integer type T.

Default of type T is T = int.

Definition at line 26 of file IntVec.h.

Constructor & Destructor Documentation

◆ IntVec() [1/4]

template<int D, typename T = int>
Pscf::IntVec< D, T >::IntVec ( )
inline

Default constructor.

Definition at line 252 of file IntVec.h.

◆ IntVec() [2/4]

template<int D, typename T = int>
Pscf::IntVec< D, T >::IntVec ( const IntVec< D, T > &  v)
inline

Copy constructor.

Parameters
vIntVec<D, T> to be copied

Definition at line 252 of file IntVec.h.

◆ IntVec() [3/4]

template<int D, typename T = int>
Pscf::IntVec< D, T >::IntVec ( T const *  v)
inline

Construct from C array.

Parameters
vC array to be copied

Definition at line 252 of file IntVec.h.

◆ IntVec() [4/4]

template<int D, typename T = int>
Pscf::IntVec< D, T >::IntVec ( s)
inlineexplicit

Constructor, initialize all elements to a scalar value.

Parameters
sscalar initial value for all elements.

Definition at line 252 of file IntVec.h.

Member Data Documentation

◆ Width

template<int D, typename T = int>
const int Pscf::IntVec< D, T >::Width = 10
static

Width of field per Cartesian coordinate in stream IO.

Definition at line 69 of file IntVec.h.


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