JDFTx  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScalarFieldArray.h File Reference

classes ScalarFieldArray, ScalarFieldTildeArray and just enough operators to enable CG w.r.t to them More...

#include <core/VectorField.h>
#include <vector>
#include <cstdio>

Macros

#define TptrCollection   std::vector<std::shared_ptr<T> >
 shorthand for templates below (undef'd at end of file)
 

Typedefs

typedef std::vector< ScalarFieldScalarFieldArray
 dynamic size collection of real space scalar fields
 
typedef std::vector
< ScalarFieldTilde
ScalarFieldTildeArray
 dynamic size collection of reciprocal space scalar fields
 

Functions

template<typename T >
std::vector< typename
T::DataType * > 
dataPref (TptrCollection &x)
 Extract a std::vector of data pointers from a ScalarFieldArray.
 
template<typename T >
std::vector< const typename
T::DataType * > 
constDataPref (const TptrCollection &x)
 Extract a std::vector of const data pointers from a const ScalarFieldArray.
 
template<typename T >
TptrCollection clone (const TptrCollection &x)
 Create a copy of the data (note operator= references same data since Tptr's are pointers!)
 
template<typename T >
TptrCollectionoperator*= (TptrCollection &x, double alpha)
 Scale.
 
template<class T >
TptrCollection operator* (const TptrCollection &in, double scaleFac)
 
template<class T >
TptrCollection operator* (double scaleFac, const TptrCollection &in)
 
template<class T >
TptrCollection operator* (TptrCollection &&in, double scaleFac)
 Add (destructible input)
 
template<class T >
TptrCollection operator* (double scaleFac, TptrCollection &&in)
 Add (destructible input)
 
template<typename T >
void axpy (double alpha, const TptrCollection &x, TptrCollection &y)
 y += alpha x
 
ScalarFieldArray operator* (const ScalarFieldArray &x, const ScalarFieldArray &y)
 elementise multiply
 
ScalarFieldArray operator* (ScalarFieldArray &&x, const ScalarFieldArray &y)
 
ScalarFieldArray operator* (const ScalarFieldArray &x, ScalarFieldArray &&y)
 
ScalarFieldArrayoperator*= (ScalarFieldArray &y, const ScalarField &x)
 
ScalarFieldArray operator* (const ScalarField &x, ScalarFieldArray &&y)
 
ScalarFieldArray operator* (ScalarFieldArray &&y, const ScalarField &x)
 
ScalarFieldArray operator* (const ScalarField &x, const ScalarFieldArray &y)
 
ScalarFieldArray operator* (const ScalarFieldArray &y, const ScalarField &x)
 
template<class T >
TptrCollectionoperator+= (TptrCollection &in, const TptrCollection &other)
 Increment.
 
template<class T >
TptrCollectionoperator-= (TptrCollection &in, const TptrCollection &other)
 Decrement.
 
template<class T >
TptrCollection operator+ (const TptrCollection &in1, const TptrCollection &in2)
 
template<class T >
TptrCollection operator+ (const TptrCollection &in1, TptrCollection &&in2)
 Add (destructible input)
 
template<class T >
TptrCollection operator+ (TptrCollection &&in1, const TptrCollection &in2)
 Add (destructible input)
 
template<class T >
TptrCollection operator+ (TptrCollection &&in1, TptrCollection &&in2)
 Add (destructible inputs)
 
template<class T >
TptrCollection operator- (const TptrCollection &in1, const TptrCollection &in2)
 
template<class T >
TptrCollection operator- (const TptrCollection &in1, TptrCollection &&in2)
 Add (destructible inputs)
 
template<class T >
TptrCollection operator- (TptrCollection &&in1, const TptrCollection &in2)
 Add (destructible inputs)
 
template<class T >
TptrCollection operator- (TptrCollection &&in1, TptrCollection &&in2)
 Add (destructible inputs)
 
template<typename T >
double dot (const TptrCollection &x, const TptrCollection &y)
 Inner product.
 
template<typename T >
void initZero (TptrCollection &x)
 Initialize (non-null) data to zero.
 
template<typename T >
void nullToZero (TptrCollection &x, const GridInfo &gInfo, int N=0)
 
template<typename T >
void initRandomFlat (TptrCollection &x)
 Initialize to random numbers (uniform on 0 to 1)
 
template<typename T >
void randomize (TptrCollection &x)
 Initialize to normal random numbers:
 
template<typename T >
void loadFromFile (TptrCollection &x, const char *filename)
 
template<typename T >
void saveToFile (const TptrCollection &x, const char *filename)
 
ScalarFieldArray I (ScalarFieldTildeArray &&X)
 
ScalarFieldArray I (const ScalarFieldTildeArray &X)
 
ScalarFieldTildeArray J (const ScalarFieldArray &X)
 
ScalarFieldTildeArray Idag (const ScalarFieldArray &X)
 
ScalarFieldArray Jdag (ScalarFieldTildeArray &&X)
 
ScalarFieldArray Jdag (const ScalarFieldTildeArray &X)
 

Detailed Description

classes ScalarFieldArray, ScalarFieldTildeArray and just enough operators to enable CG w.r.t to them

Function Documentation

template<typename T >
void nullToZero ( TptrCollection x,
const GridInfo gInfo,
int  N = 0 
)

Allocate all null components and initialize them to zero If N is non-zero, resize collection to N scalar fields

template<class T >
TptrCollection operator+ ( const TptrCollection in1,
const TptrCollection in2 
)

< Add (destructible inputs)

template<class T >
TptrCollection operator- ( const TptrCollection in1,
const TptrCollection in2 
)

< Add (destructible inputs)