Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SH::ShMatrix< Rows, Cols, Binding, T > Class Template Reference

A matrix of Rows by Cols elements. More...

#include <ShMatrix.hpp>

Inheritance diagram for SH::ShMatrix< Rows, Cols, Binding, T >:

Inheritance graph
[legend]
Collaboration diagram for SH::ShMatrix< Rows, Cols, Binding, T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef T storage_type
typedef ShHostType< T >::type host_type
typedef ShMemType< T >::type mem_type
typedef ShMatrix< Rows, Cols,
SH_INPUT, T > 
InputType
typedef ShMatrix< Rows, Cols,
SH_OUTPUT, T > 
OutputType
typedef ShMatrix< Rows, Cols,
SH_INOUT, T > 
InOutType
typedef ShMatrix< Rows, Cols,
SH_TEMP, T > 
TempType
typedef ShMatrix< Rows, Cols,
SH_CONST, T > 
ConstType

Public Member Functions

 ShMatrix ()
 Identity constructor.
template<ShBindingType Binding2>
 ShMatrix (const ShMatrix< Rows, Cols, Binding2, T > &other)
 Copy constructor.
 ~ShMatrix ()
ShMatrixoperator= (const ShMatrix< Rows, Cols, Binding, T > &other)
 Assignment.
template<ShBindingType Binding2>
ShMatrixoperator= (const ShMatrix< Rows, Cols, Binding2, T > &other)
 Assignment.
ShMatrixoperator= (const T &scalar)
 Assignment (scalar promotion).
ShMatrixoperator= (const ShGeneric< 1, T > &scalar)
 Assignment (scalar promotion).
ShAttrib< Cols, Binding, T > & operator[] (int i)
 Attribute row access.
const ShAttrib< Cols, Binding,
T > & 
operator[] (int i) const
 Attribute row access.
template<ShBindingType Binding2>
ShMatrixoperator+= (const ShMatrix< Rows, Cols, Binding2, T > &other)
 Modifying componentwise addition.
template<ShBindingType Binding2>
ShMatrixoperator-= (const ShMatrix< Rows, Cols, Binding2, T > &other)
 Modifying componentwise subtraction.
template<ShBindingType Binding2>
ShMatrixoperator/= (const ShMatrix< Rows, Cols, Binding2, T > &other)
 Modifying componentwise division.
template<ShBindingType Binding2>
ShMatrixoperator *= (const ShMatrix< Rows, Cols, Binding2, T > &other)
 Modifying matrix multiplication.
ShMatrixoperator- ()
 Negation.
ShMatrix< Rows-1, Cols-1,
SH_TEMP, T > 
subMatrix (int, int) const
 Obtain a submatrix of this matrix.
void setTranslation (const ShGeneric< Rows-1, T > &trans)
void setScaling (const ShGeneric< Rows-1, T > &scale)
ShMatrixoperator *= (const ShGeneric< 1, T > &a)
 Modifying scalar multiplicatoin.
ShMatrixoperator/= (const ShGeneric< 1, T > &a)
 Modifying scalar division.
virtual std::string name () const
virtual void name (const std::string &n)
virtual bool has_name () const
virtual bool internal () const
virtual void internal (bool)
virtual std::string title () const
virtual void title (const std::string &t)
virtual std::string description () const
virtual void description (const std::string &d)
virtual std::string meta (const std::string &key) const
virtual void meta (const std::string &key, const std::string &value)
int size () const
virtual void getValues (host_type dest[]) const
Swizzling
Retrieve some set of rows from this matrix. These must be swizzled again to operate on them.

ShMatrixRows< Rows, Cols, T > operator() () const
 Identity swizzle.
ShMatrixRows< 1, Cols, T > operator() (int) const
ShMatrixRows< 2, Cols, T > operator() (int, int) const
ShMatrixRows< 3, Cols, T > operator() (int, int, int) const
ShMatrixRows< 4, Cols, T > operator() (int, int, int, int) const
Metadata
This data is useful for various things, including asset management.

void range (host_type low, host_type high)
 Set a range of values for this matrix.

Static Public Attributes

static const ShValueType value_type
static const ShBindingType binding_type
static const int rows
static const int cols
static const int typesize

Detailed Description

template<int Rows, int Cols, ShBindingType Binding, typename T>
class SH::ShMatrix< Rows, Cols, Binding, T >

