openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Macros | Functions
mathextra.h File Reference

(2013-03-18 10:33:00 +0900, commit:334d202)

Extra math routines that are useful to have but don't really belong anywhere. More...

#include <cassert>
#include <cmath>
#include <climits>
Include dependency graph for mathextra.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  OpenRAVE
 The entire OpenRAVE library.
 
namespace  OpenRAVE::mathextra
 Extra math routines that are useful to have but don't really belong anywhere.
 

Macros

#define OPENRAVE_API
 
#define MATH_ASSERT   assert
 
#define distinctRoots   0
 
#define singleRoot   1
 
#define floatRoot01   2
 
#define floatRoot12   4
 
#define tripleRoot   6
 
#define MULT3(stride)
 

Functions

float * OpenRAVE::mathextra::mult4 (float *pfres, const float *pf1, const float *pf2)
 
float * OpenRAVE::mathextra::multtrans3 (float *pfres, const float *pf1, const float *pf2)
 
float * OpenRAVE::mathextra::multtrans4 (float *pfres, const float *pf1, const float *pf2)
 
float * OpenRAVE::mathextra::transnorm3 (float *pfout, const float *pfmat, const float *pf)
 
float * OpenRAVE::mathextra::transpose3 (const float *pf, float *pfres)
 
float * OpenRAVE::mathextra::transpose4 (const float *pf, float *pfres)
 
float OpenRAVE::mathextra::dot2 (const float *pf1, const float *pf2)
 
float OpenRAVE::mathextra::dot3 (const float *pf1, const float *pf2)
 
float OpenRAVE::mathextra::dot4 (const float *pf1, const float *pf2)
 
float OpenRAVE::mathextra::lengthsqr2 (const float *pf)
 
float OpenRAVE::mathextra::lengthsqr3 (const float *pf)
 
float OpenRAVE::mathextra::lengthsqr4 (const float *pf)
 
float * OpenRAVE::mathextra::normalize2 (float *pfout, const float *pf)
 
float * OpenRAVE::mathextra::normalize3 (float *pfout, const float *pf)
 
float * OpenRAVE::mathextra::normalize4 (float *pfout, const float *pf)
 
float * OpenRAVE::mathextra::cross3 (float *pfout, const float *pf1, const float *pf2)
 
float * OpenRAVE::mathextra::mult3_s4 (float *pfres, const float *pf1, const float *pf2)
 
float * OpenRAVE::mathextra::mult3_s3 (float *pfres, const float *pf1, const float *pf2)
 
float * OpenRAVE::mathextra::inv3 (const float *pf, float *pfres, float *pfdet, int stride)
 
float * OpenRAVE::mathextra::inv4 (const float *pf, float *pfres)
 
double * OpenRAVE::mathextra::mult4 (double *pfres, const double *pf1, const double *pf2)
 
double * OpenRAVE::mathextra::multtrans3 (double *pfres, const double *pf1, const double *pf2)
 
double * OpenRAVE::mathextra::multtrans4 (double *pfres, const double *pf1, const double *pf2)
 
double * OpenRAVE::mathextra::transnorm3 (double *pfout, const double *pfmat, const double *pf)
 
double * OpenRAVE::mathextra::transpose3 (const double *pf, double *pfres)
 
double * OpenRAVE::mathextra::transpose4 (const double *pf, double *pfres)
 
double OpenRAVE::mathextra::dot2 (const double *pf1, const double *pf2)
 
double OpenRAVE::mathextra::dot3 (const double *pf1, const double *pf2)
 
double OpenRAVE::mathextra::dot4 (const double *pf1, const double *pf2)
 
double OpenRAVE::mathextra::lengthsqr2 (const double *pf)
 
double OpenRAVE::mathextra::lengthsqr3 (const double *pf)
 
double OpenRAVE::mathextra::lengthsqr4 (const double *pf)
 
double * OpenRAVE::mathextra::normalize2 (double *pfout, const double *pf)
 
double * OpenRAVE::mathextra::normalize3 (double *pfout, const double *pf)
 
double * OpenRAVE::mathextra::normalize4 (double *pfout, const double *pf)
 
double * OpenRAVE::mathextra::cross3 (double *pfout, const double *pf1, const double *pf2)
 
double * OpenRAVE::mathextra::mult3_s4 (double *pfres, const double *pf1, const double *pf2)
 
double * OpenRAVE::mathextra::mult3_s3 (double *pfres, const double *pf1, const double *pf2)
 
