Simbody 3.9
Loading...
Searching...
No Matches
SimTK::Test Class Reference

This is the main class to support testing. More...

#include <Testing.h>

Classes

class  Subtest
 Internal utility class for generating test messages for subtests. More...
 

Public Member Functions

 Test (const std::string &name)
 
 ~Test ()
 

Static Public Member Functions

template<class T >
static double defTol ()
 
template<class T1 , class T2 >
static double defTol2 ()
 
static bool numericallyEqual (float v1, float v2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (double v1, double v2, int n, double tol=defTol< double >())
 
static bool numericallyEqual (int i1, int i2, int n, double tol=0)
 
static bool numericallyEqual (unsigned u1, unsigned u2, int n, double tol=0)
 
static bool numericallyEqual (float v1, double v2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (double v1, float v2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (int i1, float f2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (float f1, int i2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (unsigned i1, float f2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (float f1, unsigned i2, int n, double tol=defTol< float >())
 
static bool numericallyEqual (int i1, double f2, int n, double tol=defTol< double >())
 
static bool numericallyEqual (double f1, int i2, int n, double tol=defTol< double >())
 
static bool numericallyEqual (unsigned i1, double f2, int n, double tol=defTol< double >())
 
static bool numericallyEqual (double f1, unsigned i2, int n, double tol=defTol< double >())
 
template<class P >
static bool numericallyEqual (const std::complex< P > &v1, const std::complex< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const conjugate< P > &v1, const conjugate< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const std::complex< P > &v1, const conjugate< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const conjugate< P > &v1, const std::complex< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const negator< P > &v1, const negator< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const P &v1, const negator< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const negator< P > &v1, const P &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const negator< std::complex< P > > &v1, const conjugate< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const negator< conjugate< P > > &v1, const std::complex< P > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const std::complex< P > &v1, const negator< conjugate< P > > &v2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const conjugate< P > &v1, const negator< std::complex< P > > &v2, int n, double tol=defTol< P >())
 
template<int M, class E1 , int S1, class E2 , int S2>
static bool numericallyEqual (const Vec< M, E1, S1 > &v1, const Vec< M, E2, S2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<int N, class E1 , int S1, class E2 , int S2>
static bool numericallyEqual (const Row< N, E1, S1 > &v1, const Row< N, E2, S2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<int M, int N, class E1 , int CS1, int RS1, class E2 , int CS2, int RS2>
static bool numericallyEqual (const Mat< M, N, E1, CS1, RS1 > &v1, const Mat< M, N, E2, CS2, RS2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<int N, class E1 , int S1, class E2 , int S2>
static bool numericallyEqual (const SymMat< N, E1, S1 > &v1, const SymMat< N, E2, S2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const VectorView_< E1 > &v1, const VectorView_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const Vector_< E1 > &v1, const Vector_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const Vector_< E1 > &v1, const VectorView_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const VectorView_< E1 > &v1, const Vector_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const RowVectorView_< E1 > &v1, const RowVectorView_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const RowVector_< E1 > &v1, const RowVector_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const RowVector_< E1 > &v1, const RowVectorView_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const RowVectorView_< E1 > &v1, const RowVector_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const MatrixView_< E1 > &v1, const MatrixView_< E2 > &v2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const Matrix_< E1 > &m1, const Matrix_< E2 > &m2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const Matrix_< E1 > &m1, const MatrixView_< E2 > &m2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class E1 , class E2 >
static bool numericallyEqual (const MatrixView_< E1 > &m1, const Matrix_< E2 > &m2, int n, double tol=(defTol2< E1, E2 >()))
 
template<class P >
static bool numericallyEqual (const Rotation_< P > &R1, const Rotation_< P > &R2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const Transform_< P > &T1, const Transform_< P > &T2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const UnitInertia_< P > &G1, const UnitInertia_< P > &G2, int n, double tol=defTol< P >())
 
template<class P >
static bool numericallyEqual (const Inertia_< P > &I1, const Inertia_< P > &I2, int n, double tol=defTol< P >())
 
static Real randReal ()
 
static Complex randComplex ()
 
static Conjugate randConjugate ()
 
static float randFloat ()
 
static double randDouble ()
 
template<int M>
static Vec< M > randVec ()
 
template<int N>
static Row< N > randRow ()
 
template<int M, int N>
static Mat< M, N > randMat ()
 
template<int N>
static SymMat< N > randSymMat ()
 
static Vector randVector (int m)
 
static Matrix randMatrix (int m, int n)
 
static Vec3 randVec3 ()
 
static Mat33 randMat33 ()
 
static SymMat33 randSymMat33 ()
 
static SpatialVec randSpatialVec ()
 
static SpatialMat randSpatialMat ()
 
static Rotation randRotation ()
 
static Transform randTransform ()
 

Detailed Description

This is the main class to support testing.

Objects of this type are created by the SimTK_START_TEST macro; don't allocate them directly. The class name appears directly in tests only for access to its static members like Test::randMatrix().

Constructor & Destructor Documentation

◆ Test()

SimTK::Test::Test ( const std::string &  name)
inline

◆ ~Test()

SimTK::Test::~Test ( )
inline

Member Function Documentation

◆ defTol()

template<class T >
static double SimTK::Test::defTol ( )
inlinestatic

◆ defTol2()

template<class T1 , class T2 >
static double SimTK::Test::defTol2 ( )
inlinestatic

◆ numericallyEqual() [1/45]

static bool SimTK::Test::numericallyEqual ( float  v1,
float  v2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [2/45]

static bool SimTK::Test::numericallyEqual ( double  v1,
double  v2,
int  n,
double  tol = defTol<double>() 
)
inlinestatic

◆ numericallyEqual() [3/45]

static bool SimTK::Test::numericallyEqual ( int  i1,
int  i2,
int  n,
double  tol = 0 
)
inlinestatic

◆ numericallyEqual() [4/45]

static bool SimTK::Test::numericallyEqual ( unsigned  u1,
unsigned  u2,
int  n,
double  tol = 0 
)
inlinestatic

◆ numericallyEqual() [5/45]

static bool SimTK::Test::numericallyEqual ( float  v1,
double  v2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [6/45]

static bool SimTK::Test::numericallyEqual ( double  v1,
float  v2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [7/45]

static bool SimTK::Test::numericallyEqual ( int  i1,
float  f2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [8/45]

static bool SimTK::Test::numericallyEqual ( float  f1,
int  i2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [9/45]

static bool SimTK::Test::numericallyEqual ( unsigned  i1,
float  f2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [10/45]

static bool SimTK::Test::numericallyEqual ( float  f1,
unsigned  i2,
int  n,
double  tol = defTol<float>() 
)
inlinestatic

◆ numericallyEqual() [11/45]

static bool SimTK::Test::numericallyEqual ( int  i1,
double  f2,
int  n,
double  tol = defTol<double>() 
)
inlinestatic

◆ numericallyEqual() [12/45]

static bool SimTK::Test::numericallyEqual ( double  f1,
int  i2,
int  n,
double  tol = defTol<double>() 
)
inlinestatic

◆ numericallyEqual() [13/45]

static bool SimTK::Test::numericallyEqual ( unsigned  i1,
double  f2,
int  n,
double  tol = defTol<double>() 
)
inlinestatic

◆ numericallyEqual() [14/45]

static bool SimTK::Test::numericallyEqual ( double  f1,
unsigned  i2,
int  n,
double  tol = defTol<double>() 
)
inlinestatic

◆ numericallyEqual() [15/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const std::complex< P > &  v1,
const std::complex< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [16/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const conjugate< P > &  v1,
const conjugate< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [17/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const std::complex< P > &  v1,
const conjugate< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [18/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const conjugate< P > &  v1,
const std::complex< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [19/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const negator< P > &  v1,
const negator< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [20/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const P &  v1,
const negator< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [21/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const negator< P > &  v1,
const P &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [22/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const negator< std::complex< P > > &  v1,
const conjugate< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [23/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const negator< conjugate< P > > &  v1,
const std::complex< P > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [24/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const std::complex< P > &  v1,
const negator< conjugate< P > > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [25/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const conjugate< P > &  v1,
const negator< std::complex< P > > &  v2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [26/45]

template<int M, class E1 , int S1, class E2 , int S2>
static bool SimTK::Test::numericallyEqual ( const Vec< M, E1, S1 > &  v1,
const Vec< M, E2, S2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [27/45]

template<int N, class E1 , int S1, class E2 , int S2>
static bool SimTK::Test::numericallyEqual ( const Row< N, E1, S1 > &  v1,
const Row< N, E2, S2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [28/45]

template<int M, int N, class E1 , int CS1, int RS1, class E2 , int CS2, int RS2>
static bool SimTK::Test::numericallyEqual ( const Mat< M, N, E1, CS1, RS1 > &  v1,
const Mat< M, N, E2, CS2, RS2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [29/45]

template<int N, class E1 , int S1, class E2 , int S2>
static bool SimTK::Test::numericallyEqual ( const SymMat< N, E1, S1 > &  v1,
const SymMat< N, E2, S2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [30/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const VectorView_< E1 > &  v1,
const VectorView_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [31/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const Vector_< E1 > &  v1,
const Vector_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [32/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const Vector_< E1 > &  v1,
const VectorView_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [33/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const VectorView_< E1 > &  v1,
const Vector_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [34/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const RowVectorView_< E1 > &  v1,
const RowVectorView_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [35/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const RowVector_< E1 > &  v1,
const RowVector_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [36/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const RowVector_< E1 > &  v1,
const RowVectorView_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [37/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const RowVectorView_< E1 > &  v1,
const RowVector_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [38/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const MatrixView_< E1 > &  v1,
const MatrixView_< E2 > &  v2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [39/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const Matrix_< E1 > &  m1,
const Matrix_< E2 > &  m2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [40/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const Matrix_< E1 > &  m1,
const MatrixView_< E2 > &  m2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [41/45]

template<class E1 , class E2 >
static bool SimTK::Test::numericallyEqual ( const MatrixView_< E1 > &  m1,
const Matrix_< E2 > &  m2,
int  n,
double  tol = (defTol2<E1,E2>()) 
)
inlinestatic

◆ numericallyEqual() [42/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const Rotation_< P > &  R1,
const Rotation_< P > &  R2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [43/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const Transform_< P > &  T1,
const Transform_< P > &  T2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [44/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const UnitInertia_< P > &  G1,
const UnitInertia_< P > &  G2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ numericallyEqual() [45/45]

template<class P >
static bool SimTK::Test::numericallyEqual ( const Inertia_< P > &  I1,
const Inertia_< P > &  I2,
int  n,
double  tol = defTol<P>() 
)
inlinestatic

◆ randReal()

static Real SimTK::Test::randReal ( )
inlinestatic

◆ randComplex()

static Complex SimTK::Test::randComplex ( )
inlinestatic

◆ randConjugate()

static Conjugate SimTK::Test::randConjugate ( )
inlinestatic

◆ randFloat()

static float SimTK::Test::randFloat ( )
inlinestatic

◆ randDouble()

static double SimTK::Test::randDouble ( )
inlinestatic

◆ randVec()

template<int M>
static Vec< M > SimTK::Test::randVec ( )
inlinestatic

◆ randRow()

template<int N>
static Row< N > SimTK::Test::randRow ( )
inlinestatic

◆ randMat()

template<int M, int N>
static Mat< M, N > SimTK::Test::randMat ( )
inlinestatic

◆ randSymMat()

template<int N>
static SymMat< N > SimTK::Test::randSymMat ( )
inlinestatic

◆ randVector()

static Vector SimTK::Test::randVector ( int  m)
inlinestatic

◆ randMatrix()

static Matrix SimTK::Test::randMatrix ( int  m,
int  n 
)
inlinestatic

◆ randVec3()

static Vec3 SimTK::Test::randVec3 ( )
inlinestatic

◆ randMat33()

static Mat33 SimTK::Test::randMat33 ( )
inlinestatic

◆ randSymMat33()

static SymMat33 SimTK::Test::randSymMat33 ( )
inlinestatic

◆ randSpatialVec()

static SpatialVec SimTK::Test::randSpatialVec ( )
inlinestatic

◆ randSpatialMat()

static SpatialMat SimTK::Test::randSpatialMat ( )
inlinestatic

◆ randRotation()

static Rotation SimTK::Test::randRotation ( )
inlinestatic

◆ randTransform()

static Transform SimTK::Test::randTransform ( )
inlinestatic

The documentation for this class was generated from the following file: