My Project
T2DMatrix< T > Struct Template Reference

A simple 2x2 matrix. More...

#include <mia/2d/matrix.hh>

Inheritance diagram for T2DMatrix< T >:
[legend]
Collaboration diagram for T2DMatrix< T >:
[legend]

Public Member Functions

T2DMatrixoperator-= (const T2DMatrix< T > &o)
 element wise subtract operator
T2DMatrixoperator= (const T2DMatrix< T > &o)
 assignment operator
 T2DMatrix ()
 T2DMatrix (const T2DMatrix< T > &o)
 copy constructor
 T2DMatrix (const T2DVector< T > &x, const T2DVector< T > &y)
 T2DMatrix (const T2DVector< T2DVector< T > > &o)
 construct the matrix from a 2D vector of 2D vectors
T2DMatrix< T > transposed () const
Public Member Functions inherited from T2DVector< T2DVector< T > >
void fill (T v)
 fill all the elements with the given value
norm () const
norm2 () const
bool operator!= (const T2DVector &a) const
 not equal operator
T2DVectoroperator*= (double a)
 in place multiplication with a scalar
T2DVectoroperator+= (const T2DVector &a)
 in place addition
T2DVector operator- () const
T2DVectoroperator-= (const T2DVector &a)
 in place subtraction
T2DVectoroperator/= (const T2DVector &a)
 in place element wise division of two 2D vectors
bool operator== (const T2DVector &a) const
 Equal operator.
T & operator[] (int i)
void print (std::ostream &os) const
 print the vector to a stream with special formatting
double product () const
void read (std::istream &is)
 read the properly formatted 2D vector from a stream
size_t size () const
 returns the size of this vector, always 2
 T2DVector ()

Static Public Attributes

static const T2DMatrix _0
static const T2DMatrix _1
Static Public Attributes inherited from T2DVector< T2DVector< T > >
static const T2DVector< T > _0
 a static for the value <0,0>.
static const T2DVector< T > _1
 a static for the value <1,1>.

Additional Inherited Members

Public Types inherited from T2DVector< T2DVector< T > >
typedef T value_type
 typedef for generic access to the element type
Data Fields inherited from T2DVector< T2DVector< T > >
x
 first element
y
 second element

Detailed Description

template<typename T>
struct T2DMatrix< T >

A simple 2x2 matrix.

Simple implementation of a 2D Matrix to store 2nd order derivatives.

Definition at line 36 of file 2d/matrix.hh.

Constructor & Destructor Documentation

◆ T2DMatrix() [1/4]

template<typename T>
T2DMatrix< T >::T2DMatrix ( )

Definition at line 78 of file 2d/matrix.hh.

References T2DVector< T2DVector< T > >::T2DVector().

Referenced by operator-=(), operator=(), T2DMatrix(), and transposed().

◆ T2DMatrix() [2/4]

template<typename T>
T2DMatrix< T >::T2DMatrix ( const T2DMatrix< T > & o)

◆ T2DMatrix() [3/4]

template<typename T>
T2DMatrix< T >::T2DMatrix ( const T2DVector< T2DVector< T > > & o)

construct the matrix from a 2D vector of 2D vectors

Definition at line 90 of file 2d/matrix.hh.

References T2DVector< T2DVector< T > >::T2DVector(), T2DVector< T2DVector< T > >::x, and T2DVector< T2DVector< T > >::y.

◆ T2DMatrix() [4/4]

template<typename T>
T2DMatrix< T >::T2DMatrix ( const T2DVector< T > & x,
const T2DVector< T > & y )

construct the matrix from two 2D vectors

Parameters
x1st row
y2nd row

Definition at line 96 of file 2d/matrix.hh.

References T2DVector< T2DVector< T > >::T2DVector(), T2DVector< T2DVector< T > >::x, and T2DVector< T2DVector< T > >::y.

Member Function Documentation

◆ operator-=()

template<typename T>
T2DMatrix< T > & T2DMatrix< T >::operator-= ( const T2DMatrix< T > & o)

element wise subtract operator

Definition at line 111 of file 2d/matrix.hh.

References T2DMatrix(), T2DVector< T >::x, T2DVector< T2DVector< T > >::x, T2DVector< T >::y, and T2DVector< T2DVector< T > >::y.

◆ operator=()

template<typename T>
T2DMatrix< T > & T2DMatrix< T >::operator= ( const T2DMatrix< T > & o)

◆ transposed()

template<typename T>
T2DMatrix< T > T2DMatrix< T >::transposed ( ) const
Returns
the transposed of this matrix

Definition at line 119 of file 2d/matrix.hh.

References T2DMatrix(), T2DVector< T2DVector< T > >::T2DVector(), and T2DVector< T2DVector< T > >::x.

Field Documentation

◆ _0

template<typename T>
const T2DMatrix T2DMatrix< T >::_0
static

Definition at line 65 of file 2d/matrix.hh.

◆ _1

template<typename T>
const T2DMatrix T2DMatrix< T >::_1
static

Definition at line 64 of file 2d/matrix.hh.


The documentation for this struct was generated from the following file: