SOFA API  8225a6f5
Open source framework for multi-physics simuation
sofa::type Namespace Reference

for std::pair More...

Namespaces

 pairwise
 
 trait
 

Classes

class  BoundingBox
 
class  BoundingBox1D
 bounding interval More...
 
class  BoundingBox2D
 bounding rectangle More...
 
struct  CleanupCheck
 
class  CPUMemoryManager
 
class  DualQuatCoord3
 
class  fixed_array
 
class  Frame
 
struct  HasRebindTypedef
 
struct  HasRebindTypedef< T, OtherType, std::void_t< typename T::template rebind_to< OtherType > > >
 
class  Mat
 
class  Material
 
class  MatNoInit
 Same as Mat except the values are not initialized by default. More...
 
class  MatSym
 
struct  NoInit
 
class  PrimitiveGroup
 
class  Quat
 
class  Ray
 
struct  Rebind
 
struct  Rebind< _T, _OtherType, std::enable_if_t< HasRebindTypedef< _T, _OtherType >::value > >
 Specialization for types that do have a nested rebind_to member. In this implementation, Rebind has a public member typedef to. It corresponds to the typedef rebind_to. More...
 
struct  Rebind< _T, _OtherType, std::enable_if_t<!HasRebindTypedef< _T, _OtherType >::value > >
 Specialization for types that do NOT have a nested rebind_to member. In this implementation, Rebind has no public member typedef to. If this implementation is chosen by the compiler (the number of template parameters is probably different from 1), a compilation error occurs. More...
 
struct  Rebind< _T< A >, _OtherType, std::enable_if_t<!HasRebindTypedef< _T< A >, _OtherType >::value > >
 Specialization for types that do NOT have a nested rebind_to member. In this implementation, Rebind has a public member typedef to. More...
 
class  RGBAColor
 encode a 4 RGBA component color More...
 
class  SVector
 Same as type::vector, + delimitors on serialization. More...
 
class  TBoundingBox
 
class  Vec
 
class  VecNoInit
 Same as Vec except the values are not initialized by default. More...
 
class  vector
 
class  vector_device
 

Typedefs

typedef Vec< 1, floatVec1f
 
typedef Vec< 1, doubleVec1d
 
typedef Vec< 1, intVec1i
 
typedef Vec< 1, unsigned > Vec1u
 
typedef Vec< 1, SRealVec1
 
typedef Vec< 2, floatVec2f
 
typedef Vec< 2, doubleVec2d
 
typedef Vec< 2, intVec2i
 
typedef Vec< 2, unsigned > Vec2u
 
typedef Vec< 2, SRealVec2
 
typedef Vec< 3, floatVec3f
 
typedef Vec< 3, doubleVec3d
 
typedef Vec< 3, intVec3i
 
typedef Vec< 3, unsigned > Vec3u
 
typedef Vec< 3, SRealVec3
 
typedef Vec< 4, floatVec4f
 
typedef Vec< 4, doubleVec4d
 
typedef Vec< 4, intVec4i
 
typedef Vec< 4, unsigned > Vec4u
 
typedef Vec< 4, SRealVec4
 
typedef Vec< 6, floatVec6f
 
typedef Vec< 6, doubleVec6d
 
typedef Vec< 6, intVec6i
 
typedef Vec< 6, unsigned > Vec6u
 
typedef Vec< 6, SRealVec6
 
typedef Vec1d Vector1
 alias More...
 
typedef Vec2d Vector2
 alias More...
 
typedef Vec3d Vector3
 alias More...
 
typedef Vec4d Vector4
 alias More...
 
typedef Vec6d Vector6
 alias More...
 
typedef Mat< 1, 1, floatMat1x1f
 
typedef Mat< 1, 1, doubleMat1x1d
 
typedef Mat< 2, 2, floatMat2x2f
 
typedef Mat< 2, 2, doubleMat2x2d
 
typedef Mat< 3, 3, floatMat3x3f
 
typedef Mat< 3, 3, doubleMat3x3d
 
typedef Mat< 3, 4, floatMat3x4f
 
typedef Mat< 3, 4, doubleMat3x4d
 
typedef Mat< 4, 4, floatMat4x4f
 
typedef Mat< 4, 4, doubleMat4x4d
 
typedef Mat< 2, 2, SRealMat2x2
 
typedef Mat< 3, 3, SRealMat3x3
 
typedef Mat< 4, 4, SRealMat4x4
 
typedef Mat< 2, 2, SRealMatrix2
 
typedef Mat< 3, 3, SRealMatrix3
 
typedef Mat< 4, 4, SRealMatrix4
 
using Quatd = type::Quat< double >
 
using Quatf = type::Quat< float >
 
template<class T , class A = std::allocator<T>>
using stable_vector = boost::container::stable_vector< T, A >
 
template<class T , class B >
using rebind_to = typename Rebind< T, B >::to
 

Functions

BoundingBox::bbox_t make_neutralBBox ()
 
template<typename... Ts>
constexpr auto make_array (Ts &&... ts) -> fixed_array< std::common_type_t< Ts... >, sizeof...(Ts)>
 
std::ostream & operator<< (std::ostream &out, const sofa::type::Frame &c)
 
SOFA_TYPE_API void init ()
 Initialize the SofaHelper library. More...
 
SOFA_TYPE_API bool isInitialized ()
 Return true if and only if the SofaHelper library has been initialized. More...
 
SOFA_TYPE_API void cleanup ()
 Clean up the resources used by the SofaHelper library. More...
 
SOFA_TYPE_API bool isCleanedUp ()
 Return true if and only if the SofaHelper library has been cleaned up. More...
 
SOFA_TYPE_API void printUninitializedLibraryWarning (const std::string &library, const std::string &initFunction)
 Print a warning about a library not being initialized (meant for internal use). More...
 
SOFA_TYPE_API void printLibraryNotCleanedUpWarning (const std::string &library, const std::string &cleanupFunction)
 Print a warning about a library not being cleaned up (meant for internal use). More...
 
template<class real >
constexpr real determinant (const Mat< 3, 3, real > &m) noexcept
 Determinant of a 3x3 matrix. More...
 
template<class real >
constexpr real determinant (const Mat< 2, 2, real > &m) noexcept
 Determinant of a 2x2 matrix. More...
 
template<class real >
constexpr real determinant (const Mat< 2, 3, real > &m) noexcept
 
template<class real >
constexpr real determinant (const Mat< 3, 2, real > &m) noexcept
 
template<class real >
constexpr real oneNorm (const Mat< 3, 3, real > &A)
 
template<class real >
constexpr real infNorm (const Mat< 3, 3, real > &A)
 
template<sofa::Size N, class real >
constexpr real trace (const Mat< N, N, real > &m) noexcept
 trace of a square matrix More...
 
template<sofa::Size N, class real >
constexpr Vec< N, real > diagonal (const Mat< N, N, real > &m)
 diagonal of a square matrix More...
 
template<sofa::Size S, class real >
constexpr bool invertMatrix (Mat< S, S, real > &dest, const Mat< S, S, real > &from)
 Matrix inversion (general case). More...
 
template<class real >
constexpr bool invertMatrix (Mat< 3, 3, real > &dest, const Mat< 3, 3, real > &from)
 Matrix inversion (special case 3x3). More...
 
template<class real >
constexpr bool invertMatrix (Mat< 2, 2, real > &dest, const Mat< 2, 2, real > &from)
 Matrix inversion (special case 2x2). More...
 
template<sofa::Size S, class real >
constexpr bool transformInvertMatrix (Mat< S, S, real > &dest, const Mat< S, S, real > &from)
 Inverse Matrix considering the matrix as a transformation. More...
 
template<sofa::Size L, sofa::Size C, typename real >
std::ostream & operator<< (std::ostream &o, const Mat< L, C, real > &m)
 
template<sofa::Size L, sofa::Size C, typename real >
std::istream & operator>> (std::istream &in, Mat< L, C, real > &m)
 
template<sofa::Size L, sofa::Size C, typename real >
void printMatlab (std::ostream &o, const Mat< L, C, real > &m)
 printing in other software formats More...
 
template<sofa::Size L, sofa::Size C, typename real >
void printMaple (std::ostream &o, const Mat< L, C, real > &m)
 
template<sofa::Size L, sofa::Size C, typename T >
constexpr Mat< L, C, Tdyad (const Vec< L, T > &u, const Vec< C, T > &v) noexcept
 Create a matrix as $ u v^T $. More...
 
template<sofa::Size L, sofa::Size C, typename real >
constexpr real scalarProduct (const Mat< L, C, real > &left, const Mat< L, C, real > &right) noexcept
 Compute the scalar product of two matrix (sum of product of all terms) More...
 
template<class Real >
constexpr Mat< 3, 3, RealcrossProductMatrix (const Vec< 3, Real > &v) noexcept
 
template<sofa::Size L, class Real >
constexpr Mat< L, L, RealtensorProduct (const Vec< L, Real > &a, const Vec< L, Real > &b) noexcept
 return a * b^T More...
 
template<Size n, class real >
bool cholDcmp (Mat< n, n, real > &L, const Mat< n, n, real > &M)
 
template<Size n, class real >
void cholBksb (Vec< n, real > &x, const Mat< n, n, real > &L, const Vec< n, real > &b)
 
template<Size n, class real >
bool cholSlv (Vec< n, real > &x, const Mat< n, n, real > &M, const Vec< n, real > &b)
 
template<Size n, class real >
bool cholInv (Mat< n, n, real > &Inv, const Mat< n, n, real > &M)
 
template<Size dim, typename real >
bool solveLCP (const Vec< dim, real > &q, const Mat< dim, dim, real > &M, Vec< dim *2, real > &res)
 
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. More...
 
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. More...
 
template<int n, typename Real >
void luinv (Mat< n, n, Real > &inv, Mat< n, n, Real > &m)
 
template<class T1 , class T2 >
const T1 S_MAX (const T1 &a, const T2 &b)
 return the max of two values More...
 
template<class T1 , class T2 >
const T1 S_MIN (const T1 &a, const T2 &b)
 return the min of two values More...
 
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^2 + b^2) without destructive underflow or overflow. More...
 
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. More...
 
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) More...
 
std::ostream & operator<< (std::ostream &out, const Material &m)
 
std::istream & operator>> (std::istream &in, Material &m)
 
template<class real >
real determinant (const MatSym< 3, real > &m)
 Determinant of a 3x3 matrix. More...
 
template<class real >
real determinant (const MatSym< 2, real > &m)
 Determinant of a 2x2 matrix. More...
 
template<class real >
real trace (const MatSym< 3, real > &m)
 Trace of a 3x3 matrix. More...
 
template<class real >
real trace (const MatSym< 2, real > &m)
 Trace of a 2x2 matrix. More...
 
