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

A RealVec<D, T> is D-component vector with elements of floating type T. More...

#include <RealVec.h>

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

Constructors

static const int Width = 25
 Width of field per Cartesian coordinate in stream IO. More...
 
static const int Precision = 17
 Precision in stream IO of RealVec<D, T> coordinates. More...
 
 RealVec ()
 Default constructor. More...
 
 RealVec (const RealVec< D, T > &v)
 Copy constructor. More...
 
 RealVec (T const *v)
 Construct from C array. More...
 
 RealVec (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 = double>
class Pscf::RealVec< D, T >

A RealVec<D, T> is D-component vector with elements of floating type T.

Default of type T is T = double.

Definition at line 27 of file RealVec.h.

Constructor & Destructor Documentation

◆ RealVec() [1/4]

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

Default constructor.

Definition at line 136 of file RealVec.h.

◆ RealVec() [2/4]

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

Copy constructor.

Parameters
vRealVec<D, T> to be copied

Definition at line 136 of file RealVec.h.

◆ RealVec() [3/4]

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

Construct from C array.

Parameters
vC array to be copied

Definition at line 136 of file RealVec.h.

◆ RealVec() [4/4]

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

Constructor, initialize all elements to a scalar value.

Parameters
sscalar initial value for all elements.

Definition at line 136 of file RealVec.h.

Member Data Documentation

◆ Width

template<int D, typename T = double>
const int Pscf::RealVec< D, T >::Width = 25
static

Width of field per Cartesian coordinate in stream IO.

Definition at line 70 of file RealVec.h.

◆ Precision

template<int D, typename T = double>
const int Pscf::RealVec< D, T >::Precision = 17
static

Precision in stream IO of RealVec<D, T> coordinates.

Definition at line 73 of file RealVec.h.


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