50 #include <initializer_list> 110 FloatMatrix(
int n,
int m) : nRows(n), nColumns(m), values(n * m) {}
127 FloatMatrix(std :: initializer_list< std :: initializer_list< double > >mat);
129 FloatMatrix &operator=(std :: initializer_list< std :: initializer_list< double > >mat);
131 FloatMatrix &operator=(std :: initializer_list< FloatArray >mat);
140 nRows = std :: move(mat.nRows);
141 nColumns = std :: move(mat.nColumns);
142 values = std :: move(mat.values);
154 void checkBounds(
int i,
int j)
const;
160 inline bool isSquare()
const {
return nRows == nColumns; }
162 inline bool isNotEmpty()
const {
return nRows > 0 && nColumns > 0; }
165 bool isFinite()
const;
174 double at(
int i,
int j)
const;
176 inline double at(
int i,
int j)
const {
return values [ ( j - 1 ) * nRows + i - 1 ]; }
185 double &at(
int i,
int j);
187 inline double &
at(
int i,
int j) {
return values [ ( j - 1 ) * nRows + i - 1 ]; }
197 double &operator()(
int i,
int j);
199 inline double &
operator()(
int i,
int j) {
return values [ j * nRows + i ]; }
207 double operator()(
int i,
int j)
const;
209 inline double operator()(
int i,
int j)
const {
return values [ j * nRows + i ]; }
233 void assemble(
const FloatMatrix &src,
const int *rowind,
const int *colind);
240 double computeFrobeniusNorm()
const;
246 double computeNorm(
char p)
const;
254 double computeReciprocalCondition(
char p =
'1')
const;
273 double giveTrace()
const;
278 double giveDeterminant()
const;
324 void beNMatrixOf(
const FloatArray &n,
int nsd);
330 void beLocalCoordSys(
const FloatArray &normal);
339 void setSubMatrix(
const FloatMatrix &src,
int sr,
int sc);
347 void setTSubMatrix(
const FloatMatrix &src,
int sr,
int sc);
356 void beSubMatrixOf(
const FloatMatrix &src,
int topRow,
int bottomRow,
int topCol,
int bottomCol);
370 void addSubVectorRow(
const FloatArray &src,
int sr,
int sc);
377 void addSubVectorCol(
const FloatArray &src,
int sr,
int sc);
385 void copySubVectorRow(
const FloatArray &src,
int sr,
int sc);
397 void copyColumn(
FloatArray &dest,
int c)
const;
433 void plusDyadSymmUpper(
const FloatArray &a,
double dV);
471 void times(
double f);
482 void initFromVector(
const FloatArray &vector,
bool transposed);
493 void rotatedWith(
const FloatMatrix &r,
char mode =
'n');
501 void resize(
int rows,
int cols);
507 void resizeWithData(
int,
int);
514 void hardResize(
int r,
int c);
531 void printYourself()
const;
536 void printYourself(
const std::string &name)
const;
543 void printYourselfToFile(
const std::string filename,
const bool showDimensions=
true)
const;
552 void writeCSV(
const std :: string &name)
const;
558 inline const double *
givePointer()
const {
return values.data(); }
567 void beMatrixFormOfStress(
const FloatArray &aArray);
575 void changeComponentOrder();
586 void __setitem__(boost :: python :: api :: object t,
double val);
587 double __getitem__(boost :: python :: api :: object t);
588 void beCopyOf(
const FloatMatrix &src) { this->operator=(src); }
int giveNumberOfColumns() const
Returns number of columns of receiver.
double & at(int i, int j)
Coefficient access function.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
double operator()(int i, int j) const
Coefficient access function.
bool isSquare() const
Returns nonzero if receiver is square matrix.
const double * givePointer() const
Exposes the internal values of the matrix.
Class implementing an array of integers.
int nColumns
Number of columns.
~FloatMatrix()
Destructor.
bool isNotEmpty() const
Tests for empty matrix.
std::ostream & operator<<(std::ostream &out, const Dictionary &r)
FloatMatrix & operator=(const FloatMatrix &mat)
Assignment operator, adjusts size of the receiver if necessary.
FloatMatrix & operator=(FloatMatrix &&mat)
double at(int i, int j) const
Coefficient access function.
Class representing vector of real numbers.
FloatMatrix()
Creates zero sized matrix.
Implementation of matrix containing floating point numbers.
double & operator()(int i, int j)
Coefficient access function.
std::vector< double > values
Values of matrix stored column wise.
FloatMatrix(const FloatMatrix &mat)
Copy constructor.
FloatMatrix(int n, int m)
Creates matrix of given size.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
int giveNumberOfRows() const
Returns number of rows of receiver.
FloatMatrix(FloatMatrix &&mat)
Copy constructor.