Simbody
|
00001 #ifndef SimTK_SIMMATRIX_SMALLMATRIX_H_ 00002 #define SimTK_SIMMATRIX_SMALLMATRIX_H_ 00003 00004 /* -------------------------------------------------------------------------- * 00005 * SimTK Core: SimTK Simmatrix(tm) * 00006 * -------------------------------------------------------------------------- * 00007 * This is part of the SimTK Core biosimulation toolkit originating from * 00008 * Simbios, the NIH National Center for Physics-Based Simulation of * 00009 * Biological Structures at Stanford, funded under the NIH Roadmap for * 00010 * Medical Research, grant U54 GM072970. See https://simtk.org. * 00011 * * 00012 * Portions copyright (c) 2005-7 Stanford University and the Authors. * 00013 * Authors: Michael Sherman * 00014 * Contributors: * 00015 * * 00016 * Permission is hereby granted, free of charge, to any person obtaining a * 00017 * copy of this software and associated documentation files (the "Software"), * 00018 * to deal in the Software without restriction, including without limitation * 00019 * the rights to use, copy, modify, merge, publish, distribute, sublicense, * 00020 * and/or sell copies of the Software, and to permit persons to whom the * 00021 * Software is furnished to do so, subject to the following conditions: * 00022 * * 00023 * The above copyright notice and this permission notice shall be included in * 00024 * all copies or substantial portions of the Software. * 00025 * * 00026 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * 00027 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * 00028 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * 00029 * THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 00030 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 00031 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * 00032 * USE OR OTHER DEALINGS IN THE SOFTWARE. * 00033 * -------------------------------------------------------------------------- */ 00034 00096 #include "SimTKcommon/Scalar.h" 00097 #include "SimTKcommon/TemplatizedLapack.h" 00098 00099 // Forward declarations. 00100 namespace SimTK { 00101 00102 template <int M, class E=Real, int STRIDE=1> class Vec; 00103 template <int N, class E=Real, int STRIDE=1> class Row; 00104 template <int M, int N, class E=Real, int CS=M, int RS=1> class Mat; // col & row spacing 00105 template <int M, class E=Real, int RS=1> class SymMat; 00106 00107 } // namespace SimTK 00108 00109 #include "SimTKcommon/internal/ResultType.h" 00110 #include "SimTKcommon/internal/Vec.h" 00111 #include "SimTKcommon/internal/Row.h" 00112 #include "SimTKcommon/internal/Mat.h" 00113 #include "SimTKcommon/internal/SymMat.h" 00114 #include "SimTKcommon/internal/SmallMatrixMixed.h" 00115 00116 // Friendly abbreviations. 00117 namespace SimTK { 00118 00119 typedef Vec<1> Vec1; // just a scalar 00120 typedef Vec<2> Vec2; 00121 typedef Vec<3> Vec3; 00122 typedef Vec<4> Vec4; 00123 typedef Vec<5> Vec5; 00124 typedef Vec<6> Vec6; 00125 typedef Vec<7> Vec7; 00126 typedef Vec<8> Vec8; 00127 typedef Vec<9> Vec9; 00128 00129 typedef Vec<1,float> fVec1; // just a scalar 00130 typedef Vec<2,float> fVec2; 00131 typedef Vec<3,float> fVec3; 00132 typedef Vec<4,float> fVec4; 00133 typedef Vec<5,float> fVec5; 00134 typedef Vec<6,float> fVec6; 00135 typedef Vec<7,float> fVec7; 00136 typedef Vec<8,float> fVec8; 00137 typedef Vec<9,float> fVec9; 00138 00139 typedef Row<1> Row1; // just a scalar 00140 typedef Row<2> Row2; 00141 typedef Row<3> Row3; 00142 typedef Row<4> Row4; 00143 typedef Row<5> Row5; 00144 typedef Row<6> Row6; 00145 typedef Row<7> Row7; 00146 typedef Row<8> Row8; 00147 typedef Row<9> Row9; 00148 00149 typedef Row<1,float> fRow1; // just a scalar 00150 typedef Row<2,float> fRow2; 00151 typedef Row<3,float> fRow3; 00152 typedef Row<4,float> fRow4; 00153 typedef Row<5,float> fRow5; 00154 typedef Row<6,float> fRow6; 00155 typedef Row<7,float> fRow7; 00156 typedef Row<8,float> fRow8; 00157 typedef Row<9,float> fRow9; 00158 00159 typedef SymMat<1> SymMat11; // just a scalar 00160 typedef SymMat<2> SymMat22; 00161 typedef SymMat<3> SymMat33; 00162 typedef SymMat<4> SymMat44; 00163 typedef SymMat<5> SymMat55; 00164 typedef SymMat<6> SymMat66; 00165 typedef SymMat<7> SymMat77; 00166 typedef SymMat<8> SymMat88; 00167 typedef SymMat<9> SymMat99; 00168 00169 typedef SymMat<1,float> fSymMat11; // just a scalar 00170 typedef SymMat<2,float> fSymMat22; 00171 typedef SymMat<3,float> fSymMat33; 00172 typedef SymMat<4,float> fSymMat44; 00173 typedef SymMat<5,float> fSymMat55; 00174 typedef SymMat<6,float> fSymMat66; 00175 typedef SymMat<7,float> fSymMat77; 00176 typedef SymMat<8,float> fSymMat88; 00177 typedef SymMat<9,float> fSymMat99; 00178 00179 typedef Mat<1,1> Mat11; // This is just a scalar 00180 typedef Mat<1,2> Mat12; // The rest here are just single Rows 00181 typedef Mat<1,3> Mat13; 00182 typedef Mat<1,4> Mat14; 00183 typedef Mat<1,5> Mat15; 00184 typedef Mat<1,6> Mat16; 00185 typedef Mat<1,7> Mat17; 00186 typedef Mat<1,8> Mat18; 00187 typedef Mat<1,9> Mat19; 00188 00189 typedef Mat<2,1> Mat21; // Mats with 2 rows 00190 typedef Mat<2,2> Mat22; 00191 typedef Mat<2,3> Mat23; 00192 typedef Mat<2,4> Mat24; 00193 typedef Mat<2,5> Mat25; 00194 typedef Mat<2,6> Mat26; 00195 typedef Mat<2,7> Mat27; 00196 typedef Mat<2,8> Mat28; 00197 typedef Mat<2,9> Mat29; 00198 00199 typedef Mat<3,1> Mat31; // Mats with 3 rows 00200 typedef Mat<3,2> Mat32; 00201 typedef Mat<3,3> Mat33; 00202 typedef Mat<3,4> Mat34; 00203 typedef Mat<3,5> Mat35; 00204 typedef Mat<3,6> Mat36; 00205 typedef Mat<3,7> Mat37; 00206 typedef Mat<3,8> Mat38; 00207 typedef Mat<3,9> Mat39; 00208 00209 typedef Mat<4,1> Mat41; // Mats with 4 rows 00210 typedef Mat<4,2> Mat42; 00211 typedef Mat<4,3> Mat43; 00212 typedef Mat<4,4> Mat44; 00213 typedef Mat<4,5> Mat45; 00214 typedef Mat<4,6> Mat46; 00215 typedef Mat<4,7> Mat47; 00216 typedef Mat<4,8> Mat48; 00217 typedef Mat<4,9> Mat49; 00218 00219 typedef Mat<5,1> Mat51; // Mats with 5 rows 00220 typedef Mat<5,2> Mat52; 00221 typedef Mat<5,3> Mat53; 00222 typedef Mat<5,4> Mat54; 00223 typedef Mat<5,5> Mat55; 00224 typedef Mat<5,6> Mat56; 00225 typedef Mat<5,7> Mat57; 00226 typedef Mat<5,8> Mat58; 00227 typedef Mat<5,9> Mat59; 00228 00229 typedef Mat<6,1> Mat61; // Mats with 6 rows 00230 typedef Mat<6,2> Mat62; 00231 typedef Mat<6,3> Mat63; 00232 typedef Mat<6,4> Mat64; 00233 typedef Mat<6,5> Mat65; 00234 typedef Mat<6,6> Mat66; 00235 typedef Mat<6,7> Mat67; 00236 typedef Mat<6,8> Mat68; 00237 typedef Mat<6,9> Mat69; 00238 00239 typedef Mat<7,1> Mat71; // Mats with 7 rows 00240 typedef Mat<7,2> Mat72; 00241 typedef Mat<7,3> Mat73; 00242 typedef Mat<7,4> Mat74; 00243 typedef Mat<7,5> Mat75; 00244 typedef Mat<7,6> Mat76; 00245 typedef Mat<7,7> Mat77; 00246 typedef Mat<7,8> Mat78; 00247 typedef Mat<7,9> Mat79; 00248 00249 typedef Mat<8,1> Mat81; // Mats with 8 rows 00250 typedef Mat<8,2> Mat82; 00251 typedef Mat<8,3> Mat83; 00252 typedef Mat<8,4> Mat84; 00253 typedef Mat<8,5> Mat85; 00254 typedef Mat<8,6> Mat86; 00255 typedef Mat<8,7> Mat87; 00256 typedef Mat<8,8> Mat88; 00257 typedef Mat<8,9> Mat89; 00258 00259 typedef Mat<9,1> Mat91; // Mats with 9 rows 00260 typedef Mat<9,2> Mat92; 00261 typedef Mat<9,3> Mat93; 00262 typedef Mat<9,4> Mat94; 00263 typedef Mat<9,5> Mat95; 00264 typedef Mat<9,6> Mat96; 00265 typedef Mat<9,7> Mat97; 00266 typedef Mat<9,8> Mat98; 00267 typedef Mat<9,9> Mat99; 00268 00269 // Just doing some of the popular ones for now. 00270 typedef Mat<1,1,float> fMat11; 00271 typedef Mat<2,2,float> fMat22; 00272 typedef Mat<3,3,float> fMat33; 00273 typedef Mat<3,4,float> fMat34; 00274 typedef Mat<4,3,float> fMat43; 00275 typedef Mat<4,4,float> fMat44; 00276 typedef Mat<5,5,float> fMat55; 00277 typedef Mat<6,6,float> fMat66; 00278 typedef Mat<7,7,float> fMat77; 00279 typedef Mat<8,8,float> fMat88; 00280 typedef Mat<9,9,float> fMat99; 00281 00282 00283 } //namespace SimTK 00284 00285 00286 #endif //SimTK_SIMMATRIX_SMALLMATRIX_H_