PSCF v1.3
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, double >

Constructors

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

Additional Inherited Members

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

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.

References RealVec().

Referenced by RealVec().

◆ 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 ( T 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.

Referenced by Pscf::operator<<().

◆ 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.

Referenced by Pscf::operator<<().


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