C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
math_define.h File Reference

Base macros and functions. More...

#include <system_types.h>
#include <assert.h>
#include <algorithm>
#include <utility>
#include <vector>
#include <set>

Namespaces

 c3d
 C3D namespace declaration.
 

Macros

#define PRECONDITION(expr)   ((void)0)
 The PRECONDITION definition.
 
#define CALL_DECLARATION
 The CALL_DECLARATION definition. More...
 
#define EXPORT_DECLARATION
 The EXPORT_DECLARATION definition. More...
 
#define OBVIOUS_PRIVATE_COPY(ClassName)
 The declaration of assignment operator and copy constructor. More...
 
#define COUNTOF(array)   (sizeof(array)/sizeof(array[0]))
 Get the number of array elements.
 
#define MATH_CLASS   __attribute__ ((visibility ("default")))
 The declaration of export or import classes. More...
 

Typedefs

typedef std::pair< size_t, size_t > c3d::IndicesPair
 Pair of non-negative integer indices.
 
typedef std::pair< ptrdiff_t, ptrdiff_t > c3d::NumbersPair
 Pair of integer numbers.
 
typedef std::pair< uint, uint > c3d::UintPair
 Pair of 32-bit non-negative integer indices.
 
typedef std::pair< bool, bool > c3d::BoolPair
 Bool pair.
 
typedef std::pair< double, double > c3d::DoublePair
 Pair of doubles.
 
typedef std::pair< IndicesPair, double > c3d::IndicesPairDouble
 A pair of indices and double.
 
typedef std::pair< double, IndicesPair > c3d::DoubleIndicesPair
 Double and a pair of indices.
 
typedef std::pair< size_t, bool > c3d::IndexBool
 Index-double pair.
 
typedef std::pair< bool, size_t > c3d::BoolIndex
 Double-index pair.
 
typedef std::pair< ptrdiff_t, bool > c3d::NumberBool
 Index-double pair.
 
typedef std::pair< bool, ptrdiff_t > c3d::BoolNumber
 Double-index pair.
 
typedef std::pair< size_t, double > c3d::IndexDouble
 Index-double pair.
 
typedef std::pair< double, size_t > c3d::DoubleIndex
 Double-index pair.
 
typedef std::pair< bool, double > c3d::FlagDouble
 Flag-double pair.
 
typedef std::pair< double, bool > c3d::DoubleFlag
 Double-flag pair.
 
typedef FlagDouble c3d::BoolDouble
 Flag-double pair.
 
typedef DoubleFlag c3d::DoubleBool
 Double-flag pair.
 
typedef std::vector< size_t > c3d::IndicesVector
 Vector of non-negative integer indices.
 
typedef std::vector< ptrdiff_t > c3d::NumbersVector
 Vector of integer numbers.
 
typedef std::vector< uint > c3d::UintVector
 Vector of 32-bit non-negative integer indices.
 
typedef std::vector< bool > c3d::BoolVector
 Bool vector.
 
typedef std::vector< double > c3d::DoubleVector
 Double vector.
 
typedef std::vector< IndicesPair > c3d::IndicesPairsVector
 Vector of pairs of non-negative integer indices.
 
typedef std::vector< NumbersPair > c3d::NumbersPairsVector
 Vector of pairs of integer indices.
 
typedef std::vector< DoublePair > c3d::DoublePairsVector
 Vector of double pairs.
 
typedef std::set< size_t > c3d::IndicesSet
 Set of non-negative integer indices.
 
typedef std::set< ptrdiff_t > c3d::NumbersSet
 Set of integer numbers.
 
typedef std::set< uint > c3d::UintSet
 Set of 32-bit non-negative integer indices.
 
typedef std::set< UintPair > c3d::UintPairsSet
 Set of pairs of 32-bit non-negative integer indices.
 
typedef std::set< IndicesPair > c3d::IndicesPairsSet
 Set of pairs of non-negative integer indices.
 
typedef std::pair< IndicesPair, IndicesPair > c3d::IndicesPairsPair
 Pair of indices' pair.
 

Functions

template<class ItemPtr >
bool c3d::IsNullPointer (const ItemPtr *itemPtr)
 Null pointer check . More...
 
template<class ElementsVector >
void c3d::UniqueSortVector (ElementsVector &items)
 Sorting an array with removing duplicates. More...
 
template<class ElementsVector , class Element >
size_t c3d::DirectSearch (const ElementsVector &items, const Element &item)
 Finding an element in a unsorted array. More...
 
template<class ElementsVector , class Element >
size_t c3d::BinarySearch (const ElementsVector &items, const Element &item)
 Finding an element in a sorted array. More...
 
template<class Point >
bool c3d::EqualPoints (const Point &p1, const Point &p2, double eps)
 Check points for equality. More...
 
template<class Point >
bool c3d::EqualPoints (const Point &p1, const Point &p2, double xEpsilon, double yEpsilon)
 Check points for equality. More...
 
template<class Point >
bool c3d::EqualPoints (const Point &p1, const Point &p2, double xEpsilon, double yEpsilon, double zEpsilon)
 Check points for equality. More...
 
template<class Vector >
bool c3d::EqualVectors (const Vector &p1, const Vector &p2, double eps)
 Check equality of vectors with given tolerance. More...
 
template<class Vector >
bool c3d::EqualVectors (const Vector &p1, const Vector &p2, double xEpsilon, double yEpsilon)
 Check equality of vectors with given tolerance. More...
 
template<class Vector >
bool c3d::EqualVectors (const Vector &p1, const Vector &p2, double xEpsilon, double yEpsilon, double zEpsilon)
 Check equality of vectors with given tolerance. More...
 
template<class Matrix >
bool c3d::EqualMatrices (const Matrix &m1, const Matrix &m2, double accuracy)
 Compare matrices. More...
 
template<class BBox >
bool c3d::EqualCubes (const BBox &c1, const BBox &c2, double eps)
 Check for equality of boxes with controlled tolerance. More...
 
void c3d::GetCosSin (const double &tt, double &cosT, double &sinT)
 Calculation of the cosine and sine. More...
 
template<class T >
T::iterator c3d::older_stl_support::erase (T &obj, typename T::iterator pos)
 "iterator erase( iterator pos )" surrogate for older versions of std:map and std:: set.. More...
 

Variables

constexpr size_t c3d::MATRIX_MAX_COUNT = 1000000000
 Maximum number of MxN matrix elements.
 
constexpr size_t c3d::ARRAY_MAX_COUNT = 1000000
 Maximum size of array.
 

Detailed Description

Base macros and functions.