Classes | |
struct | IsField< C > |
Is a number a field? ie, +, -, *, / defined. More... | |
struct | Matrix< Rows, Cols, Precision, Layout > |
A matrix. More... | |
class | DiagonalMatrix< Size, Precision, Base > |
A diagonal matrix. More... | |
class | Vector< Size, Precision, Base > |
A vector. More... | |
Functions | |
template<int R, int C, typename Precision , typename Base > | |
Precision | determinant_gaussian_elimination (const Matrix< R, C, Precision, Base > &A_) |
template<int R, int C, class P , class B > | |
P | determinant_LU (const Matrix< R, C, P, B > &A) |
template<int R, int C, class P , class B > | |
P | determinant (const Matrix< R, C, P, B > &A) |
template<int Size, class Precision , class Base > | |
TOON_DEPRECATED void | Fill (Vector< Size, Precision, Base > &v, const Precision &p) |
template<int Rows, int Cols, class Precision , class Base > | |
TOON_DEPRECATED void | Fill (Matrix< Rows, Cols, Precision, Base > &m, const Precision &p) |
template<int Size, class Precision , class Base > | |
Precision | norm (const Vector< Size, Precision, Base > &v) |
template<int Size, class Precision , class Base > | |
Precision | norm_sq (const Vector< Size, Precision, Base > &v) |
template<int Size, class Precision , class Base > | |
Vector< Size, Precision > | unit (const Vector< Size, Precision, Base > &v) |
template<int Size, class Precision , class Base > | |
void | normalize (Vector< Size, Precision, Base > &v) |
template<int Size, typename Precision , typename Base > | |
Vector<(Size==Dynamic?Dynamic:Size-1), Precision > | project (const Vector< Size, Precision, Base > &v) |
template<int Size, typename Precision , typename Base > | |
Vector<(Size==Dynamic?Dynamic:Size+1), Precision > | unproject (const Vector< Size, Precision, Base > &v) |
template<int R, int C, typename P , typename B > | |
P | norm_fro (const Matrix< R, C, P, B > &m) |
template<int R, int C, typename P , typename B > | |
P | norm_inf (const Matrix< R, C, P, B > &m) |
template<int R, int C, typename P , typename B > | |
P | norm_1 (const Matrix< R, C, P, B > &m) |
template<int R, int C, typename P , typename B > | |
Matrix< R, C, P > | exp (const Matrix< R, C, P, B > &m) |
template<int S, class P , class B > | |
bool | isfinite (const Vector< S, P, B > &v) |
template<int S, class P , class B > | |
bool | isnan (const Vector< S, P, B > &v) |
template<int Rows, int Cols, typename Precision , typename Base > | |
void | Symmetrize (Matrix< Rows, Cols, Precision, Base > &m) |
template<int Rows, int Cols, typename Precision , typename Base > | |
Precision | trace (const Matrix< Rows, Cols, Precision, Base > &m) |
template<int Size, class P , class B > | |
TooN::Matrix< 3, 3, P > | cross_product_matrix (const Vector< Size, P, B > &vec) |
template<int I> | |
Internal::StaticEndMarker< I > | End () |
Internal::DynamicEndMarker | End (int e) |
template<int R, int C, class Precision , class Base > | |
Internal::MatrixStartFill< R, C, Precision, Base > | Fill (Matrix< R, C, Precision, Base > &m) |
template<int Size, class Precision , class Base > | |
Internal::VectorStartFill < Size, Precision, Base > | Fill (Vector< Size, Precision, Base > &v) |
Operator< Internal::Data< N, double > > | Data (double a,...) |
template<typename Precision > | |
Operator< Internal::Data< N, Precision > > | Data (const Precision &a,...) |
Variables | |
static const Operator < Internal::Scalars < Internal::One > > | Ones |
static Operator< Internal::Zero > | Zeros |
static Operator < Internal::Identity < Internal::One > > | Identity |
template<int Rows, int Cols> | |
Matrix< Rows, Cols, double, Reference::RowMajor > | wrapMatrix (double *data) |
template<int Rows, int Cols> | |
const Matrix< Rows, Cols, double, Reference::RowMajor > | wrapMatrix (const double *data) |
template<int Rows, int Cols, class Precision > | |
Matrix< Rows, Cols, Precision, Reference::RowMajor > | wrapMatrix (Precision *data) |
template<int Rows, int Cols, class Precision > | |
const Matrix< Rows, Cols, Precision, Reference::RowMajor > | wrapMatrix (const Precision *data) |
template<int Rows, int Cols> | |
Matrix< Rows, Cols, double, Reference::RowMajor > | wrapMatrix (double *data, int rows, int cols) |
template<int Rows, int Cols> | |
const Matrix< Rows, Cols, double, Reference::RowMajor > | wrapMatrix (const double *data, int rows, int cols) |
template<int Rows, int Cols, class Precision > | |
Matrix< Rows, Cols, Precision, Reference::RowMajor > | wrapMatrix (Precision *data, int rows, int cols) |
template<int Rows, int Cols, class Precision > | |
const Matrix< Rows, Cols, Precision, Reference::RowMajor > | wrapMatrix (const Precision *data, int rows, int cols) |
Precision TooN::determinant_gaussian_elimination | ( | const Matrix< R, C, Precision, Base > & | A_ | ) |
Compute the determinant using Gaussian elimination.
A_ | The matrix to find the determinant of. |
References TooN::determinant(), Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Referenced by TooN::determinant().
P TooN::determinant_LU | ( | const Matrix< R, C, P, B > & | A | ) |
Compute the determinant using TooN::LU.
A | The matrix to find the determinant of. |
References Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Referenced by TooN::determinant().
P TooN::determinant | ( | const Matrix< R, C, P, B > & | A | ) |
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.
A | The matrix to find the determinant of. |
References TooN::determinant_gaussian_elimination(), TooN::determinant_LU(), Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Referenced by TooN::determinant_gaussian_elimination().
TOON_DEPRECATED void TooN::Fill | ( | Vector< Size, Precision, Base > & | v, | |
const Precision & | p | |||
) |
References Vector< Size, Precision, Base >::size().
TOON_DEPRECATED void TooN::Fill | ( | Matrix< Rows, Cols, Precision, Base > & | m, | |
const Precision & | p | |||
) |
Precision TooN::norm | ( | const Vector< Size, Precision, Base > & | v | ) |
Precision TooN::norm_sq | ( | const Vector< Size, Precision, Base > & | v | ) |
Vector<Size, Precision> TooN::unit | ( | const Vector< Size, Precision, Base > & | v | ) |
Compute a the unit vector .
v | v |
Referenced by SO3< P >::coerce(), SO2< P >::coerce(), SO3< Precision >::ln(), and SO3< P >::SO3().
void TooN::normalize | ( | Vector< Size, Precision, Base > & | v | ) |
Vector<(Size==Dynamic?Dynamic:Size-1), Precision> TooN::project | ( | const Vector< Size, Precision, Base > & | v | ) |
For a vector v of length i, return .
v | v |
References TooN::End(), and Vector< Size, Precision, Base >::size().
Vector<(Size==Dynamic?Dynamic:Size+1), Precision> TooN::unproject | ( | const Vector< Size, Precision, Base > & | v | ) |
For a vector v of length i, return .
v | v |
References TooN::End(), and Vector< Size, Precision, Base >::size().
P TooN::norm_fro | ( | const Matrix< R, C, P, B > & | m | ) |
Frobenius (root of sum of squares) norm of input matrix m.
m | m |
References Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
P TooN::norm_inf | ( | const Matrix< R, C, P, B > & | m | ) |
L∞ (row sum) norm of input matrix m computes the maximum of the sums of absolute values over rows
References TooN::max(), Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Referenced by TooN::exp(), and TooN::Internal::exp_taylor().
P TooN::norm_1 | ( | const Matrix< R, C, P, B > & | m | ) |
L1 (col sum) norm of input matrix m computes the maximum of the sums of absolute values over columns
References TooN::max(), Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Matrix<R, C, P> TooN::exp | ( | const Matrix< R, C, P, B > & | m | ) |
computes the matrix exponential of a matrix m by scaling m by 1/(powers of 2), using Taylor series and squaring again.
m | input matrix, must be square |
References TooN::Internal::exp_taylor(), TooN::max(), TooN::norm_inf(), Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
bool TooN::isfinite | ( | const Vector< S, P, B > & | v | ) |
Returns true if every element is finite.
References Vector< Size, Precision, Base >::size().
Referenced by TooN::Internal::extrapolate_to_zero().
bool TooN::isnan | ( | const Vector< S, P, B > & | v | ) |
Returns true if any element is NaN.
References Vector< Size, Precision, Base >::size().
Referenced by TooN::Internal::extrapolate_to_zero().
void TooN::Symmetrize | ( | Matrix< Rows, Cols, Precision, Base > & | m | ) |
Symmetrize a matrix.
m | m |
References Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Precision TooN::trace | ( | const Matrix< Rows, Cols, Precision, Base > & | m | ) |
computes the trace of a square matrix
References Matrix< Rows, Cols, Precision, Layout >::num_cols(), and Matrix< Rows, Cols, Precision, Layout >::num_rows().
Referenced by ComputeSymEigen< 2 >::compute().
TooN::Matrix<3, 3, P> TooN::cross_product_matrix | ( | const Vector< Size, P, B > & | vec | ) |
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
vec | the 3 vector input |
References Vector< Size, Precision, Base >::size().
Internal::DynamicEndMarker End | ( | ) |
Used for slicing relative to the end, rather than with a known size.
For example:
Vector<3> v = makeVector(6,5,4,3,2); v.slice<1, End<0> >(); //5 4 3 2 v.slice<0, End<-1> >(); //6 5 4 3
For example:
Vector<> v = makeVector(6,5,4,3,2); v.slice(1, End); //5 4 3 2
Referenced by TooN::project(), and TooN::unproject().
Internal::DynamicEndMarker TooN::End | ( | int | e | ) |
Used for slicing relative to the end, rather than with a known size.
For example:
Vector<> v = makeVector(6,5,4,3,2); v.slice(1, End(-1)); //5 4 3
Internal::MatrixStartFill<R, C, Precision, Base> TooN::Fill | ( | Matrix< R, C, Precision, Base > & | m | ) |
Set up a matrix for filling.
Uses the following syntax:
Matrix<2,2> m; Fill(m) = 1, 2, 3, 4;
TOON_NDEBUG_FILL
to prevent the checks from being used. m | Matrix to fill |
Internal::VectorStartFill<Size, Precision, Base> TooN::Fill | ( | Vector< Size, Precision, Base > & | v | ) |
Set up a vector for filling.
Uses the following syntax:
Vector<2> v; Fill(v) = 1, 2;
TOON_NDEBUG_FILL
to prevent the checks from being used. v | Vector to fill |
Operator<Internal::Data<N, double> > TooN::Data | ( | double | a, | |
... | ||||
) |
Package up the function arguments as some data for filling matrices.
Matrices are filled in row major order. For example:
double theta = 2;
Matrix<2> rotation = data( cos(theta), sin(theta)
-sin(theta), cos(theta));
a | The first data element. |
Operator<Internal::Data<N, Precision> > TooN::Data | ( | const Precision & | a, | |
... | ||||
) |
Package up the function arguments as some data for filling matrices.
Any type can be uses. Matrices are filled in row-major order.
Matrix<2,2,float> rotation = data(1f, 2f, 3f, 4f);
a | The first data element. |
Matrix<Rows, Cols, double, Reference::RowMajor> TooN::wrapMatrix | ( | double * | data | ) |
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.
const Operator<Internal::Scalars<Internal::One> > 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;
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
Referenced by TooN::unproject().
Operator<Internal::Zero> 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
Referenced by TooN::Internal::bracket_minimum_forward(), WLS< Size, Precision >::clear(), IRLS< Size, Precision, Reweight >::clear(), SL< N, Precision >::exp(), TooN::Internal::exp_taylor(), DownhillSimplex< N, Precision >::find_next_point(), SO3< P >::generator(), SL< N, Precision >::generator(), SE2< P >::generator(), and SE3< P >::generator_field().
Operator<Internal::Identity<Internal::One> > 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;
Matrix<3> m_static = Identity; Matrix<> m_dynamic = Identity(3); //Construct a 3x3 matrix
Referenced by TooN::Internal::exp_taylor(), Cholesky< Size, Precision >::get_inverse(), and SO3< P >::SO3().