30 #include "../aslUtilities.h" 38 template <
typename T =
double>
class AMatr 46 inline AMatr(
unsigned int nR,
unsigned int nC);
48 inline AMatr(
unsigned int nR,
unsigned int nC,
AVec<T> v);
52 inline T&
operator()(
int i,
int j) {
return internalVec[i*nCol+j];}
54 inline const T&
operator()(
int i,
int j)
const {
return internalVec[i*nCol+j];}
58 inline const T&
operator[](
int i)
const {
return internalVec[i];}
59 inline unsigned int getNRow()
const;
60 inline unsigned int getNCol()
const;
61 inline void resize(
unsigned int nR,
unsigned int nCol);
70 template <
typename T> std::ostream&
operator<<(std::ostream &f,
const AMatr<T> & a);
73 inline const AMatr<T> &
operator+=(AMatr<T> & a,
const AMatr<T> & b);
76 inline const AMatr<T>
operator+ (
const AMatr<T> & a,
const AMatr<T> & b);
79 inline const AMatr<T>
operator- (
const AMatr<T> & a,
const AMatr<T> & b);
82 const AMatr<T>
operator* (
const AMatr<T> &a,
const AMatr<T> & b);
86 const AVec<T>
operator* (
const AMatr<T> &a,
const AVec<T> & b);
90 const AVec<T>
operator* (
const AVec<T> &a,
const AMatr<T> & b);
94 const AMatr<T>
operator* (
const AMatr<T> &a,
const T & b);
98 const AMatr<T>
operator* (
const T &a,
const AMatr<T> & b);
101 template <
typename T>
const T trace(
const AMatr<T> &a);
104 template <
typename T>
const T trace(
const AMatr<T> & a,
const AMatr<T> & b);
106 template <
typename T>
107 inline const AMatr<T>
operator/ (
const AMatr<T> & b,
const T & a);
127 template <
typename T>
128 AMatr<T> elementProduct(
const AVec<T> & a,
const AVec<T> & b);
132 template <
typename T> AMatr<T> makeAMatr(
const AVec<T> & a);
135 template <
typename T> AMatr<T> makeAMatr(
const AVec<T> & a,
const AVec<T> & b);
138 template <
typename T> AMatr<T> makeAMatr(
const AVec<T> & a,
143 template <
typename T> AMatr<T> makeAMatr(AVec<T> *a,
unsigned int n);
146 template <
typename T=
int>AMatr<T> makeAMatrUnit(
unsigned int n);
154 template <
typename T> AVec<T> getDiagonal(
const AMatr<T> & a);
162 template <
typename T> AVec<T> getOffDiagonalUp(
const AMatr<T> & a);
168 template <
typename T> T det(
const AMatr<T> & m);
174 template <
typename T> AVec<T>
solveSystem(
const AMatr<T> & a,
178 template <
typename T>
179 AMatr<T> replaceRow(
const AMatr<T> & a,
const AVec<T> & b,
unsigned int r);
182 template <
typename T>
183 AMatr<T> replaceColumn(
const AMatr<T> & a,
const AVec<T> & b,
unsigned int c);
186 template <
typename T>
187 AMatr<T> inverseMatrix(
const AMatr<T> & a);
206 internalVec(a.internalVec)
236 template <
typename T>
241 internalVec.
resize(nr*nc);
244 template <
typename T>
251 template <
typename T>
257 template <
typename T>
263 template <
typename T>
290 void getEValEVecMatSym2x2(
double a,
double b,
double c,
double & l1,
double &
l2,
double & v1x,
double & v1y,
double & v2x,
double & v2y);
312 void getEValEVecMatSym2x2(
double a,
double b,
double c,
double & l1,
double &
l2,
double & v1x,
double & v1y,
double & v2x,
double & v2y);
346 double & l1,
double &
l2,
double & l3,
347 double & v1x,
double & v1y,
double & v1z,
348 double & v2x,
double & v2y,
double & v2z,
349 double & v3x,
double & v3y,
double & v3z);
unsigned int getNRow() const
Advanced Simulation Library.
AVec< T > solveSystem(const AMatr< T > &a, const AVec< T > &b)
returns solution of a system of linear equations
void resize(unsigned int nR, unsigned int nCol)
void setColumn(unsigned int c, const AVec< T > &a)
VectorOfElements operator+=(const VectorOfElements &a, const VectorOfElements &b)
const T & operator()(int i, int j) const
doesn't chek boundaries
const AMatr< T > & operator=(const AMatr &a)
const AVec< T > & getInternalVec() const
const AMatr< T > & operator+=(AMatr< T > &a, const AMatr< T > &b)
void getEValEVecMatSym3x3(double a, double b, double c, double e, double f, double g, double &l1, double &l2, double &l3, double &v1x, double &v1y, double &v1z, double &v2x, double &v2y, double &v2z, double &v3x, double &v3y, double &v3z)
Eigenvalues and eigenvectors calcutaion for symetric matrix 2x2.
void getEValEVecMatSym2x2(double a, double b, double c, double &l1, double &l2, double &v1x, double &v1y, double &v2x, double &v2y)
Eigenvalues and eigenvectors calcutaion for symetric matrix 2x2.
T & operator[](int i)
doesn't chek boundaries
ComplexNumOfElements operator+(ComplexNumOfElements &a, ComplexNumOfElements &b)
summ of two matrices
std::ostream & operator<<(std::ostream &output, const std::vector< T > &vector)
Prints elements of the vector separated by space.
VectorOfElements l2(QuaternionOfElements &a)
L2 norm of a quaternion.
MatrixOfElements operator/(const MatrixOfElements &a, const VectorOfElements &b)
division of a matrix on a VectorOfElements with 1 element
T & operator()(int i, int j)
doesn't chek boundaries
unsigned int getNCol() const
const AMatr< T > operator/(const AMatr< T > &b, const T &a)
const T & operator[](int i) const
doesn't chek boundaries
SPPositionFunction operator*(SPPositionFunction a, SPPositionFunction b)
const AMatr< T > operator+(const AMatr< T > &a, const AMatr< T > &b)
definition of class АVec<T>
SPDistanceFunction operator-(SPDistanceFunction a)
ComplexNumOfElements operator-(ComplexNumOfElements &a, ComplexNumOfElements &b)
difference of two matrices
void setRow(unsigned int r, const AVec< T > &a)