template<int S, class real >
bool invertMatrix (MatSym< S, real > &dest, const MatSym< S, real > &from)
 Matrix inversion (general case). More...
 
template<class real >
bool invertMatrix (MatSym< 3, real > &dest, const MatSym< 3, real > &from)
 Matrix inversion (special case 3x3). More...
 
template<class real >
bool invertMatrix (MatSym< 2, real > &dest, const MatSym< 2, real > &from)
 Matrix inversion (special case 2x2). More...
 
template<int D, class real >
std::ostream & operator<< (std::ostream &o, const MatSym< D, real > &m)
 
template<int D, class real >
std::istream & operator>> (std::istream &in, MatSym< D, real > &m)
 
template<int D, typename real >
real scalarProduct (const MatSym< D, real > &left, const MatSym< D, real > &right)
 Compute the scalar product of two matrix (sum of product of all terms) More...
 
template<int D, typename real >
real scalarProduct (const MatSym< D, real > &left, const Mat< D, D, real > &right)
 
template<int D, typename real >
real scalarProduct (const Mat< D, D, real > &left, const MatSym< D, real > &right)
 
std::ostream & operator<< (std::ostream &out, const PrimitiveGroup &g)
 
std::istream & operator>> (std::istream &in, PrimitiveGroup &g)
 
template SOFA_TYPE_API std::ostream & operator<< (std::ostream &out, const Quat< double > &v)
 
template SOFA_TYPE_API std::istream & operator>> (std::istream &in, Quat< double > &v)
 
template SOFA_TYPE_API std::ostream & operator<< (std::ostream &out, const Quat< float > &v)
 
template SOFA_TYPE_API std::istream & operator>> (std::istream &in, Quat< float > &v)
 
template<class Real >
SOFA_TYPE_API std::ostream & operator<< (std::ostream &out, const Quat< Real > &v)
 write to an output stream More...
 
template<class Real >
SOFA_TYPE_API std::istream & operator>> (std::istream &in, Quat< Real > &v)
 read from an input stream More...
 
template<class Real >
std::ostream & operator<< (std::ostream &out, const Quat< Real > &v)
 write to an output stream More...
 
template<class Real >
std::istream & operator>> (std::istream &in, Quat< Real > &v)
 read from an input stream More...
 
SOFA_TYPE_API std::istream & operator>> (std::istream &in, RGBAColor &t)
 
SOFA_TYPE_API std::ostream & operator<< (std::ostream &out, const RGBAColor &v)
 Write to an output stream. More...
 
template<sofa::Size N, typename Real >
std::istream & operator>> (std::istream &in, Vec< N, Real > &v)
 Read from an input stream. More...
 
template<sofa::Size N, typename Real >
std::ostream & operator<< (std::ostream &out, const Vec< N, Real > &v)
 Write to an output stream. More...
 
template<typename real1 , typename real2 >
constexpr Vec< 3, real1 > cross (const Vec< 3, real1 > &a, const Vec< 3, real2 > &b) noexcept
 Cross product for 3-elements vectors. More...
 
template<typename real1 , typename real2 >
constexpr real1 cross (const type::Vec< 2, real1 > &a, const type::Vec< 2, real2 > &b) noexcept
 Cross product for 2-elements vectors. More...
 
template<sofa::Size N, typename real >
constexpr real dot (const Vec< N, real > &a, const Vec< N, real > &b) noexcept
 Dot product (alias for operator*) More...
 
template<sofa::Size N, typename real >
constexpr Vec< N, real > operator* (const double &a, const Vec< N, real > &V) noexcept
 
template<sofa::Size N, typename real >
constexpr Vec< N, real > operator* (const float &a, const Vec< N, real > &V) noexcept
 
void SOFA_TYPE_API vector_access_failure (const void *vec, const std::size_t size, const std::size_t i, const std::type_info &type)
 
template<class T1 , class T2 >
void remove (T1 &v, const T2 &elem)
 
template<class T1 , class T2 >
void removeValue (T1 &v, const T2 &elem)
 
template<class T , class TT >
void removeIndex (std::vector< T, TT > &v, size_t index)
 Remove value at given index, replace it by the value at the last index, other values are not changed. More...
 
SOFA_TYPE_API int getInteger (const std::string &s, std::stringstream &msg, unsigned int &numErrors)
 
SOFA_TYPE_API unsigned int getUnsignedInteger (const std::string &s, std::stringstream &msg, unsigned int &numErrors)
 

Variables

template class SOFA_TYPE_API DualQuatCoord3< double >
 
template class SOFA_TYPE_API DualQuatCoord3< float >
 
template class SOFA_TYPE_API fixed_array< float, 2 >
 
template class SOFA_TYPE_API fixed_array< double, 2 >
 
template class SOFA_TYPE_API fixed_array< float, 3 >
 
template class SOFA_TYPE_API fixed_array< double, 3 >
 
template class SOFA_TYPE_API fixed_array< float, 4 >
 
template class SOFA_TYPE_API fixed_array< double, 4 >
 
template class SOFA_TYPE_API fixed_array< float, 5 >
 
template class SOFA_TYPE_API fixed_array< double, 5 >
 
template class SOFA_TYPE_API fixed_array< float, 6 >
 
template class SOFA_TYPE_API fixed_array< double, 6 >
 
template class SOFA_TYPE_API fixed_array< float, 7 >
 
template class SOFA_TYPE_API fixed_array< double, 7 >
 
template class SOFA_TYPE_API Quat< double >
 Explicit instanciation of the quaternions for double precision. More...
 
template class SOFA_TYPE_API Quat< float >
 Explicit instanciation of the quaternions for single precision. More...
 
constexpr double quaternion_equality_thresold =1e-6
 
constexpr RGBAColor g_white {1.0f,1.0f,1.0f,1.0f}
 
constexpr RGBAColor g_black {0.0f,0.0f,0.0f,1.0f}
 
constexpr RGBAColor g_red {1.0f,0.0f,0.0f,1.0f}
 
constexpr RGBAColor g_green {0.0f,1.0f,0.0f,1.0f}
 
constexpr RGBAColor g_blue {0.0f,0.0f,1.0f,1.0f}
 
constexpr RGBAColor g_cyan {0.0f,1.0f,1.0f,1.0f}
 
constexpr RGBAColor g_magenta {1.0f,0.0f,1.0f,1.0f}
 
constexpr RGBAColor g_yellow {1.0f,1.0f,0.0f,1.0f}
 
constexpr RGBAColor g_gray {0.5f,0.5f,0.5f,1.0f}
 
constexpr RGBAColor g_darkgray {0.25f,0.25f,0.25f,1.0f}
 
constexpr RGBAColor g_lightgray {0.75f,0.75f,0.75f,1.0f}
 
template<class... >
constexpr auto deny = false
 
template class SOFA_TYPE_API Vec< 2, float >
 
template class SOFA_TYPE_API Vec< 2, int >
 
template class SOFA_TYPE_API Vec< 2, double >
 
template class SOFA_TYPE_API Vec< 2, unsigned >
 
template class SOFA_TYPE_API Vec< 3, float >
 
template class SOFA_TYPE_API Vec< 3, int >
 
template class SOFA_TYPE_API Vec< 3, double >
 
template class SOFA_TYPE_API Vec< 3, unsigned >
 
template class SOFA_TYPE_API Vec< 4, float >
 
template class SOFA_TYPE_API Vec< 4, int >
 
template class SOFA_TYPE_API Vec< 4, double >
 
template class SOFA_TYPE_API Vec< 4, unsigned >
 
template class SOFA_TYPE_API Vec< 6, float >
 
template class SOFA_TYPE_API Vec< 6, int >
 
template class SOFA_TYPE_API Vec< 6, double >
 
template class SOFA_TYPE_API Vec< 6, unsigned >
 
constexpr NoInit NOINIT
 

Detailed Description

for std::pair

All integral types are considered as extern templates.

Typedef Documentation

◆ Mat1x1d

◆ Mat1x1f

◆ Mat2x2

◆ Mat2x2d

◆ Mat2x2f

◆ Mat3x3

◆ Mat3x3d

◆ Mat3x3f

◆ Mat3x4d

◆ Mat3x4f

◆ Mat4x4

◆ Mat4x4d

◆ Mat4x4f

◆ Matrix2

◆ Matrix3

◆ Matrix4

◆ Quatd

◆ Quatf

◆ rebind_to

template<class T , class B >
using sofa::type::rebind_to = typedef typename Rebind<T, B>::to

Conveniant alias to ease usage of Rebind.

Example: 1) sofa::type::rebind_to< sofa::type::vector<int>, float> is of type sofa::type::vector<float>. In this example, sofa::type::vector has a typedef rebind_to that will be used to deduce the type. 2) sofa::type::rebind_to< sofa::type::Quat<float>, double> is of type sofa::type::Quat<double>. In this example, sofa::type::Quat does not have a typdef rebind_to. 3) It makes no sense to use sofa::type::rebind on types having more than one template parameter, such as sofa::type::fixed_array. A compilation error would occur.

◆ stable_vector

template<class T , class A = std::allocator<T>>
using sofa::type::stable_vector = typedef boost::container::stable_vector<T,A>

◆ Vec1

◆ Vec1d

◆ Vec1f

◆ Vec1i

◆ Vec1u

typedef Vec<1,unsigned> sofa::type::Vec1u

◆ Vec2

◆ Vec2d

◆ Vec2f

◆ Vec2i

◆ Vec2u

typedef Vec<2,unsigned> sofa::type::Vec2u

◆ Vec3

◆ Vec3d

◆ Vec3f

◆ Vec3i

◆ Vec3u

typedef Vec<3,unsigned> sofa::type::Vec3u

◆ Vec4

◆ Vec4d

◆ Vec4f

◆ Vec4i

◆ Vec4u

typedef Vec<4,unsigned> sofa::type::Vec4u

◆ Vec6

◆ Vec6d

◆ Vec6f

◆ Vec6i

◆ Vec6u

typedef Vec<6,unsigned> sofa::type::Vec6u

◆ Vector1

alias

◆ Vector2

alias

◆ Vector3

alias

◆ Vector4

alias

◆ Vector6

alias

Function Documentation

◆ axpy()

template<class V1 , class Scalar , class V2 , class V3 >
void sofa::type::axpy ( V1 &  result,
Scalar  a,
const V2 &  x,
const V3 &  y 
)

Vector operation: result = ax + y.

◆ cholBksb()

template<Size n, class real >
void sofa::type::cholBksb ( Vec< n, real > &  x,
const Mat< n, n, real > &  L,
const Vec< n, real > &  b 
)

Cholesky back-substitution: solve the system Mx=b using the triangular matrix L such that M=L.Lt

Precondition
L was computed using the Cholesky decomposition of L

◆ cholDcmp()

template<Size n, class real >
bool sofa::type::cholDcmp ( Mat< n, n, real > &  L,
const Mat< n, n, real > &  M 
)

Cholesky decomposition: compute triangular matrix L such that M=L.Lt

Precondition
M must be symmetric positive definite returns false is the decomposition fails

◆ cholInv()

template<Size n, class real >
bool sofa::type::cholInv ( Mat< n, n, real > &  Inv,
const Mat< n, n, real > &  M 
)

Inversion of a positive symmetric definite (PSD) matrix using a Cholesky decomposition. Returns false if the matrix is not PSD.

◆ cholSlv()

template<Size n, class real >
bool sofa::type::cholSlv ( Vec< n, real > &  x,
const Mat< n, n, real > &  M,
const Vec< n, real > &  b 
)

Cholesky solution: solve the system Mx=b using a Cholesky decomposition.

Precondition
M must be symmetric positive definite Returns false is the decomposition fails. If you have several solutions to perform with the same matrix M and different vectors b, it is more efficient to factor the matrix once and then use back-substitution for each vector.

◆ cleanup()

SOFA_TYPE_API void sofa::type::cleanup ( )

Clean up the resources used by the SofaHelper library.

◆ cond()

template<int m, int n, typename Real >
Real sofa::type::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)

◆ cross() [1/2]

template<typename real1 , typename real2 >
constexpr real1 sofa::type::cross ( const type::Vec< 2, real1 > &  a,
const type::Vec< 2, real2 > &  b 
)
constexprnoexcept

Cross product for 2-elements vectors.

◆ cross() [2/2]

template<typename real1 , typename real2 >
constexpr Vec<3,real1> sofa::type::cross ( const Vec< 3, real1 > &  a,
const Vec< 3, real2 > &  b 
)
constexprnoexcept

Cross product for 3-elements vectors.

◆ crossProductMatrix()

template<class Real >
constexpr Mat<3, 3, Real> sofa::type::crossProductMatrix ( const Vec< 3, Real > &  v)
constexprnoexcept

skew-symmetric mapping crossProductMatrix(v) * x = v.cross(x)

◆ determinant() [1/6]

template<class real >
constexpr real sofa::type::determinant ( const Mat< 2, 2, real > &  m)
constexprnoexcept

Determinant of a 2x2 matrix.

◆ determinant() [2/6]

template<class real >
constexpr real sofa::type::determinant ( const Mat< 2, 3, real > &  m)
constexprnoexcept

Generalized-determinant of a 2x3 matrix. Mirko Radi, "About a Determinant of Rectangular 2×n Matrix and its Geometric Interpretation"

◆ determinant() [3/6]

template<class real >
constexpr real sofa::type::determinant ( const Mat< 3, 2, real > &  m)
constexprnoexcept

Generalized-determinant of a 3x2 matrix. Mirko Radi, "About a Determinant of Rectangular 2×n Matrix and its Geometric Interpretation"

◆ determinant() [4/6]

template<class real >
constexpr real sofa::type::determinant ( const Mat< 3, 3, real > &  m)
constexprnoexcept

Determinant of a 3x3 matrix.

◆ determinant() [5/6]

template<class real >
real sofa::type::determinant ( const MatSym< 2, real > &  m)
inline

Determinant of a 2x2 matrix.

◆ determinant() [6/6]

template<class real >
real sofa::type::determinant ( const MatSym< 3, real > &  m)
inline

Determinant of a 3x3 matrix.

◆ diagonal()

template<sofa::Size N, class real >
constexpr Vec<N,real> sofa::type::diagonal ( const Mat< N, N, real > &  m)
constexpr

diagonal of a square matrix

◆ dot() [1/2]

template<class V1 , class V2 >
SReal sofa::type::dot ( const V1 &  vector1,
const V2 &  vector2 
)

Dot product of two vectors.

◆ dot() [2/2]

template<sofa::Size N, typename real >
constexpr real sofa::type::dot ( const Vec< N, real > &  a,
const Vec< N, real > &  b 
)
constexprnoexcept

Dot product (alias for operator*)

◆ dyad()

template<sofa::Size L, sofa::Size C, typename T >
constexpr Mat<L,C,T> sofa::type::dyad ( const Vec< L, T > &  u,
const Vec< C, T > &  v 
)
constexprnoexcept

Create a matrix as $ u v^T $.

◆ getInteger()

SOFA_TYPE_API int sofa::type::getInteger ( const std::string &  s,
std::stringstream &  msg,
unsigned int numErrors 
)

Convert the string 's' into an unsigned int. The error are reported in msg & numErrors is incremented.

◆ getUnsignedInteger()

SOFA_TYPE_API unsigned int sofa::type::getUnsignedInteger ( const std::string &  s,
std::stringstream &  msg,
unsigned int numErrors 
)

Convert the string 's' into an unsigned int. The error are reported in msg & numErrors is incremented.

◆ infNorm()

template<class real >
constexpr real sofa::type::infNorm ( const Mat< 3, 3, real > &  A)
constexpr

◆ init()

SOFA_TYPE_API void sofa::type::init ( )

Initialize the SofaHelper library.

Initialize the SofaCore library, as well as its dependencies: SofaDefaultType, SofaHelper.

◆ invertMatrix() [1/6]

template<class real >
constexpr bool sofa::type::invertMatrix ( Mat< 2, 2, real > &  dest,
const Mat< 2, 2, real > &  from 
)
constexpr

Matrix inversion (special case 2x2).

◆ invertMatrix() [2/6]

