sofa::defaulttype Namespace Reference
[sofa-framework package]

Default data types for the most common cases (1D/2D/3D vectors, rigid frames). More...


Data Structures

class  BaseMatrix
 Generic matrix API, allowing to fill and use a matrix independently of the linear algebra library in use. More...
class  BaseVector
 Generic vector API, allowing to fill and use a vector independently of the linear algebra library in use. More...
class  DataTypeInfo
class  DataTypeInfo< double >
class  DataTypeInfo< float >
class  Frame
 The affine transformation of points and vectors from a coordinate system (the local frame) to another (the reference frame). More...
class  LaparoscopicRigid3Types
class  DataTypeInfo< LaparoscopicRigidTypes::Coord >
class  DataTypeInfo< LaparoscopicRigidTypes::Deriv >
class  Mat
class  MatNoInit
 Same as Mat except the values are not initialized by default. More...
class  RigidDeriv< 3, real >
 Degrees of freedom of 3D rigid bodies. More...
class  RigidCoord< 3, real >
class  RigidMass< 3, real >
class  StdRigidTypes< 3, real >
class  RigidDeriv< 2, real >
class  RigidCoord< 2, real >
class  RigidMass< 2, real >
class  StdRigidTypes< 2, real >
 Degrees of freedom of 2D rigid bodies. More...
class  SolidTypes
 Base types for the ArticulatedSolid: position, orientation, velocity, angular velocity, etc. More...
class  Vec
class  VecNoInit
 Same as Vec except the values are not initialized by default. More...
class  StdVectorTypes
class  ExtVectorAllocator
 Custom vector allocator class allowing data to be allocated at a specific location (such as for transmission through DMA, PCI-Express, Shared Memory, Network). More...
class  ExtVector
 Custom vector class. More...
class  DefaultAllocator
class  ResizableExtVector
 Resizable custom vector class using DefaultAllocator. More...
class  ExtVectorTypes

Typedefs

typedef LaparoscopicRigid3Types LaparoscopicRigidTypes
 Alias.
typedef Mat< 2, 2, float > Mat2x2f
typedef Mat< 2, 2, double > Mat2x2d
typedef Mat< 3, 3, float > Mat3x3f
typedef Mat< 3, 3, double > Mat3x3d
typedef Mat< 3, 4, float > Mat3x4f
typedef Mat< 3, 4, double > Mat3x4d
typedef Mat< 4, 4, float > Mat4x4f
typedef Mat< 4, 4, double > Mat4x4d
typedef Mat2x2d Matrix2
typedef Mat3x3d Matrix3
typedef Mat4x4d Matrix4
typedef helper::Quater< double > Quatd
 alias
typedef helper::Quater< float > Quatf
 alias
typedef Quatd Quat
 alias
typedef Quat Quaternion
 alias
typedef StdRigidTypes< 3, double > Rigid3dTypes
typedef StdRigidTypes< 3, float > Rigid3fTypes
typedef RigidMass< 3, double > Rigid3dMass
typedef RigidMass< 3, float > Rigid3fMass
typedef Rigid3dTypes Rigid3Types
typedef Rigid3dMass Rigid3Mass
typedef Rigid3Types RigidTypes
typedef StdRigidTypes< 2, double > Rigid2dTypes
typedef StdRigidTypes< 2, float > Rigid2fTypes
typedef RigidMass< 2, double > Rigid2dMass
typedef RigidMass< 2, float > Rigid2fMass
typedef Rigid2dTypes Rigid2Types
typedef Rigid2dMass Rigid2Mass
typedef Vec< 1, float > Vec1f
typedef Vec< 1, double > Vec1d
typedef Vec< 2, float > Vec2f
typedef Vec< 2, double > Vec2d
typedef Vec< 3, float > Vec3f
typedef Vec< 3, double > Vec3d
typedef Vec< 4, float > Vec4f
typedef Vec< 4, double > Vec4d
typedef Vec< 6, float > Vec6f
typedef Vec< 6, double > Vec6d
typedef Vec1d Vector1
 alias
typedef Vec2d Vector2
 alias
typedef Vec3d Vector3
 alias
typedef Vec4d Vector4
 alias
typedef Vec6d Vector6
 alias
typedef StdVectorTypes< Vec3d,
Vec3d, double > 
Vec3dTypes
 3D DOFs, double precision
typedef StdVectorTypes< Vec3f,
Vec3f, float > 
Vec3fTypes
 3D DOFs, single precision
typedef ExtVectorTypes< Vec3d,
Vec3d, double > 
ExtVec3dTypes
 3D external DOFs, double precision
typedef ExtVectorTypes< Vec3f,
Vec3f, float > 
ExtVec3fTypes
 3D external DOFs, single precision
typedef StdVectorTypes< Vec2d,
Vec2d, double > 
Vec2dTypes
 2D DOFs, double precision
typedef StdVectorTypes< Vec2f,
Vec2f, float > 
Vec2fTypes
 2D DOFs, single precision
typedef ExtVectorTypes< Vec2d,
Vec2d, double > 
ExtVec2dTypes
 2D external DOFs, double precision
typedef ExtVectorTypes< Vec2f,
Vec2f, float > 
ExtVec2fTypes
 2D external DOFs, single precision
typedef StdVectorTypes< Vec1d,
Vec1d, double > 
Vec1dTypes
 1D DOFs, double precision
typedef StdVectorTypes< Vec1f,
Vec1f, float > 
Vec1fTypes
 1D DOFs, single precision
typedef ExtVectorTypes< Vec1d,
Vec1d, double > 
ExtVec1dTypes
 1D external DOFs, double precision
typedef ExtVectorTypes< Vec1f,
Vec1f, float > 
ExtVec1fTypes
 1D external DOFs, single precision
typedef StdVectorTypes< Vec6d,
Vec6d, double > 
Vec6dTypes
 6D DOFs, double precision
typedef StdVectorTypes< Vec6f,
Vec6f, float > 
Vec6fTypes
 6D DOFs, single precision
typedef ExtVectorTypes< Vec6d,
Vec6d, double > 
ExtVec6dTypes
 6D external DOFs, double precision
typedef ExtVectorTypes< Vec6f,
Vec6f, float > 
ExtVec6fTypes
 6D external DOFs, single precision
typedef Vec6dTypes Vec6Types
 6D DOFs, double precision (default)
typedef Vec3dTypes Vec3Types
 3D DOFs, double precision (default)
typedef Vec2dTypes Vec2Types
 2D DOFs, double precision (default)
typedef Vec1dTypes Vec1Types
 1D DOFs, double precision (default)
typedef ExtVec6dTypes ExtVec6Types
 6D external DOFs, double precision (default)
typedef ExtVec3dTypes ExtVec3Types
 3D external DOFs, double precision (default)
typedef ExtVec2dTypes ExtVec2Types
 2D external DOFs, double precision (default)
typedef ExtVec1dTypes ExtVec1Types
 1D external DOFs, double precision (default)

Enumerations

enum  NoInit { NOINIT }

Functions

std::ostream & operator<< (std::ostream &out, const sofa::defaulttype::Frame &c)
LaparoscopicRigid3Types::Deriv operator* (const LaparoscopicRigid3Types::Deriv &d, const Rigid3Mass &m)
LaparoscopicRigid3Types::Deriv operator/ (const LaparoscopicRigid3Types::Deriv &d, const Rigid3Mass &m)
template<class real >
real determinant (const Mat< 3, 3, real > &m)
 Determinant of a 3x3 matrix.
template<class real >
real determinant (const Mat< 2, 2, real > &m)
 Determinant of a 2x2 matrix.
template<int S, class real >
bool invertMatrix (Mat< S, S, real > &dest, const Mat< S, S, real > &from)
 Matrix inversion (general case).
template<class real >
bool invertMatrix (Mat< 3, 3, real > &dest, const Mat< 3, 3, real > &from)
 Matrix inversion (special case 3x3).
template<class real >
bool invertMatrix (Mat< 2, 2, real > &dest, const Mat< 2, 2, real > &from)
 Matrix inversion (special case 2x2).
template<int L, int C, typename real >
std::ostream & operator<< (std::ostream &o, const Mat< L, C, real > &m)
template<int L, int C, typename real >
std::istream & operator>> (std::istream &in, sofa::defaulttype::Mat< L, C, real > &m)
template<class T1 , class T2 >
const T1 S_MAX (const T1 &a, const T2 &b)
 return the max of two values
template<class T1 , class T2 >
const T1 S_MIN (const T1 &a, const T2 &b)
 return the min of two values
template<class T1 , class T2 >
const T1 S_SIGN (const T1 &a, const T2 &b)
template<class T >
const T S_SQR (const T a)
template<class T1 , class T2 >
T1 pythag (const T1 a, const T2 b)
 Computes sqrt(aČ + bČ) without destructive underflow or overflow.
template<int m, int n, typename Real >
void svddcmp (Mat< m, n, Real > &a, Vec< n, Real > &w, Mat< n, m, Real > &v)
 Compute the SVD decomposition of matrix a (from nr). a is replaced by its pivoted LU decomposition. indx stores pivoting indices.
template<int m, int n, typename Real >
Real cond (Mat< m, n, Real > &a)
 return the condition number of the matrix a following the euclidian norm (using the svd decomposition to find singular values)
template<int n, typename Real >
void ludcmp (Mat< n, n, Real > &a, Vec< n, int > &indx)
 Compute the LU decomposition of matrix a. a is replaced by its pivoted LU decomposition. indx stores pivoting indices.
template<int n, typename Real >
void lubksb (const Mat< n, n, Real > &a, const Vec< n, int > &indx, Vec< n, Real > &b)
 Compute the solution of Mx=b. b is replaced by x. a and indx together represent the LU decomposition of m, as given my method ludcmp.
template<int n, typename Real >
void luinv (Mat< n, n, Real > &inv, Mat< n, n, Real > &m)
 Compute the inverse of matrix m.
template<int L, int C, typename T >
Mat< L, C, T > dyad (const Vec< L, T > &u, const Vec< C, T > &v)
 Create a matrix as $ u v^T $.
template<int N, typename real >
RigidDeriv< N, real > operator* (const RigidDeriv< N, real > &d, const RigidMass< N, real > &m)
template<int N, typename real >
RigidDeriv< N, real > operator/ (const RigidDeriv< N, real > &d, const RigidMass< N, real > &m)
template<int N, typename Real >
std::istream & operator>> (std::istream &in, Vec< N, Real > &v)
 Read from an input stream.
template<int N, typename Real >
std::ostream & operator<< (std::ostream &out, const Vec< N, Real > &v)
 Write to an output stream.
template<typename real >
Vec< 3, real > cross (const Vec< 3, real > &a, const Vec< 3, real > &b)
 Cross product for 3-elements vectors.
template<typename real >
real cross (const defaulttype::Vec< 2, real > &a, const defaulttype::Vec< 2, real > &b)
 Cross product for 2-elements vectors.
template<int N, typename real >
real dot (const Vec< N, real > &a, const Vec< N, real > &b)
 Dot product (alias for operator*).


Detailed Description

Default data types for the most common cases (1D/2D/3D vectors, rigid frames).

Users can define other types, but it is best to try to use these when applicable, as many components are already instanciated with them. It is however not a requirement (nothing prevents a user to define his own Vec3 class for instance).


Typedef Documentation

1D external DOFs, double precision

Definition at line 418 of file VecTypes.h.

1D external DOFs, single precision

Definition at line 420 of file VecTypes.h.

1D external DOFs, double precision (default)

Definition at line 478 of file VecTypes.h.

2D external DOFs, double precision

Definition at line 398 of file VecTypes.h.

2D external DOFs, single precision

Definition at line 400 of file VecTypes.h.

2D external DOFs, double precision (default)

Definition at line 476 of file VecTypes.h.

3D external DOFs, double precision

Definition at line 378 of file VecTypes.h.

3D external DOFs, single precision

Definition at line 380 of file VecTypes.h.

3D external DOFs, double precision (default)

Definition at line 474 of file VecTypes.h.

6D external DOFs, double precision

Definition at line 438 of file VecTypes.h.

6D external DOFs, single precision

Definition at line 440 of file VecTypes.h.

6D external DOFs, double precision (default)

Definition at line 472 of file VecTypes.h.

Alias.

Definition at line 339 of file LaparoscopicRigidTypes.h.

typedef Mat<2,2,double> sofa::defaulttype::Mat2x2d

Definition at line 642 of file Mat.h.

typedef Mat<2,2,float> sofa::defaulttype::Mat2x2f

Definition at line 641 of file Mat.h.

typedef Mat<3,3,double> sofa::defaulttype::Mat3x3d

Definition at line 645 of file Mat.h.

typedef Mat<3,3,float> sofa::defaulttype::Mat3x3f

Definition at line 644 of file Mat.h.

typedef Mat<3,4,double> sofa::defaulttype::Mat3x4d

Definition at line 648 of file Mat.h.

typedef Mat<3,4,float> sofa::defaulttype::Mat3x4f

Definition at line 647 of file Mat.h.

typedef Mat<4,4,double> sofa::defaulttype::Mat4x4d

Definition at line 651 of file Mat.h.

typedef Mat<4,4,float> sofa::defaulttype::Mat4x4f

Definition at line 650 of file Mat.h.

Definition at line 658 of file Mat.h.

Definition at line 659 of file Mat.h.

Definition at line 660 of file Mat.h.

alias

Definition at line 42 of file Quat.h.

alias

Definition at line 37 of file Quat.h.

alias

Definition at line 44 of file Quat.h.

alias

Definition at line 38 of file Quat.h.

typedef RigidMass<2,double> sofa::defaulttype::Rigid2dMass

Definition at line 1185 of file RigidTypes.h.

typedef StdRigidTypes<2,double> sofa::defaulttype::Rigid2dTypes

Definition at line 1182 of file RigidTypes.h.

typedef RigidMass<2,float> sofa::defaulttype::Rigid2fMass

Definition at line 1186 of file RigidTypes.h.

typedef StdRigidTypes<2,float> sofa::defaulttype::Rigid2fTypes

Definition at line 1183 of file RigidTypes.h.

Definition at line 1196 of file RigidTypes.h.

Definition at line 1195 of file RigidTypes.h.

typedef RigidMass<3,double> sofa::defaulttype::Rigid3dMass

Definition at line 648 of file RigidTypes.h.

typedef StdRigidTypes<3,double> sofa::defaulttype::Rigid3dTypes

Definition at line 645 of file RigidTypes.h.

typedef RigidMass<3,float> sofa::defaulttype::Rigid3fMass

Definition at line 649 of file RigidTypes.h.

typedef StdRigidTypes<3,float> sofa::defaulttype::Rigid3fTypes

Definition at line 646 of file RigidTypes.h.

Definition at line 666 of file RigidTypes.h.

Definition at line 665 of file RigidTypes.h.

Definition at line 668 of file RigidTypes.h.

typedef Vec<1,double> sofa::defaulttype::Vec1d

Definition at line 551 of file Vec.h.

1D DOFs, double precision

Definition at line 410 of file VecTypes.h.

typedef Vec<1,float> sofa::defaulttype::Vec1f

Definition at line 550 of file Vec.h.

1D DOFs, single precision

Definition at line 412 of file VecTypes.h.

1D DOFs, double precision (default)

Definition at line 470 of file VecTypes.h.

typedef Vec<2,double> sofa::defaulttype::Vec2d

Definition at line 555 of file Vec.h.

2D DOFs, double precision

Definition at line 390 of file VecTypes.h.

typedef Vec<2,float> sofa::defaulttype::Vec2f

Definition at line 554 of file Vec.h.

2D DOFs, single precision

Definition at line 392 of file VecTypes.h.

2D DOFs, double precision (default)

Definition at line 468 of file VecTypes.h.

typedef Vec<3,double> sofa::defaulttype::Vec3d

Definition at line 559 of file Vec.h.

3D DOFs, double precision

Definition at line 370 of file VecTypes.h.

typedef Vec<3,float> sofa::defaulttype::Vec3f

Definition at line 558 of file Vec.h.

3D DOFs, single precision

Definition at line 372 of file VecTypes.h.

3D DOFs, double precision (default)

Definition at line 466 of file VecTypes.h.

typedef Vec<4,double> sofa::defaulttype::Vec4d

Definition at line 563 of file Vec.h.

typedef Vec<4,float> sofa::defaulttype::Vec4f

Definition at line 562 of file Vec.h.

typedef Vec<6,double> sofa::defaulttype::Vec6d

Definition at line 567 of file Vec.h.

6D DOFs, double precision

Definition at line 430 of file VecTypes.h.

typedef Vec<6,float> sofa::defaulttype::Vec6f

Definition at line 566 of file Vec.h.

6D DOFs, single precision

Definition at line 432 of file VecTypes.h.

6D DOFs, double precision (default)

Definition at line 464 of file VecTypes.h.

alias

Definition at line 577 of file Vec.h.

alias

Definition at line 578 of file Vec.h.

alias

Definition at line 579 of file Vec.h.

alias

Definition at line 580 of file Vec.h.

alias

Definition at line 581 of file Vec.h.


Enumeration Type Documentation

Enumerator:
NOINIT 

Definition at line 44 of file Vec.h.


Function Documentation

template<int m, int n, typename Real >
Real sofa::defaulttype::cond ( Mat< m, n, Real > &  a  )  [inline]

return the condition number of the matrix a following the euclidian norm (using the svd decomposition to find singular values)

Definition at line 934 of file Mat.h.

References svddcmp().

template<typename real >
real sofa::defaulttype::cross ( const defaulttype::Vec< 2, real > &  a,
const defaulttype::Vec< 2, real > &  b 
) [inline]

Cross product for 2-elements vectors.

Definition at line 538 of file Vec.h.

template<typename real >
Vec<3,real> sofa::defaulttype::cross ( const Vec< 3, real > &  a,
const Vec< 3, real > &  b 
) [inline]

template<class real >
real sofa::defaulttype::determinant ( const Mat< 2, 2, real > &  m  )  [inline]

template<class real >
real sofa::defaulttype::determinant ( const Mat< 3, 3, real > &  m  )  [inline]

Determinant of a 3x3 matrix.

Definition at line 516 of file Mat.h.

Referenced by invertMatrix().

template<int N, typename real >
real sofa::defaulttype::dot ( const Vec< N, real > &  a,
const Vec< N, real > &  b 
) [inline]

Dot product (alias for operator*).

Definition at line 545 of file Vec.h.

template<int L, int C, typename T >
Mat<L,C,T> sofa::defaulttype::dyad ( const Vec< L, T > &  u,
const Vec< C, T > &  v 
) [inline]

Create a matrix as $ u v^T $.

Definition at line 1043 of file Mat.h.

References NOINIT.

template<class real >
bool sofa::defaulttype::invertMatrix ( Mat< 2, 2, real > &  dest,
const Mat< 2, 2, real > &  from 
) [inline]

template<class real >
bool sofa::defaulttype::invertMatrix ( Mat< 3, 3, real > &  dest,
const Mat< 3, 3, real > &  from 
) [inline]

Matrix inversion (special case 3x3).

Definition at line 604 of file Mat.h.

References determinant(), and real.

template<int S, class real >
bool sofa::defaulttype::invertMatrix ( Mat< S, S, real > &  dest,
const Mat< S, S, real > &  from 
) [inline]

Matrix inversion (general case).

Definition at line 536 of file Mat.h.

References sofa::defaulttype::Mat< L, C, real >::identity(), and real.

Referenced by sofa::defaulttype::Mat< 6, 6, Coord::value_type >::invert().

template<int n, typename Real >
void sofa::defaulttype::lubksb ( const Mat< n, n, Real > &  a,
const Vec< n, int > &  indx,
Vec< n, Real > &  b 
) [inline]

Compute the solution of Mx=b. b is replaced by x. a and indx together represent the LU decomposition of m, as given my method ludcmp.

Definition at line 998 of file Mat.h.

Referenced by luinv().

template<int n, typename Real >
void sofa::defaulttype::ludcmp ( Mat< n, n, Real > &  a,
Vec< n, int > &  indx 
) [inline]

Compute the LU decomposition of matrix a. a is replaced by its pivoted LU decomposition. indx stores pivoting indices.

