cheshirekow  v0.1.0
fiber Namespace Reference

simple template expression library for linear algebra More...

Namespaces

 cross_matrix
 
 euler
 

Classes

class  _CrossMatrix
 cross-product matrix of a vector More...
 
class  _Difference
 expression template for difference of two matrix expressions More...
 
class  _LValue
 expression template for rvalues More...
 
class  _Normalize
 Expression template presents a view of a matrix where each element is normalized, such that the sum of the elements is 1.0. More...
 
class  _RValue
 expression template for rvalues More...
 
class  _RView
 expression template for subset of a matrix expression More...
 
class  _Scale
 
class  _Sum
 expression template for sum of two matrix expressions More...
 
class  _Transpose
 expression template for difference of two matrix expressions More...
 
class  AxisAngle
 Encodes a rotation in 3-dimensions by an return RView<Scalar, Exp, rows, Exp::COLS>(static_cast<Exp const&>(A), i, 0);axis of rotation and an angle magnitude of rotation about that axis. More...
 
class  CoordinateAxis
 A 3x1 normal vector with one unity element. More...
 
class  CoordinateAxisAngle
 An axis angle rotation about a coordinate axis. More...
 
class  Eye
 A N x N matrix expression for the identity matrix. More...
 
class  LView
 expression template for subset of a matrix expression More...
 
class  Matrix
 
class  Quaternion
 
class  StreamAssignment
 assignment More...
 

Typedefs

typedef AxisAngle< double > AxisAngled
 
typedef AxisAngle< float > AxisAnglef
 
typedef CoordinateAxis< double, 0 > AxisXd
 
typedef CoordinateAxis< float, 0 > AxisXf
 
typedef CoordinateAxis< double, 1 > AxisYd
 
typedef CoordinateAxis< float, 1 > AxisYf
 
typedef CoordinateAxis< double, 2 > AxisZd
 
typedef CoordinateAxis< float, 2 > AxisZf
 
typedef CoordinateAxisAngle
< double, 0 > 
CoordinateAxisAngleXd
 
typedef CoordinateAxisAngle
< float, 0 > 
CoordinateAxisAngleXf
 
typedef CoordinateAxisAngle
< double, 1 > 
CoordinateAxisAngleYd
 
typedef CoordinateAxisAngle
< float, 1 > 
CoordinateAxisAngleYf
 
typedef CoordinateAxisAngle
< double, 2 > 
CoordinateAxisAngleZd
 
typedef CoordinateAxisAngle
< float, 2 > 
CoordinateAxisAngleZf
 
typedef Eye< double, 2 > Eye2d
 
typedef Eye< float, 2 > Eye2f
 
typedef Eye< double, 3 > Eye3d
 
typedef Eye< float, 3 > Eye3f
 
typedef Eye< double, 4 > Eye4d
 
typedef Eye< float, 4 > Eye4f
 
typedef int Index
 
typedef Matrix< double, 2, 2 > Matrix2d
 
typedef Matrix< float, 2, 2 > Matrix2f
 
typedef Matrix< double, 3, 3 > Matrix3d
 
typedef Matrix< float, 3, 3 > Matrix3f
 
typedef Matrix< double, 4, 4 > Matrix4d
 
typedef Matrix< float, 4, 4 > Matrix4f
 
typedef Quaternion< double > Quaterniond
 
typedef Quaternion< float > Quaternionf
 
typedef unsigned int Size
 
typedef Matrix< double, 2, 1 > Vector2d
 
typedef Matrix< float, 2, 1 > Vector2f
 
typedef Matrix< double, 3, 1 > Vector3d
 
typedef Matrix< float, 3, 1 > Vector3f
 
typedef Matrix< double, 4, 1 > Vector4d
 
typedef Matrix< float, 4, 1 > Vector4f
 

Functions

template<typename Scalar , class Exp >
void AxisAngleToQuaternion (const fiber::_RValue< Scalar, Exp > &axis, const Scalar angle, Quaternion< Scalar > *q)
 
template<typename Scalar >
void AxisAngleToQuaternion (const AxisAngle< Scalar > &axis_angle, Quaternion< Scalar > *q)
 
template<typename Scalar , class Exp >
void AxisAngleToRotationMatrix (const AxisAngle< Scalar > &axis_angle, _LValue< Scalar, Exp > *R)
 
template<int rows, int cols, typename Scalar , class Exp >
LView< Scalar, Exp, rows, cols > Block (_LValue< Scalar, Exp > &A, int i, int j)
 
template<typename Scalar , class Exp >
LView< Scalar, Exp, Exp::ROWS_, 1 > Column (_LValue< Scalar, Exp > &A, int j)
 
template<int cols, typename Scalar , class Exp >
LView< Scalar, Exp, Exp::ROWS_,
cols > 
Columns (_LValue< Scalar, Exp > &A, int j)
 
template<typename Scalar >
Quaternion< Scalar > Conjugate (Quaternion< Scalar > const &q)
 
template<typename Scalar , int Axis>
void CoordinateAxisAngleToQuaternion (const CoordinateAxisAngle< Scalar, Axis > &axis_angle, Quaternion< Scalar > *q)
 
template<typename Scalar , int Axis, class Exp >
void CoordinateAxisAngleToRotationMatrix (const CoordinateAxisAngle< Scalar, Axis > &axis_angle, _LValue< Scalar, Exp > *R)
 
template<typename Scalar , class Exp >
_CrossMatrix< Scalar, Exp > CrossMatrix (_RValue< Scalar, Exp > const &A)
 cross-product matrix of a vector More...
 
template<typename Scalar , class Exp1 , class Exp2 >
Scalar Dot (_RValue< Scalar, Exp1 > const &A, _RValue< Scalar, Exp2 > const &B)
 Dot product of two vectors. More...
 
template<typename Scalar , int Axis1, int Axis2, int Axis3>
void EulerAnglesToQuaternion (const euler::Angles< Scalar, Axis1, Axis2, Axis3 > &euler, Quaternion< Scalar > *q)
 
template<typename Scalar , class Exp >
_RView< Scalar, Exp,
Exp::ROWS_, 1 > 
GetColumn (_RValue< Scalar, Exp > const &A, int j)
 
template<int cols, typename Scalar , class Exp >
_RView< Scalar, Exp,
Exp::ROWS_, cols > 
GetColumns (_RValue< Scalar, Exp > const &A, int j)
 
template<typename Scalar , class Exp >
_RView< Scalar, Exp,
1, Exp::COLS_ > 
GetRow (_RValue< Scalar, Exp > const &A, int i)
 
template<int rows, typename Scalar , class Exp >
_RView< Scalar, Exp, rows,
Exp::COLS_ > 
GetRows (_RValue< Scalar, Exp > const &A, int i)
 
template<typename Scalar , class Exp >
_LValue< Scalar, Exp > & LValue (_LValue< Scalar, Exp > &exp)
 Explicitly expose _LValue of an expressions, can be used to help the compiler disambiguate overloads. More...
 
template<typename Scalar , class Exp >
Scalar Norm (_RValue< Scalar, Exp > const &A)
 Return the 2-norm of a vector. More...
 
template<typename Scalar , class Exp >
Scalar Norm (_RValue< Scalar, Exp > const &A, int n)
 Return the n-norm of a vector. More...
 
template<typename Scalar , class Exp >
_Normalize< Scalar, Exp > Normalize (_RValue< Scalar, Exp > const &A)
 Prresents a view of a matrix or vector where each element is normalized, such that the sum of the elements is 1.0. More...
 
template<typename Scalar , class Exp1 , class Exp2 >
Matrix< Scalar, Exp1::ROWS_,
Exp2::COLS_ > 
operator* (_RValue< Scalar, Exp1 > const &A, _RValue< Scalar, Exp2 > const &B)
 Matrix multiplication. More...
 
template<typename Scalar , class Exp >
_Scale< Scalar, Exp > operator* (Scalar s, _RValue< Scalar, Exp > const &A)
 
template<typename Scalar , class Exp >
_Scale< Scalar, Exp > operator* (_RValue< Scalar, Exp > const &A, Scalar s)
 
template<typename Scalar >
Quaternion< Scalar > operator* (Quaternion< Scalar > const &q_A, Quaternion< Scalar > const &q_B)
 We define quaternion multiplication as in Diebel. More...
 
template<typename Scalar , class Exp1 , class Exp2 >
_Sum< Scalar, Exp1, Exp2 > operator+ (_RValue< Scalar, Exp1 > const &A, _RValue< Scalar, Exp2 > const &B)
 
template<typename Scalar , class Exp1 , class Exp2 >
_Difference< Scalar, Exp1, Exp2 > operator- (_RValue< Scalar, Exp1 > const &A, _RValue< Scalar, Exp2 > const &B)
 
template<typename Scalar , class Mat >
std::ostream & operator<< (std::ostream &out, _RValue< Scalar, Mat > const &M)
 
template<typename Scalar , class Exp >
void QuaternionToAxisAngle (const Quaternion< Scalar > &q, fiber::_LValue< Scalar, Exp > *axis, Scalar *angle)
 
template<typename Scalar , class Exp >
void QuaternionToRotationMatrix (const Quaternion< Scalar > &q, fiber::_LValue< Scalar, Exp > *R)
 
template<typename Scalar , class Exp >
void RotationMatrixToQuaternion (const fiber::_RValue< Scalar, Exp > &R, Quaternion< Scalar > *q)
 
template<typename Scalar , class Exp >
LView< Scalar, Exp, 1, Exp::COLS_ > Row (_LValue< Scalar, Exp > &A, int i)
 
template<int rows, typename Scalar , class Exp >
LView< Scalar, Exp, rows,
Exp::COLS_ > 
Rows (_LValue< Scalar, Exp > &A, int i)
 
template<typename Scalar , class Exp >
const _RValue< Scalar, Exp > & RValue (const _RValue< Scalar, Exp > &exp)
 Explicitly expose _RValue of an expressions, can be used to help the compiler disambiguate overloads. More...
 
template<typename Scalar , class Exp >
Scalar SquaredNorm (_RValue< Scalar, Exp > const &A)
 Return the squared 2-norm of a vector. More...
 
template<typename Scalar , class Exp >
_Transpose< Scalar, Exp > Transpose (_RValue< Scalar, Exp > const &A)
 
template<int rows, int cols, typename Scalar , class Exp >
_RView< Scalar, Exp, rows, cols > View (_RValue< Scalar, Exp > const &A, Index i, Index j)
 

Detailed Description

simple template expression library for linear algebra

Typedef Documentation

typedef AxisAngle<double> fiber::AxisAngled

Definition at line 135 of file axis_angle.h.

typedef AxisAngle<float> fiber::AxisAnglef

Definition at line 136 of file axis_angle.h.

typedef CoordinateAxis<double,0> fiber::AxisXd

Definition at line 138 of file axis_angle.h.

typedef CoordinateAxis<float,0> fiber::AxisXf

Definition at line 142 of file axis_angle.h.

typedef CoordinateAxis<double,1> fiber::AxisYd

Definition at line 139 of file axis_angle.h.

typedef CoordinateAxis<float,1> fiber::AxisYf

Definition at line 143 of file axis_angle.h.

typedef CoordinateAxis<double,2> fiber::AxisZd

Definition at line 140 of file axis_angle.h.

typedef CoordinateAxis<float,2> fiber::AxisZf

Definition at line 144 of file axis_angle.h.

Definition at line 146 of file axis_angle.h.

Definition at line 150 of file axis_angle.h.

Definition at line 147 of file axis_angle.h.

Definition at line 151 of file axis_angle.h.

Definition at line 148 of file axis_angle.h.

Definition at line 152 of file axis_angle.h.

typedef Eye<double,2> fiber::Eye2d

Definition at line 60 of file identity.h.

typedef Eye<float,2> fiber::Eye2f

Definition at line 64 of file identity.h.

typedef Eye<double,3> fiber::Eye3d

Definition at line 61 of file identity.h.

typedef Eye<float,3> fiber::Eye3f

Definition at line 65 of file identity.h.

typedef Eye<double,4> fiber::Eye4d

Definition at line 62 of file identity.h.

typedef Eye<float,4> fiber::Eye4f

Definition at line 66 of file identity.h.

typedef int fiber::Index

Definition at line 31 of file fiber.h.

typedef Matrix<double,2,2> fiber::Matrix2d

Definition at line 140 of file matrix.h.

typedef Matrix<float,2,2> fiber::Matrix2f

Definition at line 148 of file matrix.h.

typedef Matrix<double,3,3> fiber::Matrix3d

Definition at line 141 of file matrix.h.

typedef Matrix<float,3,3> fiber::Matrix3f

Definition at line 149 of file matrix.h.

typedef Matrix<double,4,4> fiber::Matrix4d

Definition at line 142 of file matrix.h.

typedef Matrix<float,4,4> fiber::Matrix4f

Definition at line 150 of file matrix.h.

typedef Quaternion<double> fiber::Quaterniond

Definition at line 182 of file quaternion.h.

Definition at line 183 of file quaternion.h.

typedef unsigned int fiber::Size

Definition at line 32 of file fiber.h.

typedef Matrix<double,2,1> fiber::Vector2d

Definition at line 144 of file matrix.h.

typedef Matrix<float,2,1> fiber::Vector2f

Definition at line 152 of file matrix.h.

typedef Matrix<double,3,1> fiber::Vector3d

Definition at line 145 of file matrix.h.

typedef Matrix<float,3,1> fiber::Vector3f

Definition at line 153 of file matrix.h.

typedef Matrix<double,4,1> fiber::Vector4d

Definition at line 146 of file matrix.h.

typedef Matrix<float,4,1> fiber::Vector4f

Definition at line 154 of file matrix.h.

Function Documentation

template<typename Scalar , class Exp >
void fiber::AxisAngleToQuaternion ( const fiber::_RValue< Scalar, Exp > &  axis,
const Scalar  angle,
Quaternion< Scalar > *  q 
)

We follow the counter-clockwise right hand convention. For example, if r is a vector in the x-y plane and the axis of rotation is the z-axis, then | q * [0 r]' * q |(1-3) is a vector in the x-y plane corresponding to r rotated by the angle, theta, in the counter-clockwise direction.

Definition at line 50 of file rotation_conversions.h.

template<typename Scalar >
void fiber::AxisAngleToQuaternion ( const AxisAngle< Scalar > &  axis_angle,
Quaternion< Scalar > *  q 
)

We follow the counter-clockwise right hand convention. For example, if r is a vector in the x-y plane and the axis of rotation is the z-axis, then | q * [0 r]' * q |(1-3) is a vector in the x-y plane corresponding to r rotated by the angle, theta, in the counter-clockwise direction.

Definition at line 68 of file rotation_conversions.h.

template<typename Scalar , class Exp >
void fiber::AxisAngleToRotationMatrix ( const AxisAngle< Scalar > &  axis_angle,
_LValue< Scalar, Exp > *  R 
)

We follow the counter-clockwise right hand convention. For example, if r is a vector in the x-y plane and the axis of rotation is the z-axis, then R*r is a vector in the x-y plane corresponding to r rotated by the angle, theta, in the counter-clockwise direction.

Definition at line 80 of file rotation_conversions.h.

template<int rows, int cols, typename Scalar , class Exp >
LView<Scalar, Exp, rows, cols> fiber::Block ( _LValue< Scalar, Exp > &  A,
int  i,
int  j 
)
inline

Definition at line 161 of file view.h.

template<typename Scalar , class Exp >
LView<Scalar, Exp, Exp::ROWS_, 1> fiber::Column ( _LValue< Scalar, Exp > &  A,
int  j 
)
inline

Definition at line 178 of file view.h.

template<int cols, typename Scalar , class Exp >
LView<Scalar, Exp, Exp::ROWS_, cols> fiber::Columns ( _LValue< Scalar, Exp > &  A,
int  j 
)
inline

Definition at line 184 of file view.h.

template<typename Scalar >
Quaternion<Scalar> fiber::Conjugate ( Quaternion< Scalar > const &  q)
inline

Definition at line 150 of file quaternion.h.

template<typename Scalar , int Axis>
void fiber::CoordinateAxisAngleToQuaternion ( const CoordinateAxisAngle< Scalar, Axis > &  axis_angle,
Quaternion< Scalar > *  q 
)

