Ravelin
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Ravelin::MATRIXN Class Reference

A generic, possibly non-square matrix. More...

#include <MatrixNd.h>

Public Member Functions

 MATRIXN (unsigned rows, unsigned columns)
 
 MATRIXN (unsigned rows, unsigned columns, const REAL *array)
 
 MATRIXN (const VECTORN &v, Transposition trans=eNoTranspose)
 
 MATRIXN (const SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
 MATRIXN (const CONST_SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
 MATRIXN (const MATRIX2 &m)
 
 MATRIXN (const MATRIX3 &m)
 
 MATRIXN (const MATRIXN &m)
 
 MATRIXN (const SHAREDMATRIXN &m)
 
 MATRIXN (const CONST_SHAREDMATRIXN &m)
 
MATRIXNset_identity ()
 
MATRIXNset_identity (unsigned sz)
 
bool is_symmetric (REAL tolerance=-1.0) const
 
REAL norm_inf () const
 
MATRIXNzero_upper_triangle ()
 
MATRIXNzero_lower_triangle ()
 
MATRIXNset (const VECTORN &v, Transposition trans=eNoTranspose)
 
MATRIXNset (const SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
MATRIXNset (const CONST_SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
unsigned rows () const
 
unsigned columns () const
 
virtual MATRIXNresize (unsigned rows, unsigned columns, bool preserve=false)
 
MATRIXNremove_row (unsigned i)
 
MATRIXNremove_column (unsigned i)
 
MATRIXNnegate ()
 
MATRIXNset_zero ()
 
virtual MATRIXNtranspose ()
 
virtual MATRIXNoperator= (const MATRIXN &source)
 
MATRIXNoperator= (const MATRIX2 &source)
 
MATRIXNoperator= (const MATRIX3 &source)
 
MATRIXNoperator= (const SHAREDMATRIXN &source)
 
MATRIXNoperator= (const CONST_SHAREDMATRIXN &source)
 
MATRIXNoperator= (const VECTORN &v)
 
MATRIXNoperator= (const SHAREDVECTORN &v)
 
MATRIXNoperator= (const CONST_SHAREDVECTORN &v)
 
MATRIXNoperator+= (const MATRIXN &m)
 
MATRIXNoperator-= (const MATRIXN &m)
 
MATRIXNoperator/= (REAL scalar)
 
MATRIXNoperator*= (REAL scalar)
 
REAL * data ()
 
const REAL * data () const
 
void free_memory ()
 
void compress ()
 
unsigned leading_dim () const
 
unsigned inc () const
 
unsigned size () const
 Gets the total number of elements in this matrix.
 
const REAL & operator() (unsigned i, unsigned j) const
 
REAL & operator() (const unsigned i, const unsigned j)
 
CONST_COLUMN_ITERATOR block_column_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 This file consists of general routines for constant matrices. More...
 
CONST_COLUMN_ITERATOR block_column_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a column iterator to a block.
 
CONST_ROW_ITERATOR block_row_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a row iterator to a block.
 
CONST_ROW_ITERATOR block_row_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a row iterator to a block.
 
template<class V >
V & get_row (unsigned row, V &v) const
 
template<class V >
V & get_column (unsigned column, V &v) const
 
template<class T , class U >
U & transpose_mult_transpose (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'.
 
template<class T , class U >
U & mult_transpose (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'.
 
template<class T , class U >
U & transpose_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.
 
template<class T , class U >
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.
 
template<class M >
M & get_sub_mat (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end, M &m, Transposition trans=eNoTranspose) const
 Gets the specified sub matrix. More...
 
template<class ForwardIterator , class M >
M & select_columns (ForwardIterator col_start, ForwardIterator col_end, M &m) const
 Gets a submatrix of columns (not necessarily a block) More...
 
template<class M >
M & select_columns (std::vector< bool > &col_select, M &m) const
 Gets a submatrix of columns (not necessarily a block) More...
 
template<class ForwardIterator , class M >
M & select_rows (ForwardIterator row_start, ForwardIterator row_end, M &m) const
 Gets a submatrix of rows (not necessarily a block) More...
 
template<class M >
M & select_rows (std::vector< bool > &row_select, M &m) const
 Gets a submatrix of rows (not necessarily a block) More...
 
template<class ForwardIterator1 , class ForwardIterator2 , class X >
X & select (ForwardIterator1 row_start, ForwardIterator1 row_end, ForwardIterator2 col_start, ForwardIterator2 col_end, X &m) const
 Gets a submatrix (not necessarily a block) More...
 
template<class X >
X & select (const std::vector< bool > &rows, const std::vector< bool > &cols, X &m) const
 Gets a submatrix (not necessarily a block)
 
template<class M >
M & select_square (const std::vector< bool > &indices, M &result) const
 Gets a square submatrix (not necessarily a block)
 
template<class ForwardIterator , class M >
M & select_square (ForwardIterator start, ForwardIterator end, M &m) const
 
CONST_COLUMN_ITERATOR column_iterator_begin () const
 Get an iterator to the beginning.
 
CONST_COLUMN_ITERATOR column_iterator_end () const
 Get an iterator to the end.
 
CONST_ROW_ITERATOR row_iterator_begin () const
 Get an iterator to the beginning.
 
CONST_ROW_ITERATOR row_iterator_end () const
 Get an iterator to the end.
 
COLUMN_ITERATOR block_column_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a column iterator to a block.
 
COLUMN_ITERATOR block_column_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a column iterator to a block.
 
ROW_ITERATOR block_row_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a row iterator to a block.
 
ROW_ITERATOR block_row_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a row iterator to a block.
 
template<class V >
MATRIXX & set_row (unsigned row, const V &v)
 
template<class V >
MATRIXX & set_column (unsigned column, const V &v)
 
template<class M >
MATRIXX & set_sub_mat (unsigned row_start, unsigned col_start, const M &m, Transposition trans=eNoTranspose)
 Sets the specified sub matrix. More...
 
ROW_ITERATOR row_iterator_begin ()
 Get an iterator to the beginning (iterates column by column)
 
ROW_ITERATOR row_iterator_end ()
 Get an iterator to the end.
 
COLUMN_ITERATOR column_iterator_begin ()
 Get an iterator to the beginning (iterates column by column)
 
COLUMN_ITERATOR column_iterator_end ()
 Get an iterator to the end.
 
CONST_SHAREDVECTORN row (unsigned i) const
 Gets the specified sub matrix. More...
 
CONST_SHAREDVECTORN column (unsigned i) const
 Gets a shared vector for a column.
 
CONST_SHAREDMATRIXN block (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a block as a constant shared matrix.
 
SHAREDVECTORN row (unsigned i)
 Gets a shared vector for a row.
 
SHAREDVECTORN column (unsigned i)
 Gets a shared vector for a column.
 
SHAREDMATRIXN block (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a block as a shared matrix.
 
template<class V >
XMATRIXN & set (const V &v, Transposition trans)
 Sets a matrix from a vector.
 
template<class M >
XMATRIXN & operator+= (const M &m)
 Adds m to *this in place.
 
template<class M >
XMATRIXN & operator-= (const M &m)
 Subtracts m from *this in place.
 
XMATRIXN & set_zero (unsigned m, unsigned n)
 Sets this to a m x n sized zero matrix.
 
 MATRIXN (unsigned rows, unsigned columns)
 
 MATRIXN (unsigned rows, unsigned columns, const REAL *array)
 
 MATRIXN (const VECTORN &v, Transposition trans=eNoTranspose)
 
 MATRIXN (const SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
 MATRIXN (const CONST_SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
 MATRIXN (const MATRIX2 &m)
 
 MATRIXN (const MATRIX3 &m)
 
 MATRIXN (const MATRIXN &m)
 
 MATRIXN (const SHAREDMATRIXN &m)
 
 MATRIXN (const CONST_SHAREDMATRIXN &m)
 
MATRIXNset_identity ()
 
MATRIXNset_identity (unsigned sz)
 
bool is_symmetric (REAL tolerance=-1.0) const
 
REAL norm_inf () const
 
MATRIXNzero_upper_triangle ()
 
MATRIXNzero_lower_triangle ()
 
MATRIXNset (const VECTORN &v, Transposition trans=eNoTranspose)
 
MATRIXNset (const SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
MATRIXNset (const CONST_SHAREDVECTORN &v, Transposition trans=eNoTranspose)
 
unsigned rows () const
 
unsigned columns () const
 
virtual MATRIXNresize (unsigned rows, unsigned columns, bool preserve=false)
 
MATRIXNremove_row (unsigned i)
 
MATRIXNremove_column (unsigned i)
 
MATRIXNnegate ()
 
MATRIXNset_zero ()
 
virtual MATRIXNtranspose ()
 
virtual MATRIXNoperator= (const MATRIXN &source)
 
MATRIXNoperator= (const MATRIX2 &source)
 
MATRIXNoperator= (const MATRIX3 &source)
 
MATRIXNoperator= (const SHAREDMATRIXN &source)
 
MATRIXNoperator= (const CONST_SHAREDMATRIXN &source)
 
MATRIXNoperator= (const VECTORN &v)
 
MATRIXNoperator= (const SHAREDVECTORN &v)
 
MATRIXNoperator= (const CONST_SHAREDVECTORN &v)
 
MATRIXNoperator+= (const MATRIXN &m)
 
MATRIXNoperator-= (const MATRIXN &m)
 
MATRIXNoperator/= (REAL scalar)
 
MATRIXNoperator*= (REAL scalar)
 
REAL * data ()
 
const REAL * data () const
 
void free_memory ()
 
void compress ()
 
unsigned leading_dim () const
 
unsigned inc () const
 
unsigned size () const
 Gets the total number of elements in this matrix.
 
const REAL & operator() (unsigned i, unsigned j) const
 
REAL & operator() (const unsigned i, const unsigned j)
 
CONST_COLUMN_ITERATOR block_column_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 This file consists of general routines for constant matrices. More...
 
CONST_COLUMN_ITERATOR block_column_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a column iterator to a block.
 
CONST_ROW_ITERATOR block_row_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a row iterator to a block.
 
CONST_ROW_ITERATOR block_row_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a row iterator to a block.
 
template<class V >
V & get_row (unsigned row, V &v) const
 
template<class V >
V & get_column (unsigned column, V &v) const
 
template<class T , class U >
U & transpose_mult_transpose (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'.
 
template<class T , class U >
U & mult_transpose (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'.
 
template<class T , class U >
U & transpose_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.
 
template<class T , class U >
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.
 
template<class M >
M & get_sub_mat (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end, M &m, Transposition trans=eNoTranspose) const
 Gets the specified sub matrix. More...
 
template<class ForwardIterator , class M >
M & select_columns (ForwardIterator col_start, ForwardIterator col_end, M &m) const
 Gets a submatrix of columns (not necessarily a block) More...
 
template<class M >
M & select_columns (std::vector< bool > &col_select, M &m) const
 Gets a submatrix of columns (not necessarily a block) More...
 
template<class ForwardIterator , class M >
M & select_rows (ForwardIterator row_start, ForwardIterator row_end, M &m) const
 Gets a submatrix of rows (not necessarily a block) More...
 
template<class M >
M & select_rows (std::vector< bool > &row_select, M &m) const
 Gets a submatrix of rows (not necessarily a block) More...
 
template<class ForwardIterator1 , class ForwardIterator2 , class X >
X & select (ForwardIterator1 row_start, ForwardIterator1 row_end, ForwardIterator2 col_start, ForwardIterator2 col_end, X &m) const
 Gets a submatrix (not necessarily a block) More...
 
template<class X >
X & select (const std::vector< bool > &rows, const std::vector< bool > &cols, X &m) const
 Gets a submatrix (not necessarily a block)
 
template<class M >
M & select_square (const std::vector< bool > &indices, M &result) const
 Gets a square submatrix (not necessarily a block)
 
template<class ForwardIterator , class M >
M & select_square (ForwardIterator start, ForwardIterator end, M &m) const
 
CONST_COLUMN_ITERATOR column_iterator_begin () const
 Get an iterator to the beginning.
 
CONST_COLUMN_ITERATOR column_iterator_end () const
 Get an iterator to the end.
 
CONST_ROW_ITERATOR row_iterator_begin () const
 Get an iterator to the beginning.
 
CONST_ROW_ITERATOR row_iterator_end () const
 Get an iterator to the end.
 
COLUMN_ITERATOR block_column_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a column iterator to a block.
 
COLUMN_ITERATOR block_column_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a column iterator to a block.
 
ROW_ITERATOR block_row_iterator_begin (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a row iterator to a block.
 
ROW_ITERATOR block_row_iterator_end (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a row iterator to a block.
 
template<class V >
MATRIXX & set_row (unsigned row, const V &v)
 
template<class V >
MATRIXX & set_column (unsigned column, const V &v)
 
template<class M >
MATRIXX & set_sub_mat (unsigned row_start, unsigned col_start, const M &m, Transposition trans=eNoTranspose)
 Sets the specified sub matrix. More...
 
ROW_ITERATOR row_iterator_begin ()
 Get an iterator to the beginning (iterates column by column)
 
ROW_ITERATOR row_iterator_end ()
 Get an iterator to the end.
 
COLUMN_ITERATOR column_iterator_begin ()
 Get an iterator to the beginning (iterates column by column)
 
COLUMN_ITERATOR column_iterator_end ()
 Get an iterator to the end.
 
CONST_SHAREDVECTORN row (unsigned i) const
 Gets the specified sub matrix. More...
 
CONST_SHAREDVECTORN column (unsigned i) const
 Gets a shared vector for a column.
 
CONST_SHAREDMATRIXN block (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
 Gets a block as a constant shared matrix.
 
SHAREDVECTORN row (unsigned i)
 Gets a shared vector for a row.
 
SHAREDVECTORN column (unsigned i)
 Gets a shared vector for a column.
 
SHAREDMATRIXN block (unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end)
 Gets a block as a shared matrix.
 
template<class V >
XMATRIXN & set (const V &v, Transposition trans)
 Sets a matrix from a vector.
 
template<class M >
XMATRIXN & operator+= (const M &m)
 Adds m to *this in place.
 
template<class M >
XMATRIXN & operator-= (const M &m)
 Subtracts m from *this in place.
 
XMATRIXN & set_zero (unsigned m, unsigned n)
 Sets this to a m x n sized zero matrix.
 

Static Public Member Functions

static MATRIXN identity (unsigned dim)
 
static MATRIXN construct_variable (unsigned rows, unsigned cols,...)
 
static MATRIXN zero (unsigned rows, unsigned columns)
 
static MATRIXNmult (const MATRIXN &m1, const MATRIXN &m2, MATRIXN &result)
 
template<class V , class U , class W >
static W & diag_mult (const V &d, const U &v, W &result)
 Determines the transpose of a matrix and stores the result in a given matrix. More...
 
template<class M >
static M & transpose (const XMATRIXN &m, M &result)
 Determines the transpose of a matrix and stores the result in a given matrix.
 
template<class V , class W >
static W & diag_mult (const V &d, const XMATRIXN &m, W &result)
 Multiplies the diagonal matrix formed from d by the matrix m.
 
template<class V , class W >
static W & diag_mult_transpose (const V &d, const XMATRIXN &m, W &result)
 Multiplies the diagonal matrix formed from d by the matrix transpose(m)
 
static MATRIXN identity (unsigned dim)
 
static MATRIXN construct_variable (unsigned rows, unsigned cols,...)
 
static MATRIXN zero (unsigned rows, unsigned columns)
 
static MATRIXNmult (const MATRIXN &m1, const MATRIXN &m2, MATRIXN &result)
 
template<class V , class U , class W >
static W & diag_mult (const V &d, const U &v, W &result)
 Determines the transpose of a matrix and stores the result in a given matrix. More...
 
template<class M >
static M & transpose (const XMATRIXN &m, M &result)
 Determines the transpose of a matrix and stores the result in a given matrix.
 
template<class V , class W >
static W & diag_mult (const V &d, const XMATRIXN &m, W &result)
 Multiplies the diagonal matrix formed from d by the matrix m.
 
template<class V , class W >
static W & diag_mult_transpose (const V &d, const XMATRIXN &m, W &result)
 Multiplies the diagonal matrix formed from d by the matrix transpose(m)
 

Protected Attributes

SharedResizable< REAL > _data
 
unsigned _rows
 
unsigned _columns
 

Static Protected Attributes

static FastThreadable< MATRIXN_n
 
static FastThreadable< VECTORN_workv
 

Friends

class SHAREDMATRIXN
 

Detailed Description

A generic, possibly non-square matrix.

The underlying data is stored in column-major format (e.g., the element at row 1, column 0 is the second element in the flat array).

Member Function Documentation

CONST_COLUMN_ITERATOR Ravelin::MATRIXN::block_column_iterator_begin ( unsigned  row_start,
unsigned  row_end,
unsigned  col_start,
unsigned  col_end 
) const
inline

This file consists of general routines for constant matrices.

Gets a column iterator to a block

CONST_COLUMN_ITERATOR Ravelin::MATRIXN::block_column_iterator_begin ( unsigned  row_start,
unsigned  row_end,
unsigned  col_start,
unsigned  col_end 
) const
inline

This file consists of general routines for constant matrices.

Gets a column iterator to a block

template<class V , class U , class W >
static W& Ravelin::MATRIXN::diag_mult ( const V &  d,
const U &  v,
W &  result 
)
inlinestatic

Determines the transpose of a matrix and stores the result in a given matrix.

Multiplies the diagonal matrix formed from d by the vector v

template<class V , class U , class W >
static W& Ravelin::MATRIXN::diag_mult ( const V &  d,
const U &  v,
W &  result 
)
inlinestatic

Determines the transpose of a matrix and stores the result in a given matrix.

Multiplies the diagonal matrix formed from d by the vector v

template<class M >
M& Ravelin::MATRIXN::get_sub_mat ( unsigned  row_start,
unsigned  row_end,
unsigned  col_start,
unsigned  col_end,
M &  m,
Transposition  trans = eNoTranspose 
) const
inline

Gets the specified sub matrix.

Parameters
row_startthe row to start (inclusive)
row_endthe row to end (exclusive)
col_startthe column to start (inclusive)
col_endthe column to end (exclusive)
transposedetermines whether to store the transpose of the submatrix into m
Returns
a (row_end - row_start) x (col_end - col_start) sized matrix
template<class M >
M& Ravelin::MATRIXN::get_sub_mat ( unsigned  row_start,
unsigned  row_end,
unsigned  col_start,
unsigned  col_end,
M &  m,
Transposition  trans = eNoTranspose 
) const
inline

Gets the specified sub matrix.

Parameters
row_startthe row to start (inclusive)
row_endthe row to end (exclusive)
col_startthe column to start (inclusive)
col_endthe column to end (exclusive)
transposedetermines whether to store the transpose of the submatrix into m
Returns
a (row_end - row_start) x (col_end - col_start) sized matrix
CONST_SHAREDVECTORN Ravelin::MATRIXN::row ( unsigned  i) const
inline

Gets the specified sub matrix.

Parameters
row_startthe row to start (inclusive)
row_endthe row to end (exclusive)
col_startthe column to start (inclusive)
col_endthe column to end (exclusive)
transposedetermines whether to store the transpose of the submatrix into m
Returns
a (row_end - row_start) x (col_end - col_start) sized matrixGets a constant shared vector for a row

Referenced by Ravelin::PRISMATICJOINT::calc_constraint_jacobian(), and Ravelin::UNIVERSALJOINT::calc_constraint_jacobian().

CONST_SHAREDVECTORN Ravelin::MATRIXN::row ( unsigned  i) const
inline

Gets the specified sub matrix.

Parameters
row_startthe row to start (inclusive)
row_endthe row to end (exclusive)
col_startthe column to start (inclusive)
col_endthe column to end (exclusive)
transposedetermines whether to store the transpose of the submatrix into m
Returns
a (row_end - row_start) x (col_end - col_start) sized matrixGets a constant shared vector for a row
template<class ForwardIterator1 , class ForwardIterator2 , class X >
X& Ravelin::MATRIXN::select ( ForwardIterator1  row_start,
ForwardIterator1  row_end,
ForwardIterator2  col_start,
ForwardIterator2  col_end,
X &  m 
) const
inline

Gets a submatrix (not necessarily a block)

Parameters
row_startan iterator pointing to the beginning of a container of row indices (container need not be sorted)
row_endan iterator pointing to the end of a container of row indices (container need not be sorted)
col_startan iterator pointing to the beginning of a container of column indices (container need not be sorted)
col_endan iterator pointing to the end of a container of column indices (container need not be sorted)
Mcontains the submatrix on return
template<class ForwardIterator1 , class ForwardIterator2 , class X >
X& Ravelin::MATRIXN::select ( ForwardIterator1  row_start,
ForwardIterator1  row_end,
ForwardIterator2  col_start,
ForwardIterator2  col_end,
X &  m 
) const
inline

Gets a submatrix (not necessarily a block)

Parameters
row_startan iterator pointing to the beginning of a container of row indices (container need not be sorted)
row_endan iterator pointing to the end of a container of row indices (container need not be sorted)
col_startan iterator pointing to the beginning of a container of column indices (container need not be sorted)
col_endan iterator pointing to the end of a container of column indices (container need not be sorted)
Mcontains the submatrix on return
template<class ForwardIterator , class M >
M& Ravelin::MATRIXN::select_columns ( ForwardIterator  col_start,
ForwardIterator  col_end,
M &  m 
) const
inline

Gets a submatrix of columns (not necessarily a block)

Parameters
col_startan iterator pointing to the beginning of a container of column indices (container need not be sorted)
col_endan iterator pointing to the end of a container of column indices (container need not be sorted)
Mcontains the submatrix on return
template<class ForwardIterator , class M >
M& Ravelin::MATRIXN::select_columns ( ForwardIterator  col_start,
ForwardIterator  col_end,
M &  m 
) const
inline

Gets a submatrix of columns (not necessarily a block)

Parameters
col_startan iterator pointing to the beginning of a container of column indices (container need not be sorted)
col_endan iterator pointing to the end of a container of column indices (container need not be sorted)
Mcontains the submatrix on return
template<class M >
M& Ravelin::MATRIXN::select_columns ( std::vector< bool > &  col_select,
M &  m 
) const
inline

Gets a submatrix of columns (not necessarily a block)

Parameters
col_selecta vector of bools; if the entry is true in the vector, the column is selected
Mcontains the submatrix on return
template<class M >
M& Ravelin::MATRIXN::select_columns ( std::vector< bool > &  col_select,
M &  m 
) const
inline

Gets a submatrix of columns (not necessarily a block)

Parameters
col_selecta vector of bools; if the entry is true in the vector, the column is selected
Mcontains the submatrix on return
template<class ForwardIterator , class M >
M& Ravelin::MATRIXN::select_rows ( ForwardIterator  row_start,
ForwardIterator  row_end,
M &  m 
) const
inline

Gets a submatrix of rows (not necessarily a block)

Parameters
row_startan iterator pointing to the beginning of a container of row indices (container need not be sorted)
row_endan iterator pointing to the end of a container of row indices (container need not be sorted)
Mcontains the submatrix on return
template<class ForwardIterator , class M >
M& Ravelin::MATRIXN::select_rows ( ForwardIterator  row_start,
ForwardIterator  row_end,
M &  m 
) const
inline

Gets a submatrix of rows (not necessarily a block)

Parameters
row_startan iterator pointing to the beginning of a container of row indices (container need not be sorted)
row_endan iterator pointing to the end of a container of row indices (container need not be sorted)
Mcontains the submatrix on return
template<class M >
M& Ravelin::MATRIXN::select_rows ( std::vector< bool > &  row_select,
M &  m 
) const
inline

Gets a submatrix of rows (not necessarily a block)

Parameters
row_selecta vector of bools; if the entry is true in the vector, the row is selected
Mcontains the submatrix on return
template<class M >
M& Ravelin::MATRIXN::select_rows ( std::vector< bool > &  row_select,
M &  m 
) const
inline

Gets a submatrix of rows (not necessarily a block)

Parameters
row_selecta vector of bools; if the entry is true in the vector, the row is selected
Mcontains the submatrix on return
template<class ForwardIterator , class M >
M& Ravelin::MATRIXN::select_square ( ForwardIterator  start,
ForwardIterator  end,
M &  m 
) const
inline
Parameters
startan iterator pointing to the beginning of a container of row/column indices (container need not be sorted)
endan iterator pointing to the end of a container of row/column indices (container need not be sorted)
Mcontains the submatrix on return
template<class ForwardIterator , class M >
M& Ravelin::MATRIXN::select_square ( ForwardIterator  start,
ForwardIterator  end,
M &  m 
) const
inline
Parameters
startan iterator pointing to the beginning of a container of row/column indices (container need not be sorted)
endan iterator pointing to the end of a container of row/column indices (container need not be sorted)
Mcontains the submatrix on return
template<class M >
MATRIXX& Ravelin::MATRIXN::set_sub_mat ( unsigned  row_start,
unsigned  col_start,
const M &  m,
Transposition  trans = eNoTranspose 
)
inline

Sets the specified sub matrix.

Parameters
row_startthe row to start (inclusive)
col_startthe column to start (inclusive)
mthe source matrix
transposedetermines whether the m is to be transposed
Note
fails assertion if m is too large to insert into this
template<class M >
MATRIXX& Ravelin::MATRIXN::set_sub_mat ( unsigned  row_start,
unsigned  col_start,
const M &  m,
Transposition  trans = eNoTranspose 
)
inline

Sets the specified sub matrix.

Parameters
row_startthe row to start (inclusive)
col_startthe column to start (inclusive)
mthe source matrix
transposedetermines whether the m is to be transposed
Note
fails assertion if m is too large to insert into this

The documentation for this class was generated from the following files: