Simbody  3.7
SmallMatrix.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMMATRIX_SMALLMATRIX_H_
2 #define SimTK_SIMMATRIX_SMALLMATRIX_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm): SimTKcommon *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2005-13 Stanford University and the Authors. *
13  * Authors: Michael Sherman *
14  * Contributors: *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
88 #include "SimTKcommon/Scalar.h"
90 
91 
92 #include "SimTKcommon/internal/ResultType.h"
98 
99 // Friendly abbreviations.
100 namespace SimTK {
126 typedef Vec<2> Vec2;
129 typedef Vec<3> Vec3;
132 typedef Vec<4> Vec4;
133 
134 
138 typedef Mat<2, 2> Mat22;
142 typedef Mat<3, 3> Mat33;
146 typedef Mat<4, 4> Mat44;
147 
154 
157 typedef Row<2> Row2;
160 typedef Row<3> Row3;
163 typedef Row<4> Row4;
170 // Less-popular Vec typedefs.
171 typedef Vec<1> Vec1;
172 typedef Vec<5> Vec5;
173 typedef Vec<6> Vec6;
174 typedef Vec<7> Vec7;
175 typedef Vec<8> Vec8;
176 typedef Vec<9> Vec9;
177 
178 // Less-popular Mat typedefs.
179 typedef Mat<1,1> Mat11;
180 typedef Mat<1,2> Mat12;
181 typedef Mat<1,3> Mat13;
182 typedef Mat<1,4> Mat14;
183 typedef Mat<1,5> Mat15;
184 typedef Mat<1,6> Mat16;
185 typedef Mat<1,7> Mat17;
186 typedef Mat<1,8> Mat18;
187 typedef Mat<1,9> Mat19;
188 
189 typedef Mat<2,1> Mat21;
190 typedef Mat<2,3> Mat23;
191 typedef Mat<2,4> Mat24;
192 typedef Mat<2,5> Mat25;
193 typedef Mat<2,6> Mat26;
194 typedef Mat<2,7> Mat27;
195 typedef Mat<2,8> Mat28;
196 typedef Mat<2,9> Mat29;
197 
198 typedef Mat<3,1> Mat31;
199 typedef Mat<3,2> Mat32;
200 typedef Mat<3,4> Mat34;
201 typedef Mat<3,5> Mat35;
202 typedef Mat<3,6> Mat36;
203 typedef Mat<3,7> Mat37;
204 typedef Mat<3,8> Mat38;
205 typedef Mat<3,9> Mat39;
206 
207 typedef Mat<4,1> Mat41;
208 typedef Mat<4,2> Mat42;
209 typedef Mat<4,3> Mat43;
210 typedef Mat<4,5> Mat45;
211 typedef Mat<4,6> Mat46;
212 typedef Mat<4,7> Mat47;
213 typedef Mat<4,8> Mat48;
214 typedef Mat<4,9> Mat49;
215 
216 typedef Mat<5,1> Mat51;
217 typedef Mat<5,2> Mat52;
218 typedef Mat<5,3> Mat53;
219 typedef Mat<5,4> Mat54;
220 typedef Mat<5,5> Mat55;
221 typedef Mat<5,6> Mat56;
222 typedef Mat<5,7> Mat57;
223 typedef Mat<5,8> Mat58;
224 typedef Mat<5,9> Mat59;
225 
226 typedef Mat<6,1> Mat61;
227 typedef Mat<6,2> Mat62;
228 typedef Mat<6,3> Mat63;
229 typedef Mat<6,4> Mat64;
230 typedef Mat<6,5> Mat65;
231 typedef Mat<6,6> Mat66;
232 typedef Mat<6,7> Mat67;
233 typedef Mat<6,8> Mat68;
234 typedef Mat<6,9> Mat69;
235 
236 typedef Mat<7,1> Mat71;
237 typedef Mat<7,2> Mat72;
238 typedef Mat<7,3> Mat73;
239 typedef Mat<7,4> Mat74;
240 typedef Mat<7,5> Mat75;
241 typedef Mat<7,6> Mat76;
242 typedef Mat<7,7> Mat77;
243 typedef Mat<7,8> Mat78;
244 typedef Mat<7,9> Mat79;
245 
246 typedef Mat<8,1> Mat81;
247 typedef Mat<8,2> Mat82;
248 typedef Mat<8,3> Mat83;
249 typedef Mat<8,4> Mat84;
250 typedef Mat<8,5> Mat85;
251 typedef Mat<8,6> Mat86;
252 typedef Mat<8,7> Mat87;
253 typedef Mat<8,8> Mat88;
254 typedef Mat<8,9> Mat89;
255 
256 typedef Mat<9,1> Mat91;
257 typedef Mat<9,2> Mat92;
258 typedef Mat<9,3> Mat93;
259 typedef Mat<9,4> Mat94;
260 typedef Mat<9,5> Mat95;
261 typedef Mat<9,6> Mat96;
262 typedef Mat<9,7> Mat97;
263 typedef Mat<9,8> Mat98;
264 typedef Mat<9,9> Mat99;
265 
266 // Less-popular SymMat typedefs.
273 
274 // Less-popular Row typedefs.
275 typedef Row<1> Row1;
276 
277 typedef Row<5> Row5;
279 typedef Row<6> Row6;
281 typedef Row<7> Row7;
283 typedef Row<8> Row8;
285 typedef Row<9> Row9;
286 
287 // float-precision Vecs.
297 
298 // Just doing some of the popular ones for now.
310 
321 
322 // float-precision Rows.
332 
334 } //namespace SimTK
335 
336 
337 #endif //SimTK_SIMMATRIX_SMALLMATRIX_H_
Mat< 8, 8 > Mat88
8x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:253
SymMat< 1 > SymMat11
1x1 Real symmetric matrix, that is, a scalar.
Definition: SmallMatrix.h:267
Mat< 1, 6 > Mat16
1x6 Real row matrix.
Definition: SmallMatrix.h:184
Mat< 7, 5 > Mat75
7x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:240
Mat< 4, 4 > Mat44
This is the most common 4x4 matrix type: four packed columns of 4 Real values each.
Definition: SmallMatrix.h:146
Mat< 5, 9 > Mat59
5x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:224
SymMat< 9, float > fSymMat99
9x9 compact float symmetric matrix.
Definition: SmallMatrix.h:320
SymMat< 2, float > fSymMat22
2x2 compact float symmetric matrix.
Definition: SmallMatrix.h:313
Mat< 9, 5 > Mat95
9x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:260
Mat< 7, 1 > Mat71
7x1 Real column matrix.
Definition: SmallMatrix.h:236
Mat< 6, 9 > Mat69
6x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:234
Mat< 2, 1 > Mat21
2x1 Real column matrix.
Definition: SmallMatrix.h:189
Mat< 1, 1, float > fMat11
1x1 float matrix, that is, a scalar.
Definition: SmallMatrix.h:299
Mat< 2, 6 > Mat26
2x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:193
Mat< 3, 4 > Mat34
3x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:200
Mat< 2, 3 > Mat23
2x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:190
Mat< 1, 4 > Mat14
1x4 Real row matrix.
Definition: SmallMatrix.h:182
Mat< 6, 3 > Mat63
6x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:228
Vec< 6 > Vec6
Packed, 6-element vector of Real values.
Definition: SmallMatrix.h:173
Vec< 6, float > fVec6
Packed, 6-element vector of float values.
Definition: SmallMatrix.h:293
This is a small, fixed-size symmetric or Hermitian matrix designed for no-overhead inline computation...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:621
Mat< 8, 2 > Mat82
8x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:247
Row< 3 > Row3
Packed, 3-element row of Real values.
Definition: SmallMatrix.h:160
Mat< 6, 6 > Mat66
6x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:231
Mat< 1, 1 > Mat11
1x1 Real matrix, that is, a scalar.
Definition: SmallMatrix.h:179
Row< 7, float > fRow7
Packed, 7-element row vector of float values.
Definition: SmallMatrix.h:329
Row< 4, float > fRow4
Packed, 4-element row vector of float values.
Definition: SmallMatrix.h:326
Row< 4 > Row4
Packed, 4-element row of Real values.
Definition: SmallMatrix.h:163
SymMat< 1, float > fSymMat11
A 1x1 float symmetric matrix, that is, a scalar.
Definition: SmallMatrix.h:312
Row< 1, float > fRow1
A row vector of one float element (not too useful).
Definition: SmallMatrix.h:323
Mat< 9, 1 > Mat91
9x1 Real column matrix.
Definition: SmallMatrix.h:256
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
Mat< 6, 8 > Mat68
6x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:233
Vec< 1 > Vec1
A vector of just one Real element (not too useful).
Definition: SmallMatrix.h:171
Mat< 3, 4, float > fMat34
3x4 float matrix, packed by columns.
Definition: SmallMatrix.h:302
Mat< 7, 6 > Mat76
7x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:241
Vec< 4 > Vec4
This is the most common 4D vector type: a column of 4 Real values stored consecutively in memory (pac...
Definition: SmallMatrix.h:132
Mat< 2, 2, float > fMat22
2x2 float matrix, packed by columns.
Definition: SmallMatrix.h:300
Mat< 5, 5 > Mat55
5x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:220
Mat< 8, 6 > Mat86
8x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:251
This file declares class Row<NCOLS, ELEMENT_TYPE, STRIDE>.
Row< 8, float > fRow8
Packed, 8-element row vector of float values.
Definition: SmallMatrix.h:330
Mat< 3, 8 > Mat38
3x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:204
Row< 8 > Row8
Packed, 8-element row of Real values.
Definition: SmallMatrix.h:283
Mat< 9, 3 > Mat93
9x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:258
Mat< 5, 7 > Mat57
5x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:222
Vec< 4, float > fVec4
Packed, 4-element vector of float values.
Definition: SmallMatrix.h:291
Mat< 9, 4 > Mat94
9x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:259
Mat< 6, 2 > Mat62
6x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:227
Row< 5, float > fRow5
Packed, 5-element row vector of float values.
Definition: SmallMatrix.h:327
Row< 9, float > fRow9
Packed, 9-element row vector of float values.
Definition: SmallMatrix.h:331
SymMat< 3 > SymMat33
A compact, 3x3 Real symmetric matrix; only 6 elements are stored.
Definition: SmallMatrix.h:151
Mat< 2, 5 > Mat25
2x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:192
Mat< 3, 2 > Mat32
3x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:199
Mat< 5, 8 > Mat58
5x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:223
Row< 6 > Row6
Packed, 6-element row of Real values.
Definition: SmallMatrix.h:279
Vec< 1, float > fVec1
A vector of one float element (not too useful).
Definition: SmallMatrix.h:288
Mat< 3, 3, float > fMat33
3x3 float matrix, packed by columns.
Definition: SmallMatrix.h:301
Mat< 6, 7 > Mat67
6x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:232
Mat< 7, 2 > Mat72
7x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:237
Mat< 5, 5, float > fMat55
5x5 float matrix, packed by columns.
Definition: SmallMatrix.h:305
Mat< 9, 6 > Mat96
9x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:261
Mat< 1, 8 > Mat18
1x8 Real row matrix.
Definition: SmallMatrix.h:186
Row< 2, float > fRow2
Packed, 2-element row vector of float values.
Definition: SmallMatrix.h:324
Mat< 1, 9 > Mat19
1x9 Real row matrix.
Definition: SmallMatrix.h:187
Mat< 6, 5 > Mat65
6x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:230
Mat< 3, 5 > Mat35
3x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:201
Declaration of class Vec<NROWS, ELEMENT_TYPE, STRIDE>.
Mat< 2, 7 > Mat27
2x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:194
Mat< 6, 6, float > fMat66
6x6 float matrix, packed by columns.
Definition: SmallMatrix.h:306
Mat< 2, 8 > Mat28
2x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:195
Vec< 5, float > fVec5
Packed, 5-element vector of float values.
Definition: SmallMatrix.h:292
Mat< 5, 1 > Mat51
5x1 Real column matrix.
Definition: SmallMatrix.h:216
Vec< 3, float > fVec3
Packed, 3-element vector of float values.
Definition: SmallMatrix.h:290
Mat< 8, 9 > Mat89
8x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:254
Mat< 2, 4 > Mat24
2x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:191
Mat< 4, 1 > Mat41
4x1 Real column matrix.
Definition: SmallMatrix.h:207
Mat< 4, 2 > Mat42
4x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:208
SymMat< 6, float > fSymMat66
6x6 compact float symmetric matrix.
Definition: SmallMatrix.h:317
SymMat< 8 > SymMat88
8x8 compact Real symmetric matrix.
Definition: SmallMatrix.h:271
Mat< 8, 3 > Mat83
8x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:248
Mat< 5, 6 > Mat56
5x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:221
These is a templatized, C++ callable interface to LAPACK and BLAS.
Mat< 2, 2 > Mat22
This is the most common 2x2 matrix type: two packed columns of 2 Real values each.
Definition: SmallMatrix.h:138
This is a user-includable header which includes everything needed to make use of SimMatrix Scalar cod...
Vec< 8 > Vec8
Packed, 8-element vector of Real values.
Definition: SmallMatrix.h:175
Mat< 6, 4 > Mat64
6x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:229
Mat< 3, 9 > Mat39
3x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:205
Mat< 3, 3 > Mat33
This is the most common 3x3 matrix type: three packed columns of 3 Real values each.
Definition: SmallMatrix.h:142
Mat< 9, 9, float > fMat99
9x9 float matrix, packed by columns.
Definition: SmallMatrix.h:309
Mat< 3, 6 > Mat36
3x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:202
Vec< 7, float > fVec7
Packed, 7-element vector of float values.
Definition: SmallMatrix.h:294
Vec< 2, float > fVec2
Packed, 2-element vector of float values.
Definition: SmallMatrix.h:289
Row< 2 > Row2
Packed, 2-element row of Real values.
Definition: SmallMatrix.h:157
Row< 1 > Row1
A row vector of one Real element (not too useful).
Definition: SmallMatrix.h:275
SymMat< 9 > SymMat99
9x9 compact Real symmetric matrix.
Definition: SmallMatrix.h:272
Mat< 1, 3 > Mat13
1x3 Real row matrix.
Definition: SmallMatrix.h:181
SymMat< 5, float > fSymMat55
5x5 compact float symmetric matrix.
Definition: SmallMatrix.h:316
Mat< 9, 8 > Mat98
9x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:263
Row< 6, float > fRow6
Packed, 6-element row vector of float values.
Definition: SmallMatrix.h:328
This file declares templatized class SymMat for small, fixed-size symmetric matrices.
SymMat< 4 > SymMat44
A compact, 2x2 Real symmetric matrix; only 10 elements are stored.
Definition: SmallMatrix.h:153
Row< 5 > Row5
Packed, 5-element row of Real values.
Definition: SmallMatrix.h:277
Mat< 8, 4 > Mat84
8x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:249
Mat< 8, 7 > Mat87
8x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:252
Vec< 5 > Vec5
Packed, 5-element vector of Real values.
Definition: SmallMatrix.h:172
SymMat< 4, float > fSymMat44
4x4 compact float symmetric matrix.
Definition: SmallMatrix.h:315
Mat< 7, 4 > Mat74
7x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:239
SymMat< 7, float > fSymMat77
7x7 compact float symmetric matrix.
Definition: SmallMatrix.h:318
Mat< 1, 5 > Mat15
1x5 Real row matrix.
Definition: SmallMatrix.h:183
SymMat< 7 > SymMat77
7x7 compact Real symmetric matrix.
Definition: SmallMatrix.h:270
Mat< 2, 9 > Mat29
2x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:196
Vec< 8, float > fVec8
Packed, 8-element vector of float values.
Definition: SmallMatrix.h:295
Mat< 7, 3 > Mat73
7x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:238
SymMat< 3, float > fSymMat33
3x3 compact float symmetric matrix.
Definition: SmallMatrix.h:314
Mat< 5, 4 > Mat54
5x4 Real matrix, packed by columns.
Definition: SmallMatrix.h:219
Mat< 1, 2 > Mat12
1x2 Real row matrix.
Definition: SmallMatrix.h:180
Mat< 4, 7 > Mat47
4x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:212
This is a fixed-length row vector designed for no-overhead inline computation.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:619
Mat< 4, 9 > Mat49
4x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:214
Row< 3, float > fRow3
Packed, 3-element row vector of float values.
Definition: SmallMatrix.h:325
This file defines global functions and class members which use a mix of Vec, Row, and Mat types and h...
SymMat< 5 > SymMat55
5x5 compact Real symmetric matrix.
Definition: SmallMatrix.h:268
Mat< 8, 1 > Mat81
8x1 Real column matrix.
Definition: SmallMatrix.h:246
Mat< 3, 1 > Mat31
3x1 Real column matrix.
Definition: SmallMatrix.h:198
SymMat< 8, float > fSymMat88
8x8 compact float symmetric matrix.
Definition: SmallMatrix.h:319
Mat< 8, 8, float > fMat88
8x8 float matrix, packed by columns.
Definition: SmallMatrix.h:308
Mat< 9, 9 > Mat99
9x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:264
Vec< 7 > Vec7
Packed, 7-element vector of Real values.
Definition: SmallMatrix.h:174
Mat< 4, 8 > Mat48
4x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:213
Mat< 3, 7 > Mat37
3x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:203
Mat< 7, 8 > Mat78
7x8 Real matrix, packed by columns.
Definition: SmallMatrix.h:243
Mat< 9, 7 > Mat97
9x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:262
Mat< 4, 6 > Mat46
4x6 Real matrix, packed by columns.
Definition: SmallMatrix.h:211
Mat< 4, 3, float > fMat43
4x3 float matrix, packed by columns.
Definition: SmallMatrix.h:303
Mat< 1, 7 > Mat17
1x7 Real row matrix.
Definition: SmallMatrix.h:185
SymMat< 2 > SymMat22
A compact, 2x2 Real symmetric matrix; only 3 elements are stored.
Definition: SmallMatrix.h:149
Vec< 3 > Vec3
This is the most common 3D vector type: a column of 3 Real values stored consecutively in memory (pac...
Definition: SmallMatrix.h:129
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:620
Mat< 4, 3 > Mat43
4x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:209
Row< 7 > Row7
Packed, 7-element row of Real values.
Definition: SmallMatrix.h:281
Mat< 4, 4, float > fMat44
4x4 float matrix, packed by columns.
Definition: SmallMatrix.h:304
Vec< 9, float > fVec9
Packed, 9-element vector of float values.
Definition: SmallMatrix.h:296
Mat< 7, 9 > Mat79
7x9 Real matrix, packed by columns.
Definition: SmallMatrix.h:244
Mat< 5, 2 > Mat52
5x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:217
This file declares class Mat<NROWS, NCOLS, ELEMENT_TYPE, COL_SPACING, ROW_SPACING>.
Row< 9 > Row9
Packed, 9-element row of Real values.
Definition: SmallMatrix.h:285
Mat< 7, 7 > Mat77
7x7 Real matrix, packed by columns.
Definition: SmallMatrix.h:242
Mat< 4, 5 > Mat45
4x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:210
Mat< 6, 1 > Mat61
6x1 Real column matrix.
Definition: SmallMatrix.h:226
Mat< 8, 5 > Mat85
8x5 Real matrix, packed by columns.
Definition: SmallMatrix.h:250
Vec< 9 > Vec9
Packed, 9-element vector of Real values.
Definition: SmallMatrix.h:176
Mat< 7, 7, float > fMat77
7x7 float matrix, packed by columns.
Definition: SmallMatrix.h:307
Mat< 5, 3 > Mat53
5x3 Real matrix, packed by columns.
Definition: SmallMatrix.h:218
Mat< 9, 2 > Mat92
9x2 Real matrix, packed by columns.
Definition: SmallMatrix.h:257
Vec< 2 > Vec2
This is the most common 2D vector type: a column of 2 Real values stored consecutively in memory (pac...
Definition: SmallMatrix.h:126
SymMat< 6 > SymMat66
6x6 compact Real symmetric matrix.
Definition: SmallMatrix.h:269