12 #include <util/space/Dimension.h>    16 #include <util/mpi/MpiTraits.h>    55       explicit Tensor(
double scalar);
   279       double trace() 
const; 
   287       template <
class Archive>
   288       void serialize(Archive& ar, 
const unsigned int version);
   321       static const int Width = 13;
   324       static const int Precision = 5;
   409          elem_[i] = t.elem_[i];
   432             elem_[i*Dimension + j] = a[i][j];
   459          elem_[i*Dimension + i] = 1.0;
   471          elem_[i] = t.elem_[i];
   485             elem_[i*Dimension + j] = a[i][j];
   498          elem_[i] += dt.elem_[i];
   509          elem_[i] -= dt.elem_[i]; 
   570          elem_[i] = t1.elem_[i] + t2.elem_[i];
   584          elem_[i] = t1.elem_[i] - t2.elem_[i];
   598          elem_[i] = t.elem_[i]*s;
   612          elem_[i] = t.elem_[i]/s;
   625          trace += (*this)(i, i);
   640          (*this)(i, i) = t(i, i);
   643          for (j = 0; j < i; ++j) {
   644             (*this)(i, j) = t(j, i);  
   645             (*this)(j, i) = t(i, j);
   662          for (j = 0; j < i; ++j) {
   663             save = (*this)(i, j);
   664             (*this)(i, j) = (*
this)(j, i);  
   665             (*this)(j, i) = save;
   683          (*this)(i, i) = t(i, i);
   686          for (j = 0; j < i; ++j) {
   687             ave = 0.5*( t(i, j) + t(j, i) );
   706          for (j = 0; j < i; ++j) {
   707             ave = 0.5*( (*this)(i, j) + (*
this)(j, i) );
   718    template <
class Archive>
   729 #include <util/space/Vector.h>   740          elem_[i*Dimension+j] = r[j];
   752          elem_[i*Dimension+j] = r[i];
   768             elem_[i*Dimension + j] = v1[i]*v2[j];
 Tensor & setColumn(int i, const Vector &r)
Set column i of this Tensor to elements of Vector r. 
 
const int Dimension
Dimensionality of space. 
 
static void initStatic()
Call to guarantee initialization of Zero and Identity tensors. 
 
A Vector is a Cartesian vector. 
 
static MPI::Datatype type
MPI Datatype. 
 
void operator-=(const Tensor &dt)
Subtract tensor dt from this tensor. 
 
Tensor & zero()
Set all elements of this tensor to zero. 
 
Tensor()
Default constructor. 
 
File containing preprocessor macros for error handling. 
 
Tensor & identity()
Set this to the identity (unity) tensor. 
 
void operator*=(double s)
Multiply this tensor by scalar s. 
 
friend std::istream & operator>>(std::istream &in, Tensor &tensor)
istream extractor for a Tensor. 
 
double trace() const 
Return the trace of this tensor. 
 
A Tensor represents a Cartesian tensor. 
 
Tensor & add(const Tensor &t1, const Tensor &t2)
Add tensors t1 and t2. 
 
void operator/=(double s)
Divide this tensor by scalar s. 
 
Tensor & setRow(int i, const Vector &r)
Set row i of this Tensor to elements of Vector r. 
 
Tensor & transpose()
Transpose this tensor. 
 
static void commitMpiType()
Commit MPI datatype MpiTraits<Tensor>::type. 
 
void serialize(Archive &ar, const unsigned int version)
Serialize this to/from an archive. 
 
void operator+=(const Tensor &dt)
Add tensor dt to this tensor. 
 
Tensor & multiply(const Tensor &t, double s)
Multiply a tensor t by a scalar s. 
 
Utility classes for scientific computation. 
 
Tensor & divide(const Tensor &t, double s)
Divide a Tensor t by a scalar s. 
 
const double & operator()(int i, int j) const 
Return one element by value. 
 
Tensor & symmetrize()
Symmetrize this tensor. 
 
Tensor & subtract(const Tensor &t1, const Tensor &t2)
Subtract tensor t2 from t1. 
 
static bool hasType
Is the MPI type initialized? 
 
const int DimensionSq
Square of Dimensionality of space. 
 
friend bool operator==(const Tensor &t1, const Tensor &t2)
Equality for Tensors. 
 
Tensor & operator=(const Tensor &t)
Copy assignment. 
 
static const Tensor Identity
Constant idenity Tensor (diagonal diagonal elements all 1). 
 
Tensor & dyad(const Vector &v1, const Vector &v2)
Create dyad of two vectors. 
 
static const Tensor Zero
Constant Tensor with all zero elements. 
 
friend std::ostream & operator<<(std::ostream &out, const Tensor &tensor)
ostream inserter for a Tensor. 
 
bool operator!=(const PointSymmetry &A, const PointSymmetry &B)
Are two PointSymmetry objects not equivalent?