template<class real >
constexpr bool sofa::type::invertMatrix ( Mat< 3, 3, real > &  dest,
const Mat< 3, 3, real > &  from 
)
constexpr

Matrix inversion (special case 3x3).

◆ invertMatrix() [3/6]

template<sofa::Size S, class real >
constexpr bool sofa::type::invertMatrix ( Mat< S, S, real > &  dest,
const Mat< S, S, real > &  from 
)
constexpr

Matrix inversion (general case).

◆ invertMatrix() [4/6]

template<class real >
bool sofa::type::invertMatrix ( MatSym< 2, real > &  dest,
const MatSym< 2, real > &  from 
)

Matrix inversion (special case 2x2).

◆ invertMatrix() [5/6]

template<class real >
bool sofa::type::invertMatrix ( MatSym< 3, real > &  dest,
const MatSym< 3, real > &  from 
)

Matrix inversion (special case 3x3).

◆ invertMatrix() [6/6]

template<int S, class real >
bool sofa::type::invertMatrix ( MatSym< S, real > &  dest,
const MatSym< S, real > &  from 
)

Matrix inversion (general case).

◆ isCleanedUp()

SOFA_TYPE_API bool sofa::type::isCleanedUp ( )

Return true if and only if the SofaHelper library has been cleaned up.

◆ isInitialized()

SOFA_TYPE_API bool sofa::type::isInitialized ( )

Return true if and only if the SofaHelper library has been initialized.

◆ lubksb()

template<int n, typename Real >
void sofa::type::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.

◆ ludcmp()

template<int n, typename Real >
void sofa::type::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.

◆ luinv()

template<int n, typename Real >
void sofa::type::luinv ( Mat< n, n, Real > &  inv,
Mat< n, n, Real > &  m 
)

Compute the inverse of matrix m.

Warning
Matrix m is replaced by its LU decomposition.

◆ make_array()

template<typename... Ts>
constexpr auto sofa::type::make_array ( Ts &&...  ts) -> fixed_array<std::common_type_t<Ts...>, sizeof...(Ts)>
constexpr

◆ make_neutralBBox()

BoundingBox::bbox_t sofa::type::make_neutralBBox ( )

◆ norm()

template<class V >
SReal sofa::type::norm ( const V &  v)

Norm of a vector.

◆ oneNorm()

template<class real >
constexpr real sofa::type::oneNorm ( const Mat< 3, 3, real > &  A)
constexpr

◆ operator*() [1/2]

template<sofa::Size N, typename real >
constexpr Vec<N,real> sofa::type::operator* ( const double a,
const Vec< N, real > &  V 
)
constexprnoexcept

◆ operator*() [2/2]

template<sofa::Size N, typename real >
constexpr Vec<N,real> sofa::type::operator* ( const float a,
const Vec< N, real > &  V 
)
constexprnoexcept

◆ operator<<() [1/11]

template<sofa::Size L, sofa::Size C, typename real >
std::ostream& sofa::type::operator<< ( std::ostream &  o,
const Mat< L, C, real > &  m 
)

◆ operator<<() [2/11]

template<int D, class real >
std::ostream& sofa::type::operator<< ( std::ostream &  o,
const MatSym< D, real > &  m 
)

◆ operator<<() [3/11]

std::ostream& sofa::type::operator<< ( std::ostream &  out,
const Material m 
)

◆ operator<<() [4/11]

std::ostream& sofa::type::operator<< ( std::ostream &  out,
const PrimitiveGroup g 
)

◆ operator<<() [5/11]

template SOFA_TYPE_API std::ostream& sofa::type::operator<< ( std::ostream &  out,
const Quat< double > &  v 
)

◆ operator<<() [6/11]

template SOFA_TYPE_API std::ostream& sofa::type::operator<< ( std::ostream &  out,
const Quat< float > &  v 
)

◆ operator<<() [7/11]

template<class Real >
SOFA_TYPE_API std::ostream& sofa::type::operator<< ( std::ostream &  out,
const Quat< Real > &  v 
)

write to an output stream

◆ operator<<() [8/11]

template<class Real >
std::ostream& sofa::type::operator<< ( std::ostream &  out,
const Quat< Real > &  v 
)

write to an output stream

◆ operator<<() [9/11]

SOFA_TYPE_API std::ostream& sofa::type::operator<< ( std::ostream &  out,
const RGBAColor v 
)

Write to an output stream.

◆ operator<<() [10/11]

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

◆ operator<<() [11/11]

template<sofa::Size N, typename Real >
std::ostream& sofa::type::operator<< ( std::ostream &  out,
const Vec< N, Real > &  v 
)

Write to an output stream.

◆ operator>>() [1/10]

template<sofa::Size L, sofa::Size C, typename real >
std::istream& sofa::type::operator>> ( std::istream &  in,
Mat< L, C, real > &  m 
)

◆ operator>>() [2/10]

std::istream& sofa::type::operator>> ( std::istream &  in,
Material m 
)

◆ operator>>() [3/10]

template<int D, class real >
std::istream& sofa::type::operator>> ( std::istream &  in,
MatSym< D, real > &  m 
)

◆ operator>>() [4/10]

std::istream& sofa::type::operator>> ( std::istream &  in,
PrimitiveGroup g 
)

◆ operator>>() [5/10]

template SOFA_TYPE_API std::istream& sofa::type::operator>> ( std::istream &  in,
Quat< double > &  v 
)

◆ operator>>() [6/10]

template SOFA_TYPE_API std::istream& sofa::type::operator>> ( std::istream &  in,
Quat< float > &  v 
)

◆ operator>>() [7/10]

template<class Real >
SOFA_TYPE_API std::istream& sofa::type::operator>> ( std::istream &  in,
Quat< Real > &  v 
)

read from an input stream

◆ operator>>() [8/10]

template<class Real >
std::istream& sofa::type::operator>> ( std::istream &  in,
Quat< Real > &  v 
)

read from an input stream

◆ operator>>() [9/10]

SOFA_TYPE_API std::istream& sofa::type::operator>> ( std::istream &  in,
RGBAColor t 
)

◆ operator>>() [10/10]

template<sofa::Size N, typename Real >
std::istream& sofa::type::operator>> ( std::istream &  in,
Vec< N, Real > &  v 
)

Read from an input stream.

◆ printLibraryNotCleanedUpWarning()

SOFA_TYPE_API void sofa::type::printLibraryNotCleanedUpWarning ( const std::string &  library,
const std::string &  cleanupFunction 
)

Print a warning about a library not being cleaned up (meant for internal use).

◆ printMaple()

template<sofa::Size L, sofa::Size C, typename real >
void sofa::type::printMaple ( std::ostream &  o,
const Mat< L, C, real > &  m 
)

◆ printMatlab()

template<sofa::Size L, sofa::Size C, typename real >
void sofa::type::printMatlab ( std::ostream &  o,
const Mat< L, C, real > &  m 
)

printing in other software formats

◆ printUninitializedLibraryWarning()

SOFA_TYPE_API void sofa::type::printUninitializedLibraryWarning ( const std::string &  library,
const std::string &  initFunction 
)

Print a warning about a library not being initialized (meant for internal use).

◆ pythag()

template<class T1 , class T2 >
T1 sofa::type::pythag ( const T1  a,
const T2  b 
)

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

◆ remove()

template<class T1 , class T2 >
void sofa::type::remove ( T1 &  v,
const T2 &  elem 
)

Remove the first occurence of a given value. The remaining values are shifted.

◆ removeIndex()

template<class T , class TT >
void sofa::type::removeIndex ( std::vector< T, TT > &  v,
size_t  index 
)

Remove value at given index, replace it by the value at the last index, other values are not changed.

◆ removeValue()

template<class T1 , class T2 >
void sofa::type::removeValue ( T1 &  v,
const T2 &  elem 
)

Remove the first occurence of a given value.

The last value is moved to where the value was found, and the other values are not shifted.

◆ S_MAX()

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

return the max of two values

◆ S_MIN()

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

return the min of two values

◆ S_SIGN()

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

◆ S_SQR()

template<class T >
const T sofa::type::S_SQR ( const T  a)
inline

◆ scalarProduct() [1/4]

template<int D, typename real >
real sofa::type::scalarProduct ( const Mat< D, D, real > &  left,
const MatSym< D, real > &  right 
)
inline

◆ scalarProduct() [2/4]

template<sofa::Size L, sofa::Size C, typename real >
constexpr real sofa::type::scalarProduct ( const Mat< L, C, real > &  left,
const Mat< L, C, real > &  right 
)
constexprnoexcept

Compute the scalar product of two matrix (sum of product of all terms)

◆ scalarProduct() [3/4]

template<int D, typename real >
real sofa::type::scalarProduct ( const MatSym< D, real > &  left,
const Mat< D, D, real > &  right 
)
inline

◆ scalarProduct() [4/4]

template<int D, typename real >
real sofa::type::scalarProduct ( const MatSym< D, real > &  left,
const MatSym< D, real > &  right 
)
inline

Compute the scalar product of two matrix (sum of product of all terms)

◆ solveLCP()

template<Size dim, typename real >
bool sofa::type::solveLCP ( const Vec< dim, real > &  q,
const Mat< dim, dim, real > &  M,
Vec< dim *2, real > &  res 
)

◆ svddcmp()

template<int m, int n, typename Real >
void sofa::type::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.

SVD decomposition a = u.w.vt

Precondition
a: original matrix, destroyed to become u
w: diagonal vector
v: matrix

◆ tensorProduct()

template<sofa::Size L, class Real >
constexpr Mat<L,L,Real> sofa::type::tensorProduct ( const Vec< L, Real > &  a,
const Vec< L, Real > &  b 
)
constexprnoexcept

return a * b^T

◆ trace() [1/3]

template<sofa::Size N, class real >
constexpr real sofa::type::trace ( const Mat< N, N, real > &  m)
constexprnoexcept

trace of a square matrix

◆ trace() [2/3]

template<class real >
real sofa::type::trace ( const MatSym< 2, real > &  m)
inline

Trace of a 2x2 matrix.

◆ trace() [3/3]

template<class real >
real sofa::type::trace ( const MatSym< 3, real > &  m)
inline

Trace of a 3x3 matrix.

◆ transformInvertMatrix()

template<sofa::Size S, class real >
constexpr bool sofa::type::transformInvertMatrix ( Mat< S, S, real > &  dest,
const Mat< S, S, real > &  from 
)
constexpr

Inverse Matrix considering the matrix as a transformation.

◆ vector_access_failure()

void SOFA_TYPE_API sofa::type::vector_access_failure ( const void *  vec,
const std::size_t  size,
const std::size_t  i,
const std::type_info &  type 
)

Variable Documentation

◆ deny

template<class... >
constexpr auto sofa::type::deny = false
inlineconstexpr

◆ DualQuatCoord3< double >

template class SOFA_TYPE_API sofa::type::DualQuatCoord3< double >

◆ DualQuatCoord3< float >

template class SOFA_TYPE_API sofa::type::DualQuatCoord3< float >

◆ fixed_array< double, 2 >

template class SOFA_TYPE_API sofa::type::fixed_array< double, 2 >

◆ fixed_array< double, 3 >

template class SOFA_TYPE_API sofa::type::fixed_array< double, 3 >

◆ fixed_array< double, 4 >

template class SOFA_TYPE_API sofa::type::fixed_array< double, 4 >

◆ fixed_array< double, 5 >

template class SOFA_TYPE_API sofa::type::fixed_array< double, 5 >

◆ fixed_array< double, 6 >

template class SOFA_TYPE_API sofa::type::fixed_array< double, 6 >

◆ fixed_array< double, 7 >

template class SOFA_TYPE_API sofa::type::fixed_array< double, 7 >

◆ fixed_array< float, 2 >

template class SOFA_TYPE_API sofa::type::fixed_array< float, 2 >

◆ fixed_array< float, 3 >

template class SOFA_TYPE_API sofa::type::fixed_array< float, 3 >

◆ fixed_array< float, 4 >

template class SOFA_TYPE_API sofa::type::fixed_array< float, 4 >

◆ fixed_array< float, 5 >

template class SOFA_TYPE_API sofa::type::fixed_array< float, 5 >

◆ fixed_array< float, 6 >

template class SOFA_TYPE_API sofa::type::fixed_array< float, 6 >

◆ fixed_array< float, 7 >

template class SOFA_TYPE_API sofa::type::fixed_array< float, 7 >

◆ g_black

constexpr RGBAColor sofa::type::g_black {0.0f,0.0f,0.0f,1.0f}
inlineconstexpr

◆ g_blue

constexpr RGBAColor sofa::type::g_blue {0.0f,0.0f,1.0f,1.0f}
inlineconstexpr

◆ g_cyan

constexpr RGBAColor sofa::type::g_cyan {0.0f,1.0f,1.0f,1.0f}
inlineconstexpr

◆ g_darkgray

constexpr RGBAColor sofa::type::g_darkgray {0.25f,0.25f,0.25f,1.0f}
inlineconstexpr

◆ g_gray

constexpr RGBAColor sofa::type::g_gray {0.5f,0.5f,0.5f,1.0f}
inlineconstexpr

◆ g_green

constexpr RGBAColor sofa::type::g_green {0.0f,1.0f,0.0f,1.0f}
inlineconstexpr

◆ g_lightgray

constexpr RGBAColor sofa::type::g_lightgray {0.75f,0.75f,0.75f,1.0f}
inlineconstexpr

◆ g_magenta

constexpr RGBAColor sofa::type::g_magenta {1.0f,0.0f,1.0f,1.0f}
inlineconstexpr

◆ g_red

constexpr RGBAColor sofa::type::g_red {1.0f,0.0f,0.0f,1.0f}
inlineconstexpr

◆ g_white

constexpr RGBAColor sofa::type::g_white {1.0f,1.0f,1.0f,1.0f}
inlineconstexpr

◆ g_yellow

constexpr RGBAColor sofa::type::g_yellow {1.0f,1.0f,0.0f,1.0f}
inlineconstexpr

◆ NOINIT

constexpr NoInit sofa::type::NOINIT
constexpr

◆ Quat< double >

template class SOFA_TYPE_API sofa::type::Quat< double >

Explicit instanciation of the quaternions for double precision.

◆ Quat< float >

template class SOFA_TYPE_API sofa::type::Quat< float >

Explicit instanciation of the quaternions for single precision.

◆ quaternion_equality_thresold

constexpr double sofa::type::quaternion_equality_thresold =1e-6
constexpr

◆ Vec< 2, double >

template class SOFA_TYPE_API sofa::type::Vec< 2, double >

◆ Vec< 2, float >

template class SOFA_TYPE_API sofa::type::Vec< 2, float >

◆ Vec< 2, int >

template class SOFA_TYPE_API sofa::type::Vec< 2, int >

◆ Vec< 2, unsigned >

template class SOFA_TYPE_API sofa::type::Vec< 2, unsigned >

◆ Vec< 3, double >

template class SOFA_TYPE_API sofa::type::Vec< 3, double >

◆ Vec< 3, float >

template class SOFA_TYPE_API sofa::type::Vec< 3, float >

◆ Vec< 3, int >

template class SOFA_TYPE_API sofa::type::Vec< 3, int >

◆ Vec< 3, unsigned >

template class SOFA_TYPE_API sofa::type::Vec< 3, unsigned >

◆ Vec< 4, double >

template class SOFA_TYPE_API sofa::type::Vec< 4, double >

◆ Vec< 4, float >

template class SOFA_TYPE_API sofa::type::Vec< 4, float >

◆ Vec< 4, int >

template class SOFA_TYPE_API sofa::type::Vec< 4, int >

◆ Vec< 4, unsigned >

template class SOFA_TYPE_API sofa::type::Vec< 4, unsigned >

◆ Vec< 6, double >

template class SOFA_TYPE_API sofa::type::Vec< 6, double >

◆ Vec< 6, float >

template class SOFA_TYPE_API sofa::type::Vec< 6, float >

◆ Vec< 6, int >

template class SOFA_TYPE_API sofa::type::Vec< 6, int >

◆ Vec< 6, unsigned >

template class SOFA_TYPE_API sofa::type::Vec< 6, unsigned >