Definition at line 949 of file Mat.h.

Referenced by luinv().

template<int n, typename Real >
void sofa::defaulttype::luinv ( Mat< n, n, Real > &  inv,
Mat< n, n, Real > &  m 
) [inline]

Compute the inverse of matrix m.

Warning:
Matrix m is replaced by its LU decomposition.

Definition at line 1024 of file Mat.h.

References lubksb(), and ludcmp().

template<int N, typename real >
RigidDeriv<N,real> sofa::defaulttype::operator* ( const RigidDeriv< N, real > &  d,
const RigidMass< N, real > &  m 
) [inline]

Definition at line 492 of file RigidTypes.h.

LaparoscopicRigid3Types::Deriv sofa::defaulttype::operator* ( const LaparoscopicRigid3Types::Deriv &  d,
const Rigid3Mass &  m 
) [inline]

template<int N, typename real >
RigidDeriv<N, real> sofa::defaulttype::operator/ ( const RigidDeriv< N, real > &  d,
const RigidMass< N, real > &  m 
) [inline]

Definition at line 501 of file RigidTypes.h.

LaparoscopicRigid3Types::Deriv sofa::defaulttype::operator/ ( const LaparoscopicRigid3Types::Deriv &  d,
const Rigid3Mass &  m 
) [inline]

template<int N, typename Real >
std::ostream& sofa::defaulttype::operator<< ( std::ostream &  out,
const Vec< N, Real > &  v 
) [inline]

Write to an output stream.

Definition at line 519 of file Vec.h.

template<int L, int C, typename real >
std::ostream& sofa::defaulttype::operator<< ( std::ostream &  o,
const Mat< L, C, real > &  m 
) [inline]

Definition at line 665 of file Mat.h.

std::ostream& sofa::defaulttype::operator<< ( std::ostream &  out,
const sofa::defaulttype::Frame &  c 
)

template<int N, typename Real >
std::istream& sofa::defaulttype::operator>> ( std::istream &  in,
Vec< N, Real > &  v 
) [inline]

Read from an input stream.

Definition at line 510 of file Vec.h.

template<int L, int C, typename real >
std::istream& sofa::defaulttype::operator>> ( std::istream &  in,
sofa::defaulttype::Mat< L, C, real > &  m 
) [inline]

Definition at line 675 of file Mat.h.

template<class T1 , class T2 >
T1 sofa::defaulttype::pythag ( const T1  a,
const T2  b 
) [inline]

Computes sqrt(aČ + bČ) without destructive underflow or overflow.

Definition at line 733 of file Mat.h.

References SQR.

Referenced by svddcmp().

template<class T1 , class T2 >
const T1 sofa::defaulttype::S_MAX ( const T1 &  a,
const T2 &  b 
) [inline]

return the max of two values

Definition at line 707 of file Mat.h.

Referenced by svddcmp().

template<class T1 , class T2 >
const T1 sofa::defaulttype::S_MIN ( const T1 &  a,
const T2 &  b 
) [inline]

return the min of two values

Definition at line 714 of file Mat.h.

Referenced by svddcmp().

template<class T1 , class T2 >
const T1 sofa::defaulttype::S_SIGN ( const T1 &  a,
const T2 &  b 
) [inline]

Definition at line 720 of file Mat.h.

Referenced by svddcmp().

template<class T >
const T sofa::defaulttype::S_SQR ( const T  a  )  [inline]

Definition at line 726 of file Mat.h.

template<int m, int n, typename Real >
void sofa::defaulttype::svddcmp ( Mat< m, n, Real > &  a,
Vec< n, Real > &  w,
Mat< n, m, Real > &  v 
) [inline]

Compute the SVD decomposition of matrix a (from nr). a is replaced by its pivoted LU decomposition. indx stores pivoting indices.

SVD decomposition a = u.w.vt

Precondition:
a: original matrix, destroyed to become u

w: diagonal vector

v: matrix

Definition at line 748 of file Mat.h.

References pythag(), S_MAX(), S_MIN(), and S_SIGN().

Referenced by cond().


Generated on Sun Nov 23 04:23:50 2008 for Sofa by  doxygen 1.5.7.1