8 #error This class is not to be included by the user directly. Use MatrixNd.h or MatrixNf.h instead.
24 MATRIXN(
unsigned rows,
unsigned columns);
25 MATRIXN(
unsigned rows,
unsigned columns,
const REAL* array);
39 REAL norm_inf()
const;
48 unsigned rows()
const {
return _rows; }
49 unsigned columns()
const {
return _columns; }
50 virtual MATRIXN&
resize(
unsigned rows,
unsigned columns,
bool preserve =
false);
54 static MATRIXN zero(
unsigned rows,
unsigned columns);
71 REAL* data() {
return _data.get(); }
72 const REAL* data()
const {
return _data.get(); }
73 void free_memory() {
resize(0,0); compress(); }
74 void compress() { _data.compress(); }
75 unsigned leading_dim()
const {
return _rows; }
76 unsigned inc()
const {
return 1; }
79 unsigned size()
const {
return _rows * _columns; }
81 const REAL&
operator()(
unsigned i,
unsigned j)
const;
82 REAL&
operator()(
const unsigned i,
const unsigned j);
84 #define MATRIXX MATRIXN
85 #include "MatrixCommon.inl"
87 #define XMATRIXN MATRIXN
88 #include "XMatrixN.inl"
93 static FastThreadable<MATRIXN> _n;
94 static FastThreadable<VECTORN> _workv;
97 SharedResizable<REAL> _data;
102 std::ostream& operator<<(std::ostream& out,
const MATRIXN& m);
103 std::istream& operator>>(std::istream& in,
MATRIXN& m);
MATRIXN & negate()
Negates this matrix in place.
Definition: MatrixN.cpp:359
MATRIXN & operator-=(const MATRIXN &m)
Subtracts m from this.
Definition: MatrixN.cpp:473
virtual MATRIXN & resize(unsigned rows, unsigned columns, bool preserve=false)
Resizes this matrix, optionally preserving its existing elements.
Definition: MatrixN.cpp:274
A general 2x2 matrix.
Definition: Matrix2.h:16
MATRIXN & set(const VECTORN &v, Transposition trans=eNoTranspose)
Sets this matrix from a vector.
Definition: MatrixN.cpp:123
MATRIXN & zero_upper_triangle()
Zeros the upper triangle of the matrix.
Definition: MatrixN.cpp:390
U & mult(const T &x, U &y, REAL alpha=(REAL) 1.0, REAL beta=(REAL) 0.0) const
Does the operation y = beta*y + alpha*this*x.
Definition: SharedMatrixN.h:222
static MATRIXN construct_variable(unsigned rows, unsigned cols,...)
Constructs a MATRIXN using a variable number of double values.
Definition: MatrixN.cpp:193
MATRIXN()
Default constructor - constructs an empty matrix.
Definition: MatrixN.cpp:7
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
A generic N-dimensional floating point vector.
Definition: SharedVectorN.h:77
A generic, possibly non-square matrix using shared data.
Definition: SharedMatrixN.h:59
MATRIXN & operator*=(REAL scalar)
Multiplies this matrix by another in place.
Definition: MatrixN.cpp:341
A generic N-dimensional floating point vector.
Definition: SharedVectorN.h:15
MATRIXN & set_identity()
Sets this matrix to the identity matrix.
Definition: MatrixN.cpp:455
MATRIXN & operator/=(REAL scalar)
Divides this matrix by a scalar in place.
Definition: MatrixN.cpp:350
MATRIXN & set_zero()
Sets the matrix to the zero matrix.
Definition: MatrixN.cpp:297
A generic N-dimensional floating point vector.
Definition: VectorN.h:16
MATRIXN & remove_row(unsigned i)
Removes a row from the matrix.
Definition: MatrixN.cpp:209
MATRIXN & remove_column(unsigned i)
Removes a column from the matrix.
Definition: MatrixN.cpp:230
unsigned size() const
Gets the total number of elements in this matrix.
Definition: MatrixN.h:79
bool is_symmetric(REAL tolerance=-1.0) const
Checks whether the given matrix is symmetric to the specified tolerance.
Definition: MatrixN.cpp:368
const REAL & operator()(unsigned i, unsigned j) const
Gets the desired entry.
Definition: MatrixN.cpp:435
A generic, possibly non-square matrix using constant shared data.
Definition: SharedMatrixN.h:19
MATRIXN & zero_lower_triangle()
Zeros the lower triangle of the matrix.
Definition: MatrixN.cpp:405
MATRIXN & operator+=(const MATRIXN &m)
Adds m to this.
Definition: MatrixN.cpp:487
static MATRIXN identity(unsigned dim)
Returns an identity matrix.
Definition: MatrixN.cpp:420
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20
virtual MATRIXN & operator=(const MATRIXN &source)
Sets this to m.
Definition: MatrixN.cpp:501
virtual MATRIXN & transpose()
Sets this matrix to its transpose.
Definition: MatrixN.cpp:304