A 3x3 matrix. More...
#include <SquareMatrix.h>
Public Types | |
typedef base_type::value_type | value_type |
The element type of the tensor. | |
typedef base_type::pointer | pointer |
A pointer to a tensor element. | |
typedef base_type::const_pointer | const_pointer |
A const pointer to a tensor element. | |
typedef base_type::iterator | iterator |
An iterator in the tensor. | |
typedef base_type::const_iterator | const_iterator |
A const iterator in the tensor. | |
typedef base_type::reference | reference |
A reference to a tensor element. | |
typedef base_type::const_reference | const_reference |
A const reference to a tensor element. | |
typedef base_type::size_type | size_type |
The size type. | |
typedef base_type::difference_type | difference_type |
Pointer difference type. | |
typedef base_type::index_type | index_type |
An index into the tensor. | |
Public Member Functions | |
SquareMatrix () | |
Default constructor. Leave the data uninitialized. | |
~SquareMatrix () | |
Trivial destructor. | |
SquareMatrix (const SquareMatrix &x) | |
Copy constructor. | |
template<typename T2 > | |
SquareMatrix (const SquareMatrix< 3, T2 > &x) | |
Construct from a matrix with different number type. | |
SquareMatrix (const value_type e00, const value_type e01, const value_type e02, const value_type e10, const value_type e11, const value_type e12, const value_type e20, const value_type e21, const value_type e22) | |
Construct from the matrix elements. | |
SquareMatrix (const_pointer x) | |
Construct from an array. | |
SquareMatrix (const value_type x) | |
Initialize all the elements with the given value. | |
SquareMatrix & | operator= (const SquareMatrix &x) |
Assignment operator. | |
SquareMatrix & | operator= (const value_type x) |
Assignment operator. Assign all elements the given value. | |
template<typename T2 > | |
SquareMatrix & | operator= (const SquareMatrix< 3, T2 > &x) |
Assignment operator for a SquareMatrix with different number type. | |
iterator | begin () |
Return an iterator to the beginning of the data. | |
iterator | end () |
Return an iterator to the end of the data. | |
const_iterator | begin () const |
Return a const_iterator to the beginning of the data. | |
const_iterator | end () const |
Return a const_iterator to the end of the data. | |
pointer | data () |
Return a pointer to the data. | |
const_pointer | data () const |
Return a const_pointer to the data. | |
size_type | size () const |
Return the size of the tensor. | |
value_type | operator() (const index_type i) const |
Subscripting. Return the i_th element. | |
reference | operator() (const index_type i) |
Subscripting. Return a reference to the i_th element. | |
value_type | operator[] (const index_type i) const |
Subscripting. Return the i_th element. | |
value_type & | operator[] (const index_type i) |
Subscripting. Return a reference to the i_th element. | |
value_type | operator() (const index_type i, const index_type j) const |
Indexing. Return element in the i_th row and j_th column. | |
reference | operator() (const index_type i, const index_type j) |
Indexing. Return a reference to the element in the i_th row and j_th column. | |
void | get (pointer x) const |
Get the elements in row-major order. | |
void | set (const_pointer x) |
Set the elements in row-major order. | |
void | get (reference e00, reference e01, reference e02, reference e10, reference e11, reference e12, reference e20, reference e21, reference e22) const |
Get the elements in row-major order. | |
void | set (const value_type e00, const value_type e01, const value_type e02, const value_type e10, const value_type e11, const value_type e12, const value_type e20, const value_type e21, const value_type e22) |
Set the elements in row-major order. | |
void | negate () |
Negate each element. | |
void | transpose () |
Transpose the matrix. | |
SquareMatrix & | operator+= (const value_type x) |
Add x to each element. | |
SquareMatrix & | operator-= (const value_type x) |
Subtract x from each element. | |
SquareMatrix & | operator*= (const value_type x) |
Multiply each element by x . | |
SquareMatrix & | operator/= (const value_type x) |
Divide each element by x . | |
SquareMatrix & | operator%= (const value_type x) |
Mod each element by x . | |
template<typename T2 > | |
SquareMatrix & | operator+= (const SquareMatrix< 3, T2 > &x) |
Element-wise addition. | |
template<typename T2 > | |
SquareMatrix & | operator-= (const SquareMatrix< 3, T2 > &x) |
Element-wise subtraction. | |
template<typename T2 > | |
SquareMatrix & | operator*= (const SquareMatrix< 3, T2 > &x) |
Matrix product. | |
SquareMatrix | operator+ () |
Unary positive operator. | |
SquareMatrix | operator- () |
Unary negate operator. | |
Protected Attributes | |
value_type | _elem [9] |
The elements of the matrix. |
A 3x3 matrix.
T | is the number type. By default it is double. |