geomc 1.0
A c++ linear algebra template library
geomc_defs.h
1/*
2 * geomc_defs.h
3 *
4 * Created on: Dec 24, 2010
5 * Author: tbabb
6 */
7
8#ifndef GEOMC_DEFS_H_
9#define GEOMC_DEFS_H_
10
11#include <cstddef>
12#include <type_traits>
13#include <limits>
14#include <algorithm>
15#include <stdint.h>
16
36// Shall a matrix check whether index is out-of-bounds on every access?
37
38 /* #define GEOMC_MTX_CHECK_BOUNDS */
39
45#define GEOMC_MTX_CHECK_DIMS
46
52#define GEOMC_MTX_CHECK_ALIASING
53
54// Shall vectors include functions for outputting to streams?
55
56#define GEOMC_LINALG_USE_STREAMS
57
58// Shall the <function> module include functions for outputting to streams?
59
60#define GEOMC_FUNCTION_USE_STREAMS
61
62
63#define PI (3.141592653589793238462643383)
64#define TAU (6.283185307179586476925286767)
65
66#define DYNAMIC_DIM (0)
67
68#define M_CLAMP(v,lo,hi) std::min(std::max((v),(lo)),(hi))
69
70#define M_ENABLE_IF(cond) \
71 typename std::enable_if<(cond), int>::type DUMMY=0
72
73#define DERIVED_TYPE(base,derived) \
74 typename std::enable_if< std::is_base_of< (base), (derived) >, (derived)>::type
75
76#define REQUIRE_INHERIT(base,derived) \
77 typename std::enable_if< std::is_base_of< (base), (derived) >, int>::type dummy=0
78
79#define REQUIRE_INHERIT_T(base,derived) \
80 typename std::enable_if< std::is_base_of< base, derived >, int>::type
81
82typedef std::ptrdiff_t index_t;
83
84template <typename T> inline T positive_mod(T a, T b){
85 return (a % b + b) % b;
86}
87
88
90namespace geom {
91
92 // storage fwd decls
93 template <typename T, index_t N> struct Storage;
94 template <typename T, index_t N> struct SizedStorage;
95 template <typename T, index_t N> struct UnmanagedStorage;
96
97};
98
99#ifdef PARSING_DOXYGEN
100
102namespace std { };
103
104#endif
105
106#endif /* GEOMC_DEFS_H_ */
Namespace of all geomc functions and classes.
Definition: CircularBuffer.h:8
Functions to extend support of stdlib to geomc classes.
Definition: Dual.h:383
Definition: geomc_defs.h:95