Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

RayGina::CORE::RMatrix< T, m, n > Class Template Reference

Generic matrix class with variable size and type. More...

#include <RMatrix.hxx>

List of all members.

Public Member Functions

 RMatrix (void)
 RMatrix (T value)
 RMatrix (const T *data)
template<typename R>
 RMatrix (const RMatrix< R, m, n > &other)
void transpose (void)
void zero (void)
void assign (T value)
const std::size_t rows (void) const
const std::size_t cols (void) const
T & operator() (std::size_t row, std::size_t col)
const T & operator() (std::size_t row, std::size_t col) const
get (std::size_t row, std::size_t col) const
void set (std::size_t row, std::size_t col, T value)
void writeRowWise (T *destination) const
void writeColumnWise (T *destination) const
void readRowWise (const T *source)
void readColumnWise (const T *source)
bool equal (const RMatrix< T, m, n > &matrix, T delta) const

Protected Attributes

m_data [m][n]


Detailed Description

template<typename T, std::size_t m, std::size_t n>
class RayGina::CORE::RMatrix< T, m, n >

Generic matrix class with variable size and type.

Uses T as type for its elements and has m rows and n columns. This class is more or less a simple data-container. For typical computer graphics issues, use RMatrix4x4 !

Author:
Stephan Weigelt (pushmatrix)
Date:
2005-11-20
Warning:
TODO: operators and/or functions for assigning RbVec, operators for arithmetic operations, testing

Definition at line 25 of file RMatrix.hxx.


Constructor & Destructor Documentation

template<typename T, std::size_t m, std::size_t n>
RayGina::CORE::RMatrix< T, m, n >::RMatrix void   )  [inline]
 

Default constructor. Assign the default value T() to all elements (== 0 for basic types).

Definition at line 7 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
RayGina::CORE::RMatrix< T, m, n >::RMatrix value  )  [inline, explicit]
 

Initalizes all elements with the given value.

Parameters:
value the value to assign. Note: Explicit usage only to prevent assigning a value with '='-Operator.

Definition at line 15 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
RayGina::CORE::RMatrix< T, m, n >::RMatrix const T *  data  )  [inline, explicit]
 

Copies the data from data (m*n values). Assumes row-wise ordering.

Definition at line 23 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
template<typename R>
RayGina::CORE::RMatrix< T, m, n >::RMatrix const RMatrix< R, m, n > &  other  )  [inline]
 

Template-Constructor. Does not hide the (default-)copy-constructor !

Definition at line 32 of file RMatrix.inl.


Member Function Documentation

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::assign value  )  [inline]
 

Assign this value to all elements.

See also:
zero()

Definition at line 65 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
const std::size_t RayGina::CORE::RMatrix< T, m, n >::cols void   )  const [inline]
 

Returns:
the number of columns.
See also:
rows()

Definition at line 89 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
bool RayGina::CORE::RMatrix< T, m, n >::equal const RMatrix< T, m, n > &  matrix,
delta
const [inline]
 

Elementwise comparsion with respect to delta.

Definition at line 194 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
T RayGina::CORE::RMatrix< T, m, n >::get std::size_t  row,
std::size_t  col
const [inline]
 

Get a value.

Definition at line 98 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
const T & RayGina::CORE::RMatrix< T, m, n >::operator() std::size_t  row,
std::size_t  col
const [inline]
 

Reference to a value (const, so only reading is possible).

Returns:
the value as a const reference.

Reimplemented in RayGina::CORE::RMatrix4x4< T >.

Definition at line 134 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
T & RayGina::CORE::RMatrix< T, m, n >::operator() std::size_t  row,
std::size_t  col
[inline]
 

Reference to a value (not const, so reading and writing is possible).

Returns:
the value as a reference.

Reimplemented in RayGina::CORE::RMatrix4x4< T >.

Definition at line 122 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::readColumnWise const T *  source  )  [inline]
 

Reads column by column. Assumes source to be the first element of a T[m*n] array.

See also:
writeColumnWise(), readRowWise()

Definition at line 182 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::readRowWise const T *  source  )  [inline]
 

Reads row by row. Assumes source to be the first element of a T[m*n] array.

See also:
writeRowWise(), readColumnWise(), RMatrix()

Definition at line 170 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
const std::size_t RayGina::CORE::RMatrix< T, m, n >::rows void   )  const [inline]
 

Returns:
the number of rows.
See also:
cols()

Definition at line 80 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::set std::size_t  row,
std::size_t  col,
value
[inline]
 

Set a value

Definition at line 110 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::transpose void   )  [inline]
 

Transposes the matrix.

Definition at line 43 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::writeColumnWise T *  destination  )  const [inline]
 

Writes column by column to destination. Assumes destination to be the first element of a T[m*n] array.

See also:
writeRowWise(), readColumnWise()

Definition at line 158 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::writeRowWise T *  destination  )  const [inline]
 

Writes row by row to destination. Assumes destination to be the first element of a T[m*n] array.

See also:
writeColumnWise(), readRowWise()

Definition at line 146 of file RMatrix.inl.

template<typename T, std::size_t m, std::size_t n>
void RayGina::CORE::RMatrix< T, m, n >::zero void   )  [inline]
 

Sets all elements to zero.

See also:
assign()

Reimplemented in RayGina::CORE::RMatrix4x4< T >.

Definition at line 56 of file RMatrix.inl.


Member Data Documentation

template<typename T, std::size_t m, std::size_t n>
T RayGina::CORE::RMatrix< T, m, n >::m_data[m][n] [protected]
 

Definition at line 119 of file RMatrix.hxx.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 17:01:09 2007 for rayGina by  doxygen 1.3.9.1