Linear Algebra

Classes

class  TooN::DiagonalMatrix< Size, Precision, Base >
struct  TooN::Matrix< Rows, Cols, Precision, Layout >
class  TooN::Vector< Size, Precision, Base >

Functions

template<int Size, class P , class B >
TooN::Matrix< 3, 3, P > TooN::cross_product_matrix (const Vector< Size, P, B > &vec)
template<int R, int C, class P , class B >
TooN::determinant (const Matrix< R, C, P, B > &A)
template<int R, int C, typename Precision , typename Base >
Precision TooN::determinant_gaussian_elimination (const Matrix< R, C, Precision, Base > &A_)
template<int R, int C, typename P , typename B >
Matrix< R, C, P > TooN::exp (const Matrix< R, C, P, B > &m)
template<int Size, class Precision , class Base >
Internal::VectorStartFill
< Size, Precision, Base >
TooN::Fill (Vector< Size, Precision, Base > &v)
template<int R, int C, class Precision , class Base >
Internal::MatrixStartFill< R,
C, Precision, Base >
TooN::Fill (Matrix< R, C, Precision, Base > &m)
template<int Rows, int Cols, class Precision , class Base >
TOON_DEPRECATED void TooN::Fill (Matrix< Rows, Cols, Precision, Base > &m, const Precision &p)
template<int Size, class Precision , class Base >
TOON_DEPRECATED void TooN::Fill (Vector< Size, Precision, Base > &v, const Precision &p)
template<int S, class P , class B >
bool TooN::isfinite (const Vector< S, P, B > &v)
template<int S, class P , class B >
bool TooN::isnan (const Vector< S, P, B > &v)
template<int Size, class Precision , class Base >
Precision TooN::norm (const Vector< Size, Precision, Base > &v)
template<int R, int C, typename P , typename B >
TooN::norm_1 (const Matrix< R, C, P, B > &m)
template<int Size, class Precision , class Base >
Precision TooN::norm_1 (const Vector< Size, Precision, Base > &v)
template<int Size, class Precision , class Base >
Precision TooN::norm_2 (const Vector< Size, Precision, Base > &v)
template<int R, int C, typename P , typename B >
TooN::norm_fro (const Matrix< R, C, P, B > &m)
template<int R, int C, typename P , typename B >
TooN::norm_inf (const Matrix< R, C, P, B > &m)
template<int Size, class Precision , class Base >
Precision TooN::norm_inf (const Vector< Size, Precision, Base > &v)
template<int Size, class Precision , class Base >
Precision TooN::norm_sq (const Vector< Size, Precision, Base > &v)
template<int Size, class Precision , class Base >
void TooN::normalize (Vector< Size, Precision, Base > v)
template<int Size, typename Precision , typename Base >
Vector<(Size==Dynamic?Dynamic:Size-1),
Precision >
TooN::project (const Vector< Size, Precision, Base > &v)
template<int Rows, int Cols, typename Precision , typename Base >
void TooN::Symmetrize (Matrix< Rows, Cols, Precision, Base > &m)
template<int Rows, int Cols, typename Precision , typename Base >
Precision TooN::trace (const Matrix< Rows, Cols, Precision, Base > &m)
template<int Size, class Precision , class Base >
Vector< Size, Precision > TooN::unit (const Vector< Size, Precision, Base > &v)
template<int Size, typename Precision , typename Base >
Vector<(Size==Dynamic?Dynamic:Size+1),
Precision >
TooN::unproject (const Vector< Size, Precision, Base > &v)

Variables

static Operator
< Internal::Identity
< Internal::One > >
TooN::Identity
static const Operator
< Internal::Scalars
< Internal::One > >
TooN::Ones
static Operator< Internal::Zero > TooN::Zeros

template<int Rows, int Cols>
Matrix< Rows, Cols, double,
Reference::RowMajor >
TooN::wrapMatrix (double *data)

Detailed Description

Vector and Matrix classes, and helpers.

Function Documentation

template<int Size, class P , class B >
 TooN::Matrix<3, 3, P> TooN::cross_product_matrix ( const Vector< Size, P, B > & vec )  [inline]

creates an returns a cross product matrix M from a 3 vector v, such that for all vectors w, the following holds: v ^ w = M * w

Parameters:
 vec the 3 vector input
Returns:
the 3x3 matrix to set to the cross product matrix

Definition at line 348 of file helpers.h.