We follow the counter-clockwise right hand convention. For example, if r is a vector in the x-y plane and the axis of rotation is the z-axis, then | q * [0 r]' * q |(1-3) is a vector in the x-y plane corresponding to r rotated by the angle, theta, in the counter-clockwise direction.

Definition at line 97 of file rotation_conversions.h.

template<typename Scalar , int Axis, class Exp >
void fiber::CoordinateAxisAngleToRotationMatrix ( const CoordinateAxisAngle< Scalar, Axis > &  axis_angle,
_LValue< Scalar, Exp > *  R 
)

We follow the counter-clockwise right hand convention. For example, if r is a vector in the x-y plane and the axis of rotation is the z-axis, then R*r is a vector in the x-y plane corresponding to r rotated by the angle, theta, in the counter-clockwise direction.

Definition at line 116 of file rotation_conversions.h.

template<typename Scalar , class Exp >
_CrossMatrix<Scalar, Exp> fiber::CrossMatrix ( _RValue< Scalar, Exp > const &  A)
inline

cross-product matrix of a vector

Given a vector v, the CrossMatrix of v is the skew symmetric 3x3 matrix given by: | 0 -v[2] v[1] | | v[2] 0 -v[0] | | -v[1] v[0] 0 |

Definition at line 101 of file cross_matrix.h.

template<typename Scalar , class Exp1 , class Exp2 >
Scalar fiber::Dot ( _RValue< Scalar, Exp1 > const &  A,
_RValue< Scalar, Exp2 > const &  B 
)
inline

Dot product of two vectors.

Definition at line 50 of file product.h.

template<typename Scalar , int Axis1, int Axis2, int Axis3>
void fiber::EulerAnglesToQuaternion ( const euler::Angles< Scalar, Axis1, Axis2, Axis3 > &  euler,
Quaternion< Scalar > *  q 
)

Definition at line 305 of file rotation_conversions.h.

template<typename Scalar , class Exp >
_RView<Scalar, Exp, Exp::ROWS_, 1> fiber::GetColumn ( _RValue< Scalar, Exp > const &  A,
int  j 
)
inline

Definition at line 89 of file view.h.

template<int cols, typename Scalar , class Exp >
_RView<Scalar, Exp, Exp::ROWS_, cols> fiber::GetColumns ( _RValue< Scalar, Exp > const &  A,
int  j 
)
inline

Definition at line 95 of file view.h.

template<typename Scalar , class Exp >
_RView<Scalar, Exp, 1, Exp::COLS_> fiber::GetRow ( _RValue< Scalar, Exp > const &  A,
int  i 
)
inline

Definition at line 76 of file view.h.

template<int rows, typename Scalar , class Exp >
_RView<Scalar, Exp, rows, Exp::COLS_> fiber::GetRows ( _RValue< Scalar, Exp > const &  A,
int  i 
)
inline

Definition at line 82 of file view.h.

template<typename Scalar , class Exp >
_LValue<Scalar, Exp>& fiber::LValue ( _LValue< Scalar, Exp > &  exp)

Explicitly expose _LValue of an expressions, can be used to help the compiler disambiguate overloads.

Definition at line 77 of file lvalue.h.

template<typename Scalar , class Exp >
Scalar fiber::Norm ( _RValue< Scalar, Exp > const &  A)
inline

Return the 2-norm of a vector.

Definition at line 41 of file normalize.h.

template<typename Scalar , class Exp >
Scalar fiber::Norm ( _RValue< Scalar, Exp > const &  A,
int  n 
)
inline

Return the n-norm of a vector.

Definition at line 47 of file normalize.h.

template<typename Scalar , class Exp >
_Normalize<Scalar, Exp> fiber::Normalize ( _RValue< Scalar, Exp > const &  A)
inline

Prresents a view of a matrix or vector where each element is normalized, such that the sum of the elements is 1.0.

Definition at line 87 of file normalize.h.

template<typename Scalar , class Exp1 , class Exp2 >
Matrix<Scalar, Exp1::ROWS_, Exp2::COLS_> fiber::operator* ( _RValue< Scalar, Exp1 > const &  A,
_RValue< Scalar, Exp2 > const &  B 
)
inline

