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#if DEBUG_HELPERS
99
100#include <cxxabi.h>
101
102template <typename T>
103std::string printable_name() {
104 char* name;
105 int status = 0;
106 name = abi::__cxa_demangle(typeid(T).name(), NULL, NULL, &status);
107 return {name};
108}
109
110#endif
111
112#ifdef PARSING_DOXYGEN
113
115namespace std { };
116
117#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:165
Array storage with templated static or dynamic size.
Definition Storage.h:109
Definition geomc_defs.h:94