template<int R, int C, class P , class B >
 P TooN::determinant ( const Matrix< R, C, P, B > & A )  [inline]

Compute the determinant of a matrix using an appropriate method. The obvious method is used for 2x2, otherwise determinant_gaussian_elimination() or determinant_LU() is used depending on the value of TOON_DETERMINANT_LAPACK. See also Functions using LAPACK.

Parameters:
 A The matrix to find the determinant of.
Returns:
determinant.

Definition at line 149 of file determinant.h.

template<int R, int C, typename Precision , typename Base >
 Precision TooN::determinant_gaussian_elimination ( const Matrix< R, C, Precision, Base > & A_ )  [inline]

Compute the determinant using Gaussian elimination.

Parameters:
 A_ The matrix to find the determinant of.
Returns:
determinant.

Definition at line 66 of file determinant.h.

template<int R, int C, typename P , typename B >
 Matrix TooN::exp ( const Matrix< R, C, P, B > & m )  [inline]

computes the matrix exponential of a matrix m by scaling m by 1/(powers of 2), using Taylor series and squaring again.

Parameters:
 m input matrix, must be square
Returns:
result matrix of the same size/type as input

Definition at line 284 of file helpers.h.

template<int Size, class Precision , class Base >
 Internal::VectorStartFill TooN::Fill ( Vector< Size, Precision, Base > & v )  [inline]

Set up a vector for filling. Uses the following syntax:

        Vector<2> v;
Fill(v) = 1, 2;


Overfill is detected at compile time if possible, underfill is detected at run-time. The checks can not be optimized out for dynamic vectors, so define TOON_NDEBUG_FILL to prevent the checks from being used.

Parameters:
 v Vector to fill

Definition at line 147 of file comma.hh.

template<int R, int C, class Precision , class Base >
 Internal::MatrixStartFill TooN::Fill ( Matrix< R, C, Precision, Base > & m )  [inline]

Set up a matrix for filling. Uses the following syntax:

        Matrix<2,2> m;
Fill(m) = 1, 2,
3, 4;


Overfill is detected at compile time if possible, underfill is detected at run-time. The checks can not be optimized out for dynamic matrices, so define TOON_NDEBUG_FILL to prevent the checks from being used.

Parameters:
 m Matrix to fill

Definition at line 130 of file comma.hh.

template<int Rows, int Cols, class Precision , class Base >
 TOON_DEPRECATED void TooN::Fill ( Matrix< Rows, Cols, Precision, Base > & m, const Precision & p )  [inline]
Deprecated:

Definition at line 60 of file helpers.h.

template<int Size, class Precision , class Base >
 TOON_DEPRECATED void TooN::Fill ( Vector< Size, Precision, Base > & v, const Precision & p )  [inline]
Deprecated:

Definition at line 52 of file helpers.h.

template<int S, class P , class B >
 bool TooN::isfinite ( const Vector< S, P, B > & v )  [inline]

Returns true if every element is finite

Definition at line 297 of file helpers.h.

template<int S, class P , class B >
 bool TooN::isnan ( const Vector< S, P, B > & v )  [inline]

Returns true if any element is NaN

Definition at line 308 of file helpers.h.

template<int Size, class Precision , class Base >
 Precision TooN::norm ( const Vector< Size, Precision, Base > & v )  [inline]

Compute the norm of v

Parameters:
 v v

Definition at line 70 of file helpers.h.

template<int R, int C, typename P , typename B >
 P TooN::norm_1 ( const Matrix< R, C, P, B > & m )  [inline]

L1 (col sum) norm of input matrix m computes the maximum of the sums of absolute values over columns

Definition at line 245 of file helpers.h.

template<int Size, class Precision , class Base >
 Precision TooN::norm_1 ( const Vector< Size, Precision, Base > & v )  [inline]

Compute the norm of v

Parameters:
 v v

Definition at line 87 of file helpers.h.

template<int Size, class Precision , class Base >
 Precision TooN::norm_2 ( const Vector< Size, Precision, Base > & v )  [inline]

Compute the norm of v. Synonym for norm()

Parameters:
 v v

Definition at line 115 of file helpers.h.

template<int R, int C, typename P , typename B >
 P TooN::norm_fro ( const Matrix< R, C, P, B > & m )  [inline]

Frobenius (root of sum of squares) norm of input matrix m

Parameters:
 m m

Definition at line 214 of file helpers.h.

template<int R, int C, typename P , typename B >
 P TooN::norm_inf ( const Matrix< R, C, P, B > & m )  [inline]

L&#8734; (row sum) norm of input matrix m computes the maximum of the sums of absolute values over rows

Definition at line 228 of file helpers.h.

template<int Size, class Precision , class Base >
 Precision TooN::norm_inf ( const Vector< Size, Precision, Base > & v )  [inline]

Compute the norm of v

Parameters:
 v v

Definition at line 99 of file helpers.h.

template<int Size, class Precision , class Base >
 Precision TooN::norm_sq ( const Vector< Size, Precision, Base > & v )  [inline]

Compute the norm of v

Parameters:
 v v

Definition at line 79 of file helpers.h.

template<int Size, class Precision , class Base >
 void TooN::normalize ( Vector< Size, Precision, Base > v )  [inline]

Normalize a vector in place

Parameters:
 v Vector to normalize

Definition at line 138 of file helpers.h.

template<int Size, typename Precision , typename Base >
 Vector<(Size==Dynamic?Dynamic:Size-1), Precision> TooN::project ( const Vector< Size, Precision, Base > & v )  [inline]

For a vector v of length i, return

Parameters:
 v v

Definition at line 157 of file helpers.h.

template<int Rows, int Cols, typename Precision , typename Base >
 void TooN::Symmetrize ( Matrix< Rows, Cols, Precision, Base > & m )  [inline]

Symmetrize a matrix

Parameters:
 m m
Returns:

Definition at line 322 of file helpers.h.

template<int Rows, int Cols, typename Precision , typename Base >
 Precision TooN::trace ( const Matrix< Rows, Cols, Precision, Base > & m )  [inline]

computes the trace of a square matrix

Definition at line 336 of file helpers.h.

template<int Size, class Precision , class Base >
 Vector TooN::unit ( const Vector< Size, Precision, Base > & v )  [inline]

Compute a the unit vector .

Parameters:
 v v

Definition at line 126 of file helpers.h.

template<int Size, typename Precision , typename Base >
 Vector<(Size==Dynamic?Dynamic:Size+1), Precision> TooN::unproject ( const Vector< Size, Precision, Base > & v )  [inline]

For a vector v of length i, return

Parameters:
 v v

Definition at line 166 of file helpers.h.

template<int Rows, int Cols>
 Matrix TooN::wrapMatrix ( double * data )  [inline]

Wrap external data as a Matrix As usual, if template sizes are provided, then the run-time size is only used if the template size is not Dynamic.

Definition at line 98 of file reference.hh.

Variable Documentation

 Operator > TooN::Identity [static]

This function is used to add a scalar to the diagonal of a matrix, or to construct matrices. For example:

   Matrix<3> v;
...
...
Matrix<3> u = v  + Identity * 4;


Both + and += are supported. For assignment, if the matrix is non-square, then all elements off the leading diagonal are set to zero. For construction of dynamic matrices, a size needs to be given:

       Matrix<3> m_static = Identity;
Matrix<>  m_dynamic = Identity(3); //Construct a 3x3 matrix


Definition at line 748 of file objects.h.

 const Operator > TooN::Ones [static]

This function is used to add a scalar to every element of a vector or matrix. For example:

   Vector<3> v;
...
...
v += Ones * 3; //Add 3 to every element of v;


Both + and += are supported on vectors,matrices and slices.

For construction of dynamic vectors and matrices, a size needs to be given:

       Vector<3> v_static = Ones;
Vector<>  v_dynamic = Ones(3); //Construct a 3x1 vector full one 1s
Matrix<3> m_static = Ones;
Matrix<>  m_dynamic = Ones(3,4); //Construct a 3x4 matrix


Definition at line 713 of file objects.h.

 Operator TooN::Zeros [static]

This function is used to initialize vectors and matrices to zero. For construction of dynamic vectors and matrices, a size needs to be given. For example:

       Vector<3> v_static = Zeros;
Vector<>  v_dynamic = Zeros(3); //Construct a 3x1 vector
Matrix<3> m_static = Zeros;
Matrix<>  m_dynamic = Zeros(3,4); //Construct a 3x4 matrix


Definition at line 727 of file objects.h.

libtoon
Author(s): Florian Weisshardt
autogenerated on Fri Jan 11 10:09:42 2013