]> Dogcows Code - chaz/yoink/blob - src/moof/cml/mathlib/typedef.h
the massive refactoring effort
[chaz/yoink] / src / moof / cml / mathlib / typedef.h
1 /* -*- C++ -*- ------------------------------------------------------------
2
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
4
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
7
8 *-----------------------------------------------------------------------*/
9 /** @file
10 * @brief
11 */
12
13 #ifndef typedef_h
14 #define typedef_h
15
16 #include <cml/vector.h>
17 #include <cml/matrix.h>
18 #include <cml/quaternion.h>
19 #include <cml/constants.h>
20 #include <cml/mathlib/epsilon.h>
21
22 namespace cml {
23
24 /* fixed-size vectors */
25 typedef vector< int, fixed<2> > vector2i;
26 typedef vector< float, fixed<2> > vector2f;
27 typedef vector< double, fixed<2> > vector2d;
28
29 typedef vector< int, fixed<3> > vector3i;
30 typedef vector< float, fixed<3> > vector3f;
31 typedef vector< double, fixed<3> > vector3d;
32
33 typedef vector< int, fixed<4> > vector4i;
34 typedef vector< float, fixed<4> > vector4f;
35 typedef vector< double, fixed<4> > vector4d;
36
37 /* fixed-size matrices */
38
39 typedef matrix< int, fixed<2,2> > matrix22i;
40 typedef matrix< float, fixed<2,2> > matrix22f;
41 typedef matrix< double, fixed<2,2> > matrix22d;
42
43 typedef matrix< int, fixed<2,2>, row_basis, row_major > matrix22i_r;
44 typedef matrix< int, fixed<2,2>, col_basis, col_major > matrix22i_c;
45 typedef matrix< float, fixed<2,2>, row_basis, row_major > matrix22f_r;
46 typedef matrix< float, fixed<2,2>, col_basis, col_major > matrix22f_c;
47 typedef matrix< double, fixed<2,2>, row_basis, row_major > matrix22d_r;
48 typedef matrix< double, fixed<2,2>, col_basis, col_major > matrix22d_c;
49
50
51 typedef matrix< int, fixed<3,3> > matrix33i;
52 typedef matrix< float, fixed<3,3> > matrix33f;
53 typedef matrix< double, fixed<3,3> > matrix33d;
54
55 typedef matrix< int, fixed<3,3>, row_basis, row_major > matrix33i_r;
56 typedef matrix< int, fixed<3,3>, col_basis, col_major > matrix33i_c;
57 typedef matrix< float, fixed<3,3>, row_basis, row_major > matrix33f_r;
58 typedef matrix< float, fixed<3,3>, col_basis, col_major > matrix33f_c;
59 typedef matrix< double, fixed<3,3>, row_basis, row_major > matrix33d_r;
60 typedef matrix< double, fixed<3,3>, col_basis, col_major > matrix33d_c;
61
62
63 typedef matrix< int, fixed<4,4> > matrix44i;
64 typedef matrix< float, fixed<4,4> > matrix44f;
65 typedef matrix< double, fixed<4,4> > matrix44d;
66
67 typedef matrix< int, fixed<4,4>, row_basis, row_major > matrix44i_r;
68 typedef matrix< int, fixed<4,4>, col_basis, col_major > matrix44i_c;
69 typedef matrix< float, fixed<4,4>, row_basis, row_major > matrix44f_r;
70 typedef matrix< float, fixed<4,4>, col_basis, col_major > matrix44f_c;
71 typedef matrix< double, fixed<4,4>, row_basis, row_major > matrix44d_r;
72 typedef matrix< double, fixed<4,4>, col_basis, col_major > matrix44d_c;
73
74
75 typedef matrix< int, fixed<3,2>, row_basis, row_major > matrix32i_r;
76 typedef matrix< float, fixed<3,2>, row_basis, row_major > matrix32f_r;
77 typedef matrix< double, fixed<3,2>, row_basis, row_major > matrix32d_r;
78
79 typedef matrix< int, fixed<2,3>, col_basis, col_major > matrix23i_c;
80 typedef matrix< float, fixed<2,3>, col_basis, col_major > matrix23f_c;
81 typedef matrix< double, fixed<2,3>, col_basis, col_major > matrix23d_c;
82
83 typedef matrix< int, fixed<4,3>, row_basis, row_major > matrix43i_r;
84 typedef matrix< float, fixed<4,3>, row_basis, row_major > matrix43f_r;
85 typedef matrix< double, fixed<4,3>, row_basis, row_major > matrix43d_r;
86
87 typedef matrix< int, fixed<3,4>, col_basis, col_major > matrix34i_c;
88 typedef matrix< float, fixed<3,4>, col_basis, col_major > matrix34f_c;
89 typedef matrix< double, fixed<3,4>, col_basis, col_major > matrix34d_c;
90
91
92 /* quaternions */
93 typedef quaternion<float, fixed<>,vector_first,negative_cross>
94 quaternionf_n;
95 typedef quaternion<float, fixed<>,vector_first,positive_cross>
96 quaternionf_p;
97 typedef quaternion<double,fixed<>,vector_first,negative_cross>
98 quaterniond_n;
99 typedef quaternion<double,fixed<>,vector_first,positive_cross>
100 quaterniond_p;
101 typedef quaternion<float> quaternionf;
102 typedef quaternion<double> quaterniond;
103
104
105 /* dynamically resizable vectors */
106 typedef vector< int, dynamic<> > vectori;
107 typedef vector< float, dynamic<> > vectorf;
108 typedef vector< double, dynamic<> > vectord;
109
110
111 /* dynamically resizable matrices */
112 typedef matrix< int, dynamic<> > matrixi;
113 typedef matrix< float, dynamic<> > matrixf;
114 typedef matrix< double, dynamic<> > matrixd;
115
116 typedef matrix< int, dynamic<>, row_basis, row_major > matrixi_r;
117 typedef matrix< int, dynamic<>, col_basis, col_major > matrixi_c;
118 typedef matrix< float, dynamic<>, row_basis, row_major > matrixf_r;
119 typedef matrix< float, dynamic<>, col_basis, col_major > matrixf_c;
120 typedef matrix< double, dynamic<>, row_basis, row_major > matrixd_r;
121 typedef matrix< double, dynamic<>, col_basis, col_major > matrixd_c;
122
123
124 /* constants */
125 typedef constants<float> constantsf;
126 typedef constants<double> constantsd;
127
128 /* epsilon/tolerance values (placeholder) */
129 typedef epsilon<float> epsilonf;
130 typedef epsilon<double> epsilond;
131
132 } // namespace cml
133
134 #endif
This page took 0.035559 seconds and 4 git commands to generate.