double * OpenRAVE::mathextra::inv3 (const double *pf, double *pfres, double *pfdet, int stride)
 
double * OpenRAVE::mathextra::inv4 (const double *pf, double *pfres)
 
template<typename T >
bool OpenRAVE::mathextra::eig2 (const T *pfmat, T *peigs, T &fv1x, T &fv1y, T &fv2x, T &fv2y)
 
OPENRAVE_API int OpenRAVE::mathextra::CubicRoots (double c0, double c1, double c2, double *r0, double *r1, double *r2)
 
template<typename T , typename S >
void OpenRAVE::mathextra::Tridiagonal3 (S *mat, T *diag, T *subd)
 
OPENRAVE_API bool OpenRAVE::mathextra::QLAlgorithm3 (float *m_aafEntry, float *afDiag, float *afSubDiag)
 
OPENRAVE_API bool OpenRAVE::mathextra::QLAlgorithm3 (double *m_aafEntry, double *afDiag, double *afSubDiag)
 
OPENRAVE_API void OpenRAVE::mathextra::EigenSymmetric3 (const double *fCovariance, double *eval, double *fAxes)
 
template<typename T >
void OpenRAVE::mathextra::GetCovarBasisVectors (const T fCovariance[3][3], T vbasis[3][3])
 
template<typename T >
void OpenRAVE::mathextra::svd3 (const T *A, T *U, T *D, T *V)
 
template<typename T >
void OpenRAVE::mathextra::mult (T *pf, T fa, int r)
 
template<typename T >
int OpenRAVE::mathextra::Min (T *pts, int stride, int numPts)
 
template<typename T >
int OpenRAVE::mathextra::Max (T *pts, int stride, int numPts)
 
template<typename T , typename R , typename S >
S * OpenRAVE::mathextra::mult (T *pf1, R *pf2, int r1, int c1, int c2, S *pfres, bool badd=false)
 
template<typename T , typename R , typename S >
S * OpenRAVE::mathextra::multtrans (T *pf1, R *pf2, int r1, int c1, int c2, S *pfres, bool badd=false)
 
template<typename T , typename R , typename S >
S * OpenRAVE::mathextra::multtrans_to2 (T *pf1, R *pf2, int r1, int c1, int r2, S *pfres, bool badd=false)
 
template<typename T >
T * OpenRAVE::mathextra::multto1 (T *pf1, T *pf2, int r1, int c1, T *pftemp=NULL)
 
template<typename T , typename S >
T * OpenRAVE::mathextra::multto2 (T *pf1, S *pf2, int r2, int c2, S *pftemp=NULL)
 
template<typename T >
void OpenRAVE::mathextra::sub (T *pf1, T *pf2, int r)
 
template<typename T >
OpenRAVE::mathextra::normsqr (const T *pf1, int r)
 
template<typename T >
OpenRAVE::mathextra::lengthsqr (const T *pf1, const T *pf2, int length)
 
template<typename T >
OpenRAVE::mathextra::dot (T *pf1, T *pf2, int length)
 
template<typename T >
OpenRAVE::mathextra::sum (T *pf, int length)
 
template<typename T >
bool OpenRAVE::mathextra::inv2 (T *pf, T *pfres)
 takes the inverse of the 2x2 matrix pf and stores it into pfres, returns true if matrix is invertible
 
template<typename T >
int OpenRAVE::mathextra::solvequad (T a, T b, T c, T &r1, T &r2)
 
template<typename T >
T * OpenRAVE::mathextra::_mult3_s4 (T *pfres, const T *pf1, const T *pf2)
 mult3 with a 3x3 matrix whose row stride is 16 bytes
 
template<typename T >
T * OpenRAVE::mathextra::_mult3_s3 (T *pfres, const T *pf1, const T *pf2)
 mult3 with a 3x3 matrix whose row stride is 12 bytes
 
template<typename T >
T * OpenRAVE::mathextra::_mult4 (T *pfres, const T *p1, const T *p2)
 
template<typename T >
T * OpenRAVE::mathextra::_multtrans3 (T *pfres, const T *pf1, const T *pf2)
 
template<typename T >
T * OpenRAVE::mathextra::_multtrans4 (T *pfres, const T *pf1, const T *pf2)
 
template<typename T >
OpenRAVE::mathextra::matrixdet3 (const T *pf, int stride)
 Compute the determinant of a 3x3 matrix whose row stride stride elements.
 
template<typename T >
T * OpenRAVE::mathextra::_inv3 (const T *pf, T *pfres, T *pfdet, int stride)
 3x3 matrix inverse.
 
