geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
geomc_defs.h
1#pragma once
2
3/*
4 * geomc_defs.h
5 *
6 * Created on: Dec 24, 2010
7 * Author: tbabb
8 */
9
10#include <cstddef>
11#include <type_traits>
12#include <limits>
13#include <algorithm>
14#include <stdint.h>
15
34
35// Shall a matrix check whether index is out-of-bounds on every access?
36
37 /* #define GEOMC_MTX_CHECK_BOUNDS */
38
43
44#define GEOMC_MTX_CHECK_DIMS
45
50
51#ifndef GEOMC_MTX_CHECK_ALIASING
52#define GEOMC_MTX_CHECK_ALIASING 1
53#endif
54
55// Shall vectors include functions for outputting to streams?
56
57#ifndef GEOMC_USE_STREAMS
58#define GEOMC_USE_STREAMS 1
59#endif
60
61// Shall the <function> module include functions for outputting to streams?
62
63#define GEOMC_FUNCTION_USE_STREAMS
64
65
66#define PI (3.141592653589793238462643383)
67#define TAU (6.283185307179586476925286767)
68
69#define DYNAMIC_DIM (0)
70
71#define M_CLAMP(v,lo,hi) std::min(std::max((v),(lo)),(hi))
72
73#define M_ENABLE_IF(cond) \
74 typename std::enable_if<(cond), int>::type DUMMY=0
75
76#define DERIVED_TYPE(base,derived) \
77 typename std::enable_if< std::is_base_of< (base), (derived) >, (derived)>::type
78
79#define REQUIRE_INHERIT(base,derived) \
80 typename std::enable_if< std::is_base_of< (base), (derived) >, int>::type dummy=0
81
82#define REQUIRE_INHERIT_T(base,derived) \
83 typename std::enable_if< std::is_base_of< base, derived >, int>::type
84
85typedef std::ptrdiff_t index_t;
86
87
89namespace geom {
90
91 // storage fwd decls
92 template <typename T, index_t N> struct Storage;
93 template <typename T, index_t N> struct SizedStorage;
94 template <typename T, index_t N> struct UnmanagedStorage;
95
96};
97
98#ifdef PARSING_DOXYGEN
99
101namespace std { };
102
103#endif
Namespace of all geomc functions and classes.
Definition Deque.h:10
Functions to extend support of stdlib to geomc classes.
Definition DualFunctions.h:266
Array storage with templated static or dynamic size. If the array is dynamic, its length is stored in...
Definition Storage.h:167
Array storage with templated static or dynamic size.
Definition Storage.h:111
Definition geomc_defs.h:94