Matrix multiplication.

Definition at line 34 of file product.h.

template<typename Scalar , class Exp >
_Scale<Scalar, Exp> fiber::operator* ( Scalar  s,
_RValue< Scalar, Exp > const &  A 
)
inline

Definition at line 54 of file scale.h.

template<typename Scalar , class Exp >
_Scale<Scalar, Exp> fiber::operator* ( _RValue< Scalar, Exp > const &  A,
Scalar  s 
)
inline

Definition at line 59 of file scale.h.

template<typename Scalar >
Quaternion<Scalar> fiber::operator* ( Quaternion< Scalar > const &  q_A,
Quaternion< Scalar > const &  q_B 
)
inline

We define quaternion multiplication as in Diebel.

The quaternion multiplication q*p is equivalent to the matrix left-multiply of Q(q)*p where Q(q) =

*   | q0 -q1 -q2 -q3 |
*   | q1  q0 -q3  q2 |
*   | q2  q3  q0 -q1 |
*   | q3 -q2  q1  q0 |
*

Definition at line 166 of file quaternion.h.

template<typename Scalar , class Exp1 , class Exp2 >
_Sum<Scalar, Exp1, Exp2> fiber::operator+ ( _RValue< Scalar, Exp1 > const &  A,
_RValue< Scalar, Exp2 > const &  B 
)
inline

Definition at line 65 of file sum.h.

template<typename Scalar , class Exp1 , class Exp2 >
_Difference<Scalar, Exp1, Exp2> fiber::operator- ( _RValue< Scalar, Exp1 > const &  A,
_RValue< Scalar, Exp2 > const &  B 
)
inline

Definition at line 65 of file difference.h.

template<typename Scalar , class Mat >
std::ostream& fiber::operator<< ( std::ostream &  out,
_RValue< Scalar, Mat > const &  M 
)

Definition at line 37 of file ostream.h.

template<typename Scalar , class Exp >
void fiber::QuaternionToAxisAngle ( const Quaternion< Scalar > &  q,
fiber::_LValue< Scalar, Exp > *  axis,
Scalar *  angle 
)

TODO(bialkowski): need scalar traits to determine this threshold

Definition at line 137 of file rotation_conversions.h.

template<typename Scalar , class Exp >
void fiber::QuaternionToRotationMatrix ( const Quaternion< Scalar > &  q,
fiber::_LValue< Scalar, Exp > *  R 
)

Definition at line 152 of file rotation_conversions.h.

template<typename Scalar , class Exp >
void fiber::RotationMatrixToQuaternion ( const fiber::_RValue< Scalar, Exp > &  R,
Quaternion< Scalar > *  q 
)

Definition at line 172 of file rotation_conversions.h.

template<typename Scalar , class Exp >
LView<Scalar, Exp, 1, Exp::COLS_> fiber::Row ( _LValue< Scalar, Exp > &  A,
int  i 
)
inline

Definition at line 167 of file view.h.

template<int rows, typename Scalar , class Exp >
LView<Scalar, Exp, rows, Exp::COLS_> fiber::Rows ( _LValue< Scalar, Exp > &  A,
int  i 
)
inline

Definition at line 172 of file view.h.

template<typename Scalar , class Exp >
const _RValue<Scalar, Exp>& fiber::RValue ( const _RValue< Scalar, Exp > &  exp)

Explicitly expose _RValue of an expressions, can be used to help the compiler disambiguate overloads.

Definition at line 51 of file rvalue.h.

template<typename Scalar , class Exp >
Scalar fiber::SquaredNorm ( _RValue< Scalar, Exp > const &  A)
inline

Return the squared 2-norm of a vector.

Definition at line 35 of file normalize.h.

template<typename Scalar , class Exp >
_Transpose<Scalar, Exp> fiber::Transpose ( _RValue< Scalar, Exp > const &  A)
inline

Definition at line 54 of file transpose.h.

template<int rows, int cols, typename Scalar , class Exp >
_RView<Scalar, Exp, rows, cols> fiber::View ( _RValue< Scalar, Exp > const &  A,
Index  i,
Index  j 
)
inline

Definition at line 70 of file view.h.