A matrix of Rows by Cols elements.

A matrix is a representation of a linear operator. In Sh, this class represents SMALL matrices that will fit in registers. For large amounts of data, use an ShArray.

See also:
ShArray

Definition at line 43 of file ShMatrix.hpp.


Constructor & Destructor Documentation

template<int Rows, int Cols, ShBindingType Binding, typename T>
SH::ShMatrix< Rows, Cols, Binding, T >::ShMatrix  ) 
 

Identity constructor.

Constructs an identity matrix. For non-square matrices, the largest square upper-left submatrix possible is made an identity matrix, with the rest left zero.

Definition at line 35 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
template<ShBindingType Binding2>
SH::ShMatrix< Rows, Cols, Binding, T >::ShMatrix const ShMatrix< Rows, Cols, Binding2, T > &  other  ) 
 

Copy constructor.

Construct a matrix with the same contents as the given matrix.

Definition at line 45 of file ShMatrixImpl.hpp.


Member Function Documentation

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator *= const ShGeneric< 1, T > &  a  ) 
 

Modifying scalar multiplicatoin.

Multiply the given scalar attribute with each component of this matrix.

Definition at line 163 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
template<ShBindingType Binding2>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator *= const ShMatrix< Rows, Cols, Binding2, T > &  other  ) 
 

Modifying matrix multiplication.

Replace the matrix by the result of the matrix multiplied by the other. Note: the two matrices must have the same size.

Definition at line 145 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
template<ShBindingType Binding2>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator+= const ShMatrix< Rows, Cols, Binding2, T > &  other  ) 
 

Modifying componentwise addition.

Add each entry in the given matrix to each entry in this matrix matching its row and column index.

Definition at line 115 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator-  ) 
 

Negation.

Assign each entry to its negated value.

Definition at line 154 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
template<ShBindingType Binding2>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator-= const ShMatrix< Rows, Cols, Binding2, T > &  other  ) 
 

Modifying componentwise subtraction.

Subtract each entry in the given matrix from each entry in this matrix matching its row and column index.

Definition at line 125 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator/= const ShGeneric< 1, T > &  a  ) 
 

Modifying scalar division.

Divide each component of this matrix by the given attribute.

Definition at line 172 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
template<ShBindingType Binding2>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator/= const ShMatrix< Rows, Cols, Binding2, T > &  other  ) 
 

Modifying componentwise division.

Divide each entry in this matrix by the entry in the given matrix matching its row and column index.

Definition at line 135 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator= const ShGeneric< 1, T > &  scalar  ) 
 

Assignment (scalar promotion).

Construct an identity matrix multiplied by the scalar.

Definition at line 89 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator= const T &  scalar  ) 
 

Assignment (scalar promotion).

Construct an identity matrix multiplied by the scalar.

Definition at line 77 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
template<ShBindingType Binding2>
ShMatrix& SH::ShMatrix< Rows, Cols, Binding, T >::operator= const ShMatrix< Rows, Cols, Binding2, T > &  other  ) 
 

Assignment.

Replace each entry in this matrix with the corresponding entry of the given matrix.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows, Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator= const ShMatrix< Rows, Cols, Binding, T > &  other  ) 
 

Assignment.

Replace each entry in this matrix with the corresponding entry of the given matrix.

Definition at line 59 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
const ShAttrib< Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator[] int  i  )  const
 

Attribute row access.

Return a reference to the given row as an ShAttrib.

Definition at line 107 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShAttrib< Cols, Binding, T > & SH::ShMatrix< Rows, Cols, Binding, T >::operator[] int  i  ) 
 

Attribute row access.

Return a reference to the given row as an ShAttrib.

Definition at line 101 of file ShMatrixImpl.hpp.

template<int Rows, int Cols, ShBindingType Binding, typename T>
ShMatrix< Rows-1, Cols-1, SH_TEMP, T > SH::ShMatrix< Rows, Cols, Binding, T >::subMatrix int  ,
int 
const
 

Obtain a submatrix of this matrix.

Return a copy of this matrix not containing the given row and column.

Definition at line 229 of file ShMatrixImpl.hpp.

Referenced by SH::cofactors(), and SH::det().


The documentation for this class was generated from the following files:
Generated on Thu Jul 28 17:36:04 2005 for Sh by  doxygen 1.4.3-20050530