template<typename T >
T * OpenRAVE::mathextra::_inv4 (const T *pf, T *pfres)
 4x4 matrix inverse.
 
template<typename T >
T * OpenRAVE::mathextra::_transpose3 (const T *pf, T *pfres)
 Transpose a 3x3 matrix.
 
template<typename T >
T * OpenRAVE::mathextra::_transpose4 (const T *pf, T *pfres)
 Transpose a 4x4 matrix.
 
template<typename T >
OpenRAVE::mathextra::_dot2 (const T *pf1, const T *pf2)
 
template<typename T >
OpenRAVE::mathextra::_dot3 (const T *pf1, const T *pf2)
 
template<typename T >
OpenRAVE::mathextra::_dot4 (const T *pf1, const T *pf2)
 
template<typename T >
OpenRAVE::mathextra::_lengthsqr2 (const T *pf)
 
template<typename T >
OpenRAVE::mathextra::_lengthsqr3 (const T *pf)
 
template<typename T >
OpenRAVE::mathextra::_lengthsqr4 (const T *pf)
 
template<typename T >
T * OpenRAVE::mathextra::_normalize2 (T *pfout, const T *pf)
 
template<typename T >
T * OpenRAVE::mathextra::_normalize3 (T *pfout, const T *pf)
 
template<typename T >
T * OpenRAVE::mathextra::_normalize4 (T *pfout, const T *pf)
 
template<typename T >
T * OpenRAVE::mathextra::_cross3 (T *pfout, const T *pf1, const T *pf2)
 
template<typename T >
T * OpenRAVE::mathextra::_transnorm3 (T *pfout, const T *pfmat, const T *pf)
 
template<typename T >
void OpenRAVE::mathextra::add (T *pf1, T *pf2, int r)
 

Detailed Description

Extra math routines that are useful to have but don't really belong anywhere.

Definition in file mathextra.h.

Macro Definition Documentation

#define distinctRoots   0

Definition at line 42 of file mathextra.h.

#define floatRoot01   2

Definition at line 44 of file mathextra.h.

#define floatRoot12   4

Definition at line 45 of file mathextra.h.

#define MATH_ASSERT   assert

Definition at line 31 of file mathextra.h.

#define MULT3 (   stride)
Value:
{ \
pfres2[0*stride+0] = pf1[0*stride+0]*pf2[0*stride+0]+pf1[0*stride+1]*pf2[1*stride+0]+pf1[0*stride+2]*pf2[2*stride+0]; \
pfres2[0*stride+1] = pf1[0*stride+0]*pf2[0*stride+1]+pf1[0*stride+1]*pf2[1*stride+1]+pf1[0*stride+2]*pf2[2*stride+1]; \
pfres2[0*stride+2] = pf1[0*stride+0]*pf2[0*stride+2]+pf1[0*stride+1]*pf2[1*stride+2]+pf1[0*stride+2]*pf2[2*stride+2]; \
pfres2[1*stride+0] = pf1[1*stride+0]*pf2[0*stride+0]+pf1[1*stride+1]*pf2[1*stride+0]+pf1[1*stride+2]*pf2[2*stride+0]; \
pfres2[1*stride+1] = pf1[1*stride+0]*pf2[0*stride+1]+pf1[1*stride+1]*pf2[1*stride+1]+pf1[1*stride+2]*pf2[2*stride+1]; \
pfres2[1*stride+2] = pf1[1*stride+0]*pf2[0*stride+2]+pf1[1*stride+1]*pf2[1*stride+2]+pf1[1*stride+2]*pf2[2*stride+2]; \
pfres2[2*stride+0] = pf1[2*stride+0]*pf2[0*stride+0]+pf1[2*stride+1]*pf2[1*stride+0]+pf1[2*stride+2]*pf2[2*stride+0]; \
pfres2[2*stride+1] = pf1[2*stride+0]*pf2[0*stride+1]+pf1[2*stride+1]*pf2[1*stride+1]+pf1[2*stride+2]*pf2[2*stride+1]; \
pfres2[2*stride+2] = pf1[2*stride+0]*pf2[0*stride+2]+pf1[2*stride+1]*pf2[1*stride+2]+pf1[2*stride+2]*pf2[2*stride+2]; \
}

Definition at line 273 of file mathextra.h.

#define OPENRAVE_API

Definition at line 24 of file mathextra.h.

#define singleRoot   1

Definition at line 43 of file mathextra.h.

#define tripleRoot   6

Definition at line 46 of file mathextra.h.