45#include <initializer_list>
52template<std::
size_t M, std::
size_t N>
class FloatMatrixF;
102 constexpr static int Dim = 2;
124 nRows = std :: move(mat.nRows);
125 nColumns = std :: move(mat.nColumns);
126 values = std :: move(mat.values);
161 template<std::
size_t N, std::
size_t M>
167 void _resize_internal(
int nr,
int nc);
170 static FloatMatrix fromIniList(std :: initializer_list< std :: initializer_list< double > >);
171 static FloatMatrix fromCols(std :: initializer_list< FloatArray >mat);
172 template<std::
size_t M, std::
size_t N>
185 template<std::
size_t N, std::
size_t M>
213 bool isAllFinite()
const;
221 inline double at(std::size_t i, std::size_t j)
const
223 return (*
this)(i-1,j-1);
231 inline double &
at(std::size_t i, std::size_t j)
233 return (*
this)(i-1,j-1);
264 double computeFrobeniusNorm()
const;
270 double computeNorm(
char p)
const;
278 double computeReciprocalCondition(
char p =
'1')
const;
297 double giveTrace()
const;
302 double giveDeterminant()
const;
348 void beNMatrixOf(
const FloatArray &n,
int nsd);
354 void beLocalCoordSys(
const FloatArray &normal);
363 void setSubMatrix(
const FloatMatrix &src,
int sr,
int sc);
371 void setTSubMatrix(
const FloatMatrix &src,
int sr,
int sc);
394 void addSubVectorRow(
const FloatArray &src,
int sr,
int sc);
401 void addSubVectorCol(
const FloatArray &src,
int sr,
int sc);
409 void copySubVectorRow(
const FloatArray &src,
int sr,
int sc);
421 void copyColumn(
FloatArray &dest,
int c)
const;
458 void plusDyadSymmUpper(
const FloatArray &a,
double dV);
506 void times(
double f);
521 void rotatedWith(
const FloatMatrix &r,
char mode =
'n');
552 void printYourself()
const;
557 void printYourself(
const std::string &name)
const;
564 void printYourselfToFile(
const std::string filename,
const bool showDimensions=
true)
const;
573 void writeCSV(
const std :: string &name)
const;
588 void beMatrixFormOfStress(
const FloatArray &aArray);
596 void changeComponentOrder();
double operator()(std::size_t i, std::size_t j) const
FloatMatrix(std ::initializer_list< std ::initializer_list< double > > ini)
const double * givePointer() const
FloatMatrix(FloatMatrix &&mat) noexcept
Copy constructor.
FloatMatrix & operator=(std ::initializer_list< std ::initializer_list< double > >mat)
std::size_t nRows
Number of rows.
std ::vector< double > values
Values of matrix stored column wise.
double & at(std::size_t i, std::size_t j)
static FloatMatrix fromIniList(std ::initializer_list< std ::initializer_list< double > >)
std::size_t nColumns
Number of columns.
void resize(Index rows, Index cols)
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
FloatMatrix & operator=(FloatMatrix &&mat) noexcept
const double * data() const
void checkBounds(Index i, Index j) const
int giveNumberOfColumns() const
Returns number of columns of receiver.
FloatMatrix & operator=(const FloatMatrix &mat)
Assignment operator, adjusts size of the receiver if necessary.
FloatMatrix()
Creates zero sized matrix.
double & operator()(std::size_t i, std::size_t j)
void assignFloatMatrixF(const FloatMatrixF< N, M > &mat)
bool isNotEmpty() const
Tests for empty matrix.
FloatMatrix & operator=(const FloatMatrixF< N, M > &mat)
FloatMatrix(const FloatMatrix &mat)
Copy constructor.
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
FloatMatrix(const FloatMatrixF< N, M > &src)
bool isSquare() const
Returns nonzero if receiver is square matrix.
FloatMatrix(std::size_t n, std::size_t m)
FloatArray operator+(const FloatArray &x, const FloatArray &y)
FloatMatrixF< M, N > transpose(const FloatMatrixF< N, M > &mat)
Constructs transposed matrix.
FloatArray operator-(const FloatArray &x, const FloatArray &y)
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
FloatArray & operator+=(FloatArray &x, const FloatArray &y)
std::ostream & operator<<(std ::ostream &out, const Dictionary &r)
FloatMatrixF< N, N > diag(const FloatArrayF< N > &v)
FloatMatrixF< N, M > zero()
Constructs a zero matrix (this is the default behavior when constructing a matrix,...
FloatArray & operator-=(FloatArray &x, const FloatArray &y)
FloatArray operator*(const double &a, const FloatArray &x)
FloatArray & operator*=(FloatArray &x, const double &a)
Vector multiplication by scalar.