softsusy is hosted by Hepforge, IPPP Durham
SOFTSUSY  4.1
tensor.h
Go to the documentation of this file.
1 
13 #ifndef TENSOR_H
14 #define TENSOR_H
15 
16 #include <iostream>
17 #include <cmath>
18 #include <fstream>
19 #include "linalg.h"
20 using namespace std;
21 using namespace softsusy;
22 
23 class Tensor;
24 ostream & operator <<(ostream &left, const Tensor &);
25 
27 class Tensor {
32 private:
33  DoubleMatrix A1, A2, A3;
34 
36  void setTensor(const DoubleMatrix &, const DoubleMatrix &, const
37  DoubleMatrix &);
38 
39 public:
40  Tensor();
42  Tensor(const Tensor &);
43 
45  void threecheck(const DoubleMatrix &, const DoubleMatrix &,
46  const DoubleMatrix &);
47 
49  double & operator () (int, int, int);
51  DoubleMatrix & operator () (int);
53  const DoubleMatrix & display(int) const;
55  double display(int, int, int) const;
58  void checkOut(double) const;
60  void set(int i, int j, int k, double f);
61 
63  DoubleVector trace(int) const;
65  Tensor transpose() const;
71  DoubleMatrix dotProd(const DoubleVector & v, int i) const;
73  Tensor operator*(double) const;
75  Tensor operator/(double) const;
77  Tensor operator*(const DoubleMatrix &) const;
79  Tensor operator+(const Tensor &) const;
81  Tensor operator-(const Tensor &) const;
83  Tensor product(const DoubleMatrix &) const;
85  Tensor swap(int);
87  Tensor raise(const DoubleMatrix & M) const;
88 };
90 Tensor operator*(double, const Tensor &);
92 Tensor operator*(const DoubleMatrix &, const Tensor &);
95 Tensor outerProduct(const DoubleVector &, const DoubleMatrix &, int);
97 DoubleMatrix matrixify(const Tensor &, const Tensor &);
98 // \f$ M_{ij} = A^{lik} B^{lkj} \f$
99 DoubleMatrix sumProd(const Tensor & A, const Tensor & B);
100 
101 #endif
Matrix from 1..rows, 1..cols of double values.
Definition: linalg.h:214
DoubleVector is of variable length, and contains double precision.
Definition: linalg.h:35
Three-index tensor for containing information on RPV couplings.
Definition: tensor.h:27
DoubleVector and DoubleMatrix classes of doubles and operations between them, complexified copies als...
global variable declaration
Definition: def.cpp:13
Tensor operator*(double, const Tensor &)
Multiplies all matrices in tensor by a double.
Definition: tensor.cpp:311
Tensor outerProduct(const DoubleVector &, const DoubleMatrix &, int)
Definition: tensor.cpp:273
DoubleMatrix matrixify(const Tensor &, const Tensor &)
Definition: tensor.cpp:294
MatXpr< T, MatXprBinOp< T, MatConstRef< T, MatIndexable< T, A > >, MatConstRef< T, MatIndexable< T, B > >, OpSubtract< T > > > operator-(const MatIndexable< T, A > &a, const MatIndexable< T, B > &b)
xpr matrix subtraction
Definition: xpr-matrix.h:169
MatXpr< T, MatXprBinOp< T, MatConstRef< T, MatIndexable< T, A > >, MatConstRef< T, MatIndexable< T, B > >, OpAdd< T > > > operator+(const MatIndexable< T, A > &a, const MatIndexable< T, B > &b)
add two xpr matrices
Definition: xpr-matrix.h:25
MatXpr< T, MatXprScalOp< T, MatConstRef< T, MatIndexable< T, B > >, OpMultiply< T > > > operator/(const MatIndexable< T, B > &b, T a)
divide xpr matrix by scalar
Definition: xpr-matrix.h:602