geomc 1.0
A c++ linear algebra template library
Classes | Typedefs | Enumerations | Functions
geom Namespace Reference

Namespace of all geomc functions and classes. More...

Classes

class  AffineTransform
 Affine transformation class. More...
 
class  AnyConvex
 Helper class which virtualizes the static polymorphism of Convex shapes. More...
 
class  AnyConvexImpl
 Implementation of AnyConvex for a specific Shape. More...
 
class  BinLatticePartition
 
class  BinopExpr
 
class  Bounded
 Base class describing shapes with finite extents in N dimensions. More...
 
class  CircularBuffer
 A lightweight circular buffer. More...
 
class  ComposedExpr
 
class  ConstExpr
 
class  ConstSubtree
 An const iterator to a subtree. More...
 
struct  ConstType
 
struct  ConstType< T, false >
 
struct  ConstType< T, true >
 
class  Convex
 Base class describing convex shapes in N-dimensional space. More...
 
struct  CoordType
 
struct  CoordType< Vec< T, N > >
 
class  Cylinder
 An N-dimensional cylinder, given by its radius and endpoints. More...
 
class  DiagMatrix
 A matrix with nonzero elements only along the main diagonal. More...
 
class  Dilated
 A wrapper shape which dilates the extents of another Shape. More...
 
struct  Dimension
 Defines a type for storing a length or element count. More...
 
struct  Dimension< DYNAMIC_DIM >
 
class  DimensionMismatchException
 
class  Dual
 Class implementing the dual numbers, whose arithmetic operations perform a simultaneous calculation of the first derivative. More...
 
class  Expr
 
class  Extrusion
 An axis-aligned extrusion of an arbitrary N-1 dimensional Convex shape. More...
 
class  FlatMatrixLayout
 
class  FlatMatrixLayout< T, COL_MAJOR >
 
class  Frustum
 An N-dimensional frustum (truncated pyramid) with an arbitrary Convex shape as its base, and its (possibly excluded) point at the origin. More...
 
struct  GenericStorage
 Array storage with templated static or dynamic size, and template-selectable ownership policy. More...
 
struct  GenericStorage< T, N, STORAGE_UNIQUE >
 
struct  GenericStorage< T, N, STORAGE_WRAPPED >
 
class  GeomException
 
class  GridIterator
 Iterator over the integer points in an N-dimensional grid. More...
 
class  GridIterator< T, 1, Order >
 
struct  implements_shape_concept
 Informational class which reveals whether its Shape parameter implements the shape concept Concept. More...
 
struct  implements_shape_concept< Dilated< Shape >, Convex >
 
struct  implements_shape_concept< Dilated< Shape >, Projectable >
 
struct  implements_shape_concept< Extrusion< Shape >, Convex >
 
struct  implements_shape_concept< Extrusion< Shape >, Projectable >
 
struct  implements_shape_concept< Extrusion< Shape >, RayIntersectable >
 
struct  implements_shape_concept< Extrusion< Shape >, SdfEvaluable >
 
struct  implements_shape_concept< Frustum< Shape >, Convex >
 
struct  implements_shape_concept< Frustum< Shape >, RayIntersectable >
 
struct  implements_shape_concept< Oriented< Shape >, Convex >
 
struct  implements_shape_concept< Oriented< Shape >, RayIntersectable >
 
class  KDTree
 A hierarchical spatial index. More...
 
class  LCRand
 Implements a linear congruential pseudorandom number generator with period 264. More...
 
class  MatrixHandle
 A generic matrix class which can hold references to all other matrix types. More...
 
class  MatrixWrapper
 
class  MixExpr
 
class  MTRand
 Mersenne twister pseudorandom number generator. More...
 
class  NonsquareMatrixException
 
class  NullExpr
 
class  Oriented
 A wrapper shape which orients another arbitrary shape with an AffineTransform. More...
 
class  Oriented< Rect< T, N > >
 Partial specialization of Oriented for Rects. More...
 
class  Path
 
class  PathExpr
 
class  PerlinNoise
 Real-valued smooth noise over N dimensions. More...
 
class  PerlinNoiseExpr
 
class  PermutationMatrix
 A matrix which, by multiplication, permutes the rows or columns of another matrix. More...
 
class  Plane
 A geometric plane or hyperplane. More...
 
class  PLUDecomposition
 
struct  PointType
 
struct  PointType< T, 1 >
 
class  Projectable
 Base class describing N-dimensional shapes which implement the ability to project an arbitrary point to the nearest point on their surface. More...
 
class  Quat
 Quaternion class. More...
 
class  Random
 Abstraction for a source of random or pseudorandom bits. More...
 
class  Raster
 An M-dimensional grid of interpolated data which can be continuously sampled. More...
 
class  Ray
 Ray class. More...
 
class  RayIntersectable
 Base class describing N-dimensional shapes which can be intersection-tested with a Ray. More...
 
class  Rect
 An N-dimensional axis-aligned interval. More...
 
class  Sampler
 A class for randomly sampling a variety of regions over RN space. More...
 
struct  SampleShape
 
struct  SampleShape< Rect< T, N > >
 
struct  SampleShape< Simplex< T, N > >
 
struct  SampleShape< Sphere< T, N > >
 
class  SdfEvaluable
 Base class describing N-dimensional shapes which implement a signed distance function. More...
 
struct  shape_traits
 Informational class which describes its template parameter shape. More...
 
struct  ShapeDistribution
 Implements the RandomDistribution concept. More...
 
class  SimpleMatrix
 A basic matrix with M x N elements. More...
 
class  Simplex
 A simplex in N dimensions (e.g. a tetrahedron, triangle, line, point). More...
 
struct  SizedStorage
 Array storage with templated static or dynamic size. If the array is dynamic, its length is stored internally and can be queried. More...
 
struct  SizedStorage< T, DYNAMIC_DIM >
 
class  SmallStorage
 Array storage which does not allocate from the heap unless the requested size is larger than a threshhold, N. More...
 
class  Sphere
 A N-dimensional circle, sphere, or hypersphere. More...
 
class  SphericalHarmonics
 Class and methods for representing band-limited functions on the surface of a 3D sphere. More...
 
class  SphericalSector
 A N-dimensional circle, sphere, or hypersphere. More...
 
class  StackedExpr
 
struct  Storage
 Array storage with templated static or dynamic size. More...
 
struct  Storage< T, DYNAMIC_DIM >
 
struct  storage_token_t
 
class  Subtree
 A non-const iterator to a subtree. More...
 
class  SubtreeBase
 Base class for all iterators into Trees. More...
 
class  TransformedExpr
 
struct  TransposeIterator
 
class  Tree
 A dynamic tree of arbitrary arity. More...
 
class  UnaryOpExpr
 
struct  UniqueStorage
 Array storage with templated static or dynamic size, and without reference counting. More...
 
struct  UniqueStorage< T, DYNAMIC_DIM >
 
struct  UnmanagedStorage
 
class  Vec
 A tuple of N elements of type T. More...
 
class  Vec< T, 2 >
 2D specialization of vector class. More...
 
class  Vec< T, 3 >
 3D specialization of vector class. More...
 
class  Vec< T, 4 >
 4D specialization of vector class. More...
 
struct  VectorDimension
 
struct  VectorDimension< Vec< T, M > >
 
struct  WrappedStorage
 Array storage with templated static or dynamic size, acting as a thin, templated wrapper around a bare array which is memory managed by the caller. More...
 
class  XoshiroRand
 
class  ZonalHarmonics
 Represents a function on the N-sphere with axial symmetry. More...
 

Typedefs

typedef Vec< double, 2 > Vec2d
 
typedef Vec< float, 2 > Vec2f
 
typedef Vec< index_t, 2 > Vec2i
 
typedef Vec< double, 3 > Vec3d
 
typedef Vec< float, 3 > Vec3f
 
typedef Vec< index_t, 3 > Vec3i
 
typedef Vec< double, 4 > Vec4d
 
typedef Vec< float, 4 > Vec4f
 
typedef Vec< index_t, 4 > Vec4i
 
typedef Quat< double > Quatd
 
typedef Quat< float > Quatf
 
typedef Ray< double, 4 > Ray4d
 
typedef Ray< double, 3 > Ray3d
 
typedef Ray< double, 2 > Ray2d
 
typedef Ray< float, 4 > Ray4f
 
typedef Ray< float, 3 > Ray3f
 
typedef Ray< float, 2 > Ray2f
 
typedef Ray< index_t, 4 > Ray4i
 
typedef Ray< index_t, 3 > Ray3i
 
typedef Ray< index_t, 2 > Ray2i
 
typedef SimpleMatrix< double, 4, 4 > SimpleMatrix4d
 
typedef SimpleMatrix< double, 3, 3 > SimpleMatrix3d
 
typedef SimpleMatrix< double, 2, 2 > SimpleMatrix2d
 
typedef SimpleMatrix< double, 0, 0 > SimpleMatrixNd
 
typedef SimpleMatrix< float, 4, 4 > SimpleMatrix4f
 
typedef SimpleMatrix< float, 3, 3 > SimpleMatrix3f
 
typedef SimpleMatrix< float, 2, 2 > SimpleMatrix2f
 
typedef SimpleMatrix< float, 0, 0 > SimpleMatrixNf
 
typedef AffineTransform< double, 3 > AffineTransform3d
 
typedef AffineTransform< double, 2 > AffineTransform2d
 
typedef AffineTransform< float, 3 > AffineTransform3f
 
typedef AffineTransform< float, 2 > AffineTransform2f
 
typedef Rect< index_t, 2 > MatrixRegion
 

Enumerations

enum class  DiscontinuityPolicy {
  NaN , Average , Left , Right ,
  Inf
}
 Policy for handling discontinuous derivatives. More...
 
enum  EdgeBehavior { EDGE_CLAMP , EDGE_PERIODIC , EDGE_MIRROR , EDGE_CONSTANT }
 Raster edge-sampling behavior. More...
 
enum  Interpolation { INTERP_NEAREST , INTERP_LINEAR , INTERP_CUBIC }
 Behavior for sampling between data points. More...
 
enum  MatrixLayout { ROW_MAJOR , COL_MAJOR }
 
enum class  KDAxisChoice { AXIS_LONGEST , AXIS_HIGHEST_VARIANCE , AXIS_CYCLICAL }
 Strategy for choosing an axis along which to split a group of objects in a spatial index. More...
 
enum class  KDPivotChoice { PIVOT_MEAN , PIVOT_MEDIAN }
 Strategy for choosing the pivot value when splitting a group of objects in a spatial index. More...
 
enum class  KDInsertionChoice { INSERT_SMALLEST_VOLUME_INCREASE , INSERT_SHORTEST_DISTANCE }
 Strategy for insertion of an object into an existing tree. More...
 
enum  ArrayOrder { ARRAYORDER_FIRST_DIM_CONSECUTIVE , ARRAYORDER_LAST_DIM_CONSECUTIVE }
 Array traversal order, specified in terms of which axes to increment first. More...
 
enum  StoragePolicy { STORAGE_SHARED , STORAGE_UNIQUE , STORAGE_WRAPPED }
 

Functions

template<typename T , index_t N>
void legendre (SphericalHarmonics< T, N > *sh, index_t m, T x)
 
template<typename T >
legendre (index_t l, index_t m, T x)
 
template<typename T >
legendre (index_t n, T x)
 
template<typename T >
legendre_integral (index_t n, T x)
 
template<typename T >
chebyshev (index_t kind, index_t n, T x)
 
template<typename A , typename B , typename O >
add_o (A a, B b)
 
template<typename A , typename B , typename O >
mul_o (A a, B b)
 
template<typename A , typename B , typename O >
lt_o (A a, B b)
 
template<typename A , typename B , typename O >
gt_o (A a, B b)
 
template<typename A , typename B , typename O >
eq_o (A a, B b)
 
template<typename A , typename B , typename O >
leq_o (A a, B b)
 
template<typename A , typename B , typename O >
geq_o (A a, B b)
 
template<typename A , typename B , typename O >
min_o (A a, B b)
 
template<typename A , typename B , typename O >
max_o (A a, B b)
 
template<typename I >
null_fn (I i)
 
template<typename T , index_t N, index_t M>
Vec< T, N > vec_reorder (Vec< T, M > sample, Vec< index_t, M > idxs)
 
template<typename T , index_t N>
Vec< T, N+1 > vec_collapse (Vec< T, N > input, T result)
 
template<typename I , typename O >
boost::shared_ptr< Expr< I, O > > expr (O v)
 
template<typename I >
boost::shared_ptr< Expr< I, I > > nullx ()
 
template<typename I , typename O , typename A , typename B >
boost::shared_ptr< Expr< I, O > > binopx (boost::shared_ptr< Expr< I, A > > a, boost::shared_ptr< Expr< I, B > > b, O(*func)(A, B), string opname)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > unopx (boost::shared_ptr< Expr< I, E > > a, O(*func)(E), string opname)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > compose (boost::shared_ptr< Expr< I, E > > input_fn, boost::shared_ptr< Expr< E, O > > output_fn)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > mixx (boost::shared_ptr< Expr< I, E > > k, boost::shared_ptr< Expr< I, O > > a, boost::shared_ptr< Expr< I, O > > b)
 
template<typename I , typename O >
boost::shared_ptr< Expr< I, O > > minx (boost::shared_ptr< Expr< I, O > > a, boost::shared_ptr< Expr< I, O > > b)
 
template<typename I , typename O >
boost::shared_ptr< Expr< I, O > > maxx (boost::shared_ptr< Expr< I, O > > a, boost::shared_ptr< Expr< I, O > > b)
 
template<typename T , index_t N, typename O >
boost::shared_ptr< Expr< Vec< T, N >, O > > transformx (boost::shared_ptr< Expr< Vec< T, N >, O > > e, AffineTransform< T, N > xf)
 
template<typename T , index_t N, index_t M, typename O >
boost::shared_ptr< Expr< Vec< T, M >, O > > slicex (boost::shared_ptr< Expr< Vec< T, N >, O > > sliced, boost::shared_ptr< Expr< Vec< T, M >, Vec< index_t, M > > > slicefn)
 
template<typename T , index_t N, index_t M, typename O >
boost::shared_ptr< Expr< Vec< T, M >, O > > slicex (boost::shared_ptr< Expr< Vec< T, N >, O > > sliced, Vec< index_t, M > sliceorder)
 
template<typename I , typename T , index_t N>
boost::shared_ptr< Expr< I, Vec< T, N > > > stackx (boost::shared_ptr< Expr< I, T > > stack_fns[N])
 
template<typename T , index_t N>
boost::shared_ptr< Expr< Vec< T, N >, Vec< T, N+1 > > > hypersurfacex (boost::shared_ptr< Expr< Vec< T, N >, T > > surface)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > operator+ (boost::shared_ptr< Expr< I, O > > a, boost::shared_ptr< Expr< I, E > > b)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > operator+ (boost::shared_ptr< Expr< I, O > > x, E v)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > operator+ (E v, boost::shared_ptr< Expr< I, O > > x)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > operator* (boost::shared_ptr< Expr< I, O > > x, E v)
 
template<typename I , typename O , typename E >
boost::shared_ptr< Expr< I, O > > operator* (E v, boost::shared_ptr< Expr< I, O > > x)
 
template<typename I , typename O >
boost::shared_ptr< Expr< I, O > > operator* (boost::shared_ptr< Expr< I, O > > a, boost::shared_ptr< Expr< I, O > > b)
 
template<typename I , typename O >
std::ostream & operator<< (std::ostream &s, boost::shared_ptr< Expr< I, O > > f)
 
template<typename T >
spherical_harmonic_coeff (index_t l, index_t m, T cos_alt, T azi)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *into, T x, T y, T z, T theta)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *into, const Vec< T, 3 > &axis, T theta)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *into, const Quat< T > &q)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *into, T x, T y, T z, T px, T py, T pz, T theta)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *into, Vec< T, 3 > axis, Vec< T, 3 > ctr, T theta)
 
template<typename T >
void rotmat_direction_align (SimpleMatrix< T, 4, 4 > *into, const Vec< T, 3 > &dir, const Vec< T, 3 > &alignWith)
 
template<typename T >
void rotmat_direction_align (SimpleMatrix< T, 3, 3 > *into, const Vec< T, 3 > &dir, const Vec< T, 3 > &alignWith)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *out_mat, SimpleMatrix< T, 4, 4 > *out_inv, T x, T y, T z, T px, T py, T pz, T theta)
 
template<typename T >
void rotmat (SimpleMatrix< T, 4, 4 > *out_mat, SimpleMatrix< T, 4, 4 > *out_inv, const Vec< T, 3 > &axis, const Vec< T, 3 > &ctr, T theta)
 
template<typename Ma , typename Mb >
bool mtx_aliases_storage (const Ma &a, const Mb &b)
 
template<typename T , index_t N>
bool mtx_aliases_storage (const Vec< T, N > &a, const Vec< T, N > &b)
 
template<typename Matrix , typename Matrix1 , typename Matrix2 >
Matrix & mul (Matrix *into, const Matrix1 &a, const Matrix2 &b)
 
template<typename Md , typename Ma , typename Mb >
std::enable_if< detail::MatrixMultipliable< Ma, Mb >::valanddetail::_ImplMtxResult< Ma, Mb, Md >::agreement==detail::MTX_RESULT_MATCH, Md & >::type mul (Md *into, const Ma &a, const Mb &b)
 
template<typename Md , typename Ma , typename Mb >
std::enable_if< detail::MatrixMultipliable< Ma, Mb >::valanddetail::_ImplMtxResult< Ma, Mb, Md >::agreement==detail::MTX_RESULT_UNKNOWN, Md & >::type mul (Md *into, const Ma &a, const Mb &b)
 
template<typename Matrix1 , typename Matrix2 >
Matrix mul (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
std::enable_if< detail::MatrixMultipliable< Ma, Mb >::val, typenamedetail::_ImplMtxMul< Ma, Mb >::return_t >::type mul (const Ma &a, const Mb &b)
 
template<typename T , index_t M, index_t N, MatrixLayout Lyt, StoragePolicy P>
std::enable_if< M *N==0orM==N, void >::type transpose (SimpleMatrix< T, M, N, Lyt, P > *into, const SimpleMatrix< T, M, N, Lyt, P > &m)
 
template<typename Matrix1 , typename Matrix2 >
void transpose (Matrix1 *into, const Matrix2 &m)
 
template<typename Md , typename Mx >
std::enable_if< detail::IsMatrix< Md >::valanddetail::IsMatrix< Mx >::valand(Md::ROWDIM==Mx::COLDIMorMd::ROWDIM *Mx::COLDIM==0) and(Md::COLDIM==Mx::ROWDIMorMd::COLDIM *Mx::ROWDIM==0), void >::type transpose (Md *into, const Mx &m)
 
template<typename Matrix1 >
Matrix transpose (const Matrix1 &m)
 
template<typename Mx >
std::enable_if< detail::IsMatrix< Mx >::val, typenamedetail::_ImplMtxTxpose< Mx >::return_t >::type transpose (const Mx &m)
 
template<typename Matrix1 , typename Matrix2 >
bool inv (Matrix1 *into, const Matrix2 &src)
 
template<typename Md , typename Mx >
bool inv (Md *into, const Mx &src, M_ENABLE_IF((detail::MatrixDimensionMatch< Md, Mx >::isStaticMatch and(Mx::ROWDIM==Mx::COLDIM or Mx::ROWDIM *Mx::COLDIM==DYNAMIC_DIM))))
 
template<typename Matrix1 >
Matrix inv (const Matrix1 &m, bool *success)
 
template<typename Mx >
detail::_ImplMtxInv< Mx >::return_t inv (const Mx &m, bool *success, M_ENABLE_IF(Mx::ROWDIM==Mx::COLDIM or Mx::ROWDIM *Mx::COLDIM==DYNAMIC_DIM))
 
template<typename Matrix , typename Matrix1 , typename Matrix2 >
void add (Matrix *d, const Matrix1 &a, const Matrix2 &b)
 
template<typename Md , typename Ma , typename Mb >
std::enable_if< detail::MatrixDimensionMatch< Ma, Mb >::isStaticMatchanddetail::MatrixDimensionMatch< Ma, Md >::isStaticMatch, void >::type add (Md *d, const Ma &a, const Mb &b)
 
template<typename Matrix , typename Matrix1 , typename Matrix2 >
void sub (Matrix *d, const Matrix1 &a, const Matrix2 &b)
 
template<typename Md , typename Ma , typename Mb >
std::enable_if< detail::MatrixDimensionMatch< Ma, Mb >::isStaticMatchanddetail::MatrixDimensionMatch< Ma, Md >::isStaticMatch, void >::type sub (Md *d, const Ma &a, const Mb &b)
 
template<typename Matrix1 , typename Matrix2 >
Matrix add (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
std::enable_if< detail::MatrixDimensionMatch< Ma, Mb >::isStaticMatch, typenamedetail::_ImplMatrixAdd< Ma, Mb >::return_t >::type add (const Ma &a, const Mb &b)
 
template<typename Matrix1 , typename Matrix2 >
Matrix sub (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
std::enable_if< detail::MatrixDimensionMatch< Ma, Mb >::isStaticMatch, typenamedetail::_ImplMatrixAdd< Ma, Mb >::return_t >::type sub (const Ma &a, const Mb &b)
 
template<typename U typename Matrix, typename Matrix >
void scale (Matrix1 *d, U k, const Matrix &m)
 
template<typename U , typename Mx , typename Md >
std::enable_if< detail::IsMatrix< Mx >::valandstd::is_scalar< U >::valueanddetail::MatrixDimensionMatch< Mx, Md >::isStaticMatch, void >::type scale (Md *d, U k, const Mx &m)
 
template<typename U , typename Matrix >
Matrix scale (U k, const Matrix &m)
 
template<typename U , typename Mx >
std::enable_if< detail::IsMatrix< Mx >::valandstd::is_scalar< U >::value, typenamedetail::_ImplMatrixScale< Mx >::return_t >::type scale (U k, const Mx &m)
 
template<typename U , typename Matrix >
Matrix operator* (U k, const Matrix &m)
 
template<typename U , typename Mx >
std::enable_if< detail::IsMatrix< Mx >::valandstd::is_scalar< U >::value, typenamedetail::_ImplMatrixScale< Mx >::return_t >::type operator* (U k, const Mx &m)
 
template<typename U , typename Matrix >
Matrix operator* (const Matrix &m, U k)
 
template<typename U , typename Mx >
std::enable_if< detail::IsMatrix< Mx >::valandstd::is_scalar< U >::value, typenamedetail::_ImplMatrixScale< Mx >::return_t >::type operator* (const Mx &m, U k)
 
template<typename Matrix1 , typename Matrix2 >
Matrix operator+ (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
detail::_ImplMatrixAddReturnType< Ma, Mb >::return_t operator+ (const Ma &a, const Mb &b)
 
template<typename Matrix1 , typename Matrix2 >
Matrix operator- (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
detail::_ImplMatrixAddReturnType< Ma, Mb >::return_t operator- (const Ma &a, const Mb &b)
 
template<typename Matrix1 , typename Matrix2 >
Matrix operator* (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
detail::MatrixMultReturnType< Ma, Mb >::return_t operator* (const Ma &a, const Mb &b)
 
template<typename Matix , T , M , N >
Matrix & operator*= (Matrix &m, const DiagMatrix< T, M, N > &d)
 
template<typename Mx , typename T , index_t M, index_t N>
std::enable_if< detail::MatrixMultipliable< Mx, DiagMatrix< T, M, N > >::val, Mx & >::type operator*= (Mx &m, const DiagMatrix< T, M, N > &d)
 
template<typename Matrix1 , typename Matrix2 >
bool operator== (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
std::enable_if< detail::IsMatrix< Ma >::valanddetail::IsMatrix< Mb >::valanddetail::MatrixDimensionMatch< Ma, Mb >::isStaticMatch, bool >::type operator== (const Ma &a, const Mb &b)
 
template<typename Ma , typename Mb >
std::enable_if< detail::IsMatrix< Ma >::valanddetail::IsMatrix< Mb >::valandnotdetail::MatrixDimensionMatch< Ma, Mb >::isStaticMatch, bool >::type operator== (const Ma &a, const Mb &b)
 
template<typename Matrix1 , typename Matrix2 >
bool operator!= (const Matrix1 &a, const Matrix2 &b)
 
template<typename Ma , typename Mb >
std::enable_if< detail::IsMatrix< Ma >::valanddetail::IsMatrix< Mb >::val, bool >::type operator!= (const Ma &a, const Mb &b)
 
template<typename Matrix , typename Matrix1 >
void mtxcopy (Matrix *into, const Matrix1 &src)
 
template<typename Md , typename Ms >
void mtxcopy (Md *into, const Ms &src, typename std::enable_if< detail::LinalgDimensionMatch< Md, Ms >::val and(detail::_ImplVecOrient< Md, Ms >::orient !=detail::ORIENT_VEC_UNKNOWN), int >::type dummy=0)
 
template<typename Md , typename Ms >
void mtxcopy (Md *into, const Ms &src, typename std::enable_if< detail::_ImplVecOrient< Md, Ms >::orient==detail::ORIENT_VEC_UNKNOWN, int >::type dummy=0)
 
template<typename T >
det2x2 (T a, T b, T c, T d)
 Compute the 2x2 matrix determinant from individual parameters.
 
template<typename T >
det3x3 (const T m[9])
 Compute the 3x3 matrix determinant.
 
template<typename T >
det3x3 (T a, T b, T c, T d, T e, T f, T g, T h, T i)
 Compute the 3x3 matrix determinant from individual parameters.
 
template<typename T >
det4x4 (const T m[16])
 Compute the 4x4 matrix determinant.
 
template<typename T >
det_destructive (T *m, index_t n)
 Destructively compute the determinant of a square matrix. More...
 
template<typename T >
detNxN (const T *m, index_t n)
 Compute the determinant of a square matrix. More...
 
template<typename T , index_t M, index_t N, MatrixLayout Lyt, StoragePolicy P>
det (const SimpleMatrix< T, M, N, Lyt, P > &m)
 Compute the determinant of a square matrix. More...
 
template<typename T , MatrixLayout Lyt, StoragePolicy P>
det (const SimpleMatrix< T, 2, 2, Lyt, P > &m)
 
template<typename T , MatrixLayout Lyt, StoragePolicy P>
det (const SimpleMatrix< T, 3, 3, Lyt, P > &m)
 
template<typename T , MatrixLayout Lyt, StoragePolicy P>
det (const SimpleMatrix< T, 4, 4, Lyt, P > &m)
 
template<typename T , index_t N, index_t M>
det (const DiagMatrix< T, N, M > &m)
 Compute the determinant of a diagonal matrix. More...
 
template<index_t N>
index_t det (const PermutationMatrix< N > &m)
 Compute the determinant of a permutation matrix. More...
 
template<typename Ms , typename Md >
void copyMatrixRegion (const Ms &src, Md &dst, const MatrixRegion &src_region, const Vec< index_t, 2 > &dst_begin)
 
template<typename T >
void transpose_square_matrix (T *m, index_t n)
 Transpose a square matrix.
 
template<typename T , index_t N>
void transpose_square_matrix (T *m)
 Transpose a square matrix with static dimensions.
 
template<typename T >
bool inv2x2 (T *out, const T m[4])
 2 × 2 matrix inversion on a flat array. More...
 
template<typename T >
bool inv3x3 (T *out, const T m[9])
 3 × 3 matrix inversion on a flat array. More...
 
template<typename T >
bool inv4x4 (T *out, const T m[16])
 4 × 4 matrix inversion on a flat array. More...
 
template<typename T >
bool invNxN (T *out, T *m, index_t n)
 N × N matrix inversion on a flat array. More...
 
template<typename T , index_t N>
bool invNxN (T *out, T *m)
 N × N matrix inversion. More...
 
index_t permutation_sign (index_t *p, index_t n)
 Compute the sign of a permutation, resetting the permutation to identity in the process. More...
 
template<typename RandomAccessIterator >
void permutation_apply (index_t *p, index_t n, RandomAccessIterator v)
 Apply a permutation in-place, resetting the permutation to identity in the process. More...
 
template<typename T , index_t N>
Vec< T, N > orthogonal (const Vec< T, N > v[N-1])
 Return a vector orthogonal to the given N-1 vectors. More...
 
template<typename T >
Vec< T, 3 > orthogonal (const Vec< T, 3 > v[2])
 
template<typename T >
Vec< T, 2 > orthogonal (const Vec< T, 2 > v[1])
 
template<typename T , index_t N>
void nullspace (const Vec< T, N > bases[], index_t n, Vec< T, N > null_basis[])
 Compute the null space of a vector basis. More...
 
template<typename T , index_t N>
void orthogonalize (Vec< T, N > basis[], index_t n)
 Use the Gram-Schmidt process to orthogonalize a set of basis vectors. More...
 
template<typename T >
void orthogonalize (Vec< T, 2 > basis[2], index_t _n=2)
 
template<typename T , index_t N>
void orthonormalize (Vec< T, N > basis[], index_t n)
 Use the Gram-Schmidt process to orthonormalize a set of basis vectors. More...
 
template<typename V , typename U >
std::enable_if< std::is_scalar< U >::valueanddetail::IsVector< V >::value, V >::type operator* (const V &v, U d)
 
template<typename V , typename U >
std::enable_if< std::is_scalar< U >::valueanddetail::IsVector< V >::value, V >::type operator* (U d, const V &v)
 
template<typename T >
Vec< T, 3 > triangle_normal (const Vec< T, 3 > p1, const Vec< T, 3 > p2, const Vec< T, 3 > p3)
 
template<typename T >
Vec< T, 3 > rainbow (double s)
 
template<typename T >
Vec< T, 3 > from_rgb (int aRGB)
 
template<typename T >
const Vec< T, 4 > from_argb (int aRGB)
 
template<typename T >
const Vec< T, 4 > from_rgba (int rgba)
 
RandomgetRandom ()
 
template<typename T >
void permute (T objs[], size_t len, Random &rng=*getRandom())
 
template<typename T >
void permute (std::vector< T > &objs, Random &rng=*getRandom())
 
uint64_t rot64 (uint64_t x, int k)
 
uint64_t splitmix64 (uint64_t *state)
 
template<typename T , index_t N>
void emit (const detail::Face< T, N > &f, bool highlight=false)
 
template<typename T , index_t N>
void emit (const detail::Edge< T, N > &e, bool highlight=false)
 
template<typename T , index_t N>
void emit (const Vec< T, N > &v, bool highlight=false)
 
template<typename T , index_t N>
void emit (const detail::Simplex< T, N > &s, bool full)
 
template<typename T , index_t N>
bool gjk_intersect (const AnyConvex< T, N > &shape_a, const AnyConvex< T, N > &shape_b, Vec< T, N > *overlap_axis=NULL)
 
template<typename T , index_t N>
bool gjk_intersect (const Vec< T, N > *pts_a, index_t n_a, const Vec< T, N > *pts_b, index_t n_b, Vec< T, N > *overlap_axis=NULL)
 
template<typename T , index_t N>
void explode_simplex (const AnyConvex< T, N > &shape_a, const AnyConvex< T, N > &shape_b, detail::Simplex< T, N > *splex)
 
template<typename T , index_t N>
void disjoint_separation_axis (const AnyConvex< T, N > &shape_a, const AnyConvex< T, N > &shape_b, Vec< T, N > *overlap_axis, detail::Simplex< T, N > *splex, double fractional_tolerance=0.001, index_t iteration_limit=-1, bool emit_debug=false)
 
template<typename T , index_t N>
bool minimal_separation_axis (const AnyConvex< T, N > &shape_a, const AnyConvex< T, N > &shape_b, Vec< T, N > *overlap_axis, double fractional_tolerance=0.001, index_t iteration_limit=-1, bool emit_debug=false)
 
template<typename Shape >
AnyConvexImpl< Shape > as_any_convex (const Shape &s)
 Wrap s in a virtual class which implements the Convex concept.
 
template<typename T , index_t N>
bool trace_simplex (const Vec< T, N > verts[N], const Ray< T, N > &ray, Vec< T, N-1 > *uv, T *s)
 
template<typename T >
diff_of_products (T a, T b, T c, T d)
 
template<typename T >
sum_of_products (T a, T b, T c, T d)
 
template<typename T >
multiply_add (T a, T b, T c)
 Fused multiply-add. More...
 
template<typename T >
clamp (const T &v, const T &lo, const T &hi)
 
template<typename S , typename T >
std::common_type< S, T >::type mix (S t, T a, T b)
 
template<typename S , typename T >
interp_linear (const S s[], const T p[], int dim)
 
template<typename S , typename T >
interp_cubic (S s, const T p[4])
 
template<typename S , typename T >
interp_cubic (const S s[], const T p[], int dim)
 
template<typename T >
bool quadratic_solve (T results[2], T a, T b, T c)
 
template<typename T , bool RowMajor>
bool cholesky (T *m, index_t n)
 Perform a Cholesky decomposition on a bare array. More...
 
template<typename T , index_t M, index_t N>
bool cholesky (SimpleMatrix< T, M, N > *m)
 Perform a Cholesky decomposition on a Matrix. More...
 
template<typename T , bool RowMajor = true>
index_t decomp_lup (T *m, index_t rows, index_t cols, index_t *reorder, bool *parity)
 LU decomposition, pivoting columns. More...
 
template<typename T , bool RowMajor = true>
index_t decomp_plu (T *m, index_t rows, index_t cols, index_t *reorder, bool *parity)
 LU decomposition, pivoting rows. More...
 
template<typename T , bool RowMajor = true>
void backsolve_plu (const T *plu, const index_t *p, index_t n, index_t m, T *x, const T *b, index_t skip=0)
 Solve the decomposed matrix equation LUX = PB for X, given LU and B. More...
 
template<typename T , bool RowMajor = true>
void backsolve_lu (const T *lu, index_t n, index_t m, T *x, index_t skip=0)
 Solve a decomposed system of linear equations LUX = B, without a permutation map. More...
 
template<typename T , bool RowMajor = true>
bool linear_solve (T *a, index_t n, index_t m, T *x, index_t skip=0)
 Solve the matrix equation AX = B for the matrix X, given matrices A and B. More...
 
template<typename T , index_t N>
bool linear_solve (Vec< T, N > bases[N], index_t m, Vec< T, N > *x, index_t skip=0)
 Write each vector in b in terms of the basis vectors in bases. More...
 

Detailed Description

Namespace of all geomc functions and classes.

xxx write me

better for performance in high N: Gaussian blob about zero, normalize result to project to unit sphere. less clear: a) how compares to performance at low dimensions b) how performs with LD sequences.

Function Documentation

◆ from_rgb()

Vec< T, 3 > geom::from_rgb ( int  aRGB)
Parameters
aRGBA packed 8-bit per channel RGB color value (with alpha or irrelevant data in the eight high order bits).
Returns
An (r,g,b) tuple extracted from aRGB.

◆ permutation_apply()

void geom::permutation_apply ( index_t *  p,
index_t  n,
RandomAccessIterator  v 
)

Apply a permutation in-place, resetting the permutation to identity in the process.

Parameters
pAn array of n indecies representing the sources of elements in the permuted sequence; i.e. output[i] = input[p[i]]. p will contain the identity permutation after the function returns.
nThe number of elements in the permutation. @v A random access iterator containing the sequence to be permuted.

◆ permutation_sign()

index_t permutation_sign ( index_t *  p,
index_t  n 
)

Compute the sign of a permutation, resetting the permutation to identity in the process.

Parameters
pAn array of n indecies representing the permutation mapping. p will contain the identity permutation after the function returns.
nThe number of elements in the permutation.

◆ rainbow()

Vec< T, 3 > geom::rainbow ( double  s)

An (r,g,b) color tuple representing a hue selected by s, with 0 being red, progressing in rainbow order through the colors before returning to red at 1. The cycle is extended similarly outside of (0, 1).

Parameters
sRainbow parameter between 0 and 1.
Returns
An (r,g,b) color tuple.

◆ trace_simplex()

bool trace_simplex ( const Vec< T, N >  verts[N],
const Ray< T, N > &  ray,
Vec< T, N-1 > *  uv,
T *  s 
)

Ray trace an N-1 dimensional simplex (e.g. triangle in 3D, tetrahedron in 4D, a line in 2D etc.), returning the surface parameters of the hit point, given in coordinates of the basis spanned by the edges radiating from verts[0].

Parameters
vertsAn array of the simplex's N vertices.
rayThe ray to intersect with the simplex.
uvBuffer for the surface coordinates of the hitpoint. (return variable; may be null).
sThe ray parameter of the hit point. (return variable)
Returns
true if the ray hit the simplex.

◆ triangle_normal()

Vec< T, 3 > geom::triangle_normal ( const Vec< T, 3 >  p1,
const Vec< T, 3 >  p2,
const Vec< T, 3 >  p3 
)
Returns
The normal of the triangle formed by p1, p2, and p3.