Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:01

0001 #ifndef DataFormats_Math_AlgebraicROOTObjects_h_
0002 #define DataFormats_Math_AlgebraicROOTObjects_h_
0003 
0004 #define SMATRIX_USE_CONSTEXPR
0005 #include <Math/SVector.h>
0006 #include <Math/SMatrix.h>
0007 
0008 // Use ".!" in VIM
0009 // for I in $(seq 1 6); do echo "typedef ROOT::Math::SVector<double,$I> AlgebraicVector$I;"; done
0010 typedef ROOT::Math::SVector<double, 1> AlgebraicVector1;
0011 typedef ROOT::Math::SVector<double, 2> AlgebraicVector2;
0012 typedef ROOT::Math::SVector<double, 3> AlgebraicVector3;
0013 typedef ROOT::Math::SVector<double, 4> AlgebraicVector4;
0014 typedef ROOT::Math::SVector<double, 5> AlgebraicVector5;
0015 typedef ROOT::Math::SVector<double, 6> AlgebraicVector6;
0016 typedef ROOT::Math::SVector<double, 15> AlgebraicVector15;
0017 
0018 // for I in $(seq 1 6); do echo "typedef ROOT::Math::SMatrix<double,$I,$I,ROOT::Math::MatRepSym<double,$I> > AlgebraicSymMatrix$I$I;"; done
0019 typedef ROOT::Math::SMatrix<double, 1, 1, ROOT::Math::MatRepSym<double, 1> > AlgebraicSymMatrix11;
0020 typedef ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepSym<double, 2> > AlgebraicSymMatrix22;
0021 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > AlgebraicSymMatrix33;
0022 typedef ROOT::Math::SMatrix<double, 4, 4, ROOT::Math::MatRepSym<double, 4> > AlgebraicSymMatrix44;
0023 typedef ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double, 5> > AlgebraicSymMatrix55;
0024 typedef ROOT::Math::SMatrix<double, 6, 6, ROOT::Math::MatRepSym<double, 6> > AlgebraicSymMatrix66;
0025 
0026 // for I in $(seq 1 6); do for J in $(seq 1 6); do echo "typedef ROOT::Math::SMatrix<double,$I,$J,ROOT::Math::MatRepStd<double,$I,$J> > AlgebraicMatrix$I$J;"; done; done
0027 typedef ROOT::Math::SMatrix<double, 1, 1, ROOT::Math::MatRepStd<double, 1, 1> > AlgebraicMatrix11;
0028 typedef ROOT::Math::SMatrix<double, 1, 2, ROOT::Math::MatRepStd<double, 1, 2> > AlgebraicMatrix12;
0029 typedef ROOT::Math::SMatrix<double, 1, 3, ROOT::Math::MatRepStd<double, 1, 3> > AlgebraicMatrix13;
0030 typedef ROOT::Math::SMatrix<double, 1, 4, ROOT::Math::MatRepStd<double, 1, 4> > AlgebraicMatrix14;
0031 typedef ROOT::Math::SMatrix<double, 1, 5, ROOT::Math::MatRepStd<double, 1, 5> > AlgebraicMatrix15;
0032 typedef ROOT::Math::SMatrix<double, 1, 6, ROOT::Math::MatRepStd<double, 1, 6> > AlgebraicMatrix16;
0033 typedef ROOT::Math::SMatrix<double, 2, 1, ROOT::Math::MatRepStd<double, 2, 1> > AlgebraicMatrix21;
0034 typedef ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepStd<double, 2, 2> > AlgebraicMatrix22;
0035 typedef ROOT::Math::SMatrix<double, 2, 3, ROOT::Math::MatRepStd<double, 2, 3> > AlgebraicMatrix23;
0036 typedef ROOT::Math::SMatrix<double, 2, 4, ROOT::Math::MatRepStd<double, 2, 4> > AlgebraicMatrix24;
0037 typedef ROOT::Math::SMatrix<double, 2, 5, ROOT::Math::MatRepStd<double, 2, 5> > AlgebraicMatrix25;
0038 typedef ROOT::Math::SMatrix<double, 2, 6, ROOT::Math::MatRepStd<double, 2, 6> > AlgebraicMatrix26;
0039 typedef ROOT::Math::SMatrix<double, 3, 1, ROOT::Math::MatRepStd<double, 3, 1> > AlgebraicMatrix31;
0040 typedef ROOT::Math::SMatrix<double, 3, 2, ROOT::Math::MatRepStd<double, 3, 2> > AlgebraicMatrix32;
0041 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepStd<double, 3, 3> > AlgebraicMatrix33;
0042 typedef ROOT::Math::SMatrix<double, 3, 4, ROOT::Math::MatRepStd<double, 3, 4> > AlgebraicMatrix34;
0043 typedef ROOT::Math::SMatrix<double, 3, 5, ROOT::Math::MatRepStd<double, 3, 5> > AlgebraicMatrix35;
0044 typedef ROOT::Math::SMatrix<double, 3, 6, ROOT::Math::MatRepStd<double, 3, 6> > AlgebraicMatrix36;
0045 typedef ROOT::Math::SMatrix<double, 4, 1, ROOT::Math::MatRepStd<double, 4, 1> > AlgebraicMatrix41;
0046 typedef ROOT::Math::SMatrix<double, 4, 2, ROOT::Math::MatRepStd<double, 4, 2> > AlgebraicMatrix42;
0047 typedef ROOT::Math::SMatrix<double, 4, 3, ROOT::Math::MatRepStd<double, 4, 3> > AlgebraicMatrix43;
0048 typedef ROOT::Math::SMatrix<double, 4, 4, ROOT::Math::MatRepStd<double, 4, 4> > AlgebraicMatrix44;
0049 typedef ROOT::Math::SMatrix<double, 4, 5, ROOT::Math::MatRepStd<double, 4, 5> > AlgebraicMatrix45;
0050 typedef ROOT::Math::SMatrix<double, 4, 6, ROOT::Math::MatRepStd<double, 4, 6> > AlgebraicMatrix46;
0051 typedef ROOT::Math::SMatrix<double, 5, 1, ROOT::Math::MatRepStd<double, 5, 1> > AlgebraicMatrix51;
0052 typedef ROOT::Math::SMatrix<double, 5, 2, ROOT::Math::MatRepStd<double, 5, 2> > AlgebraicMatrix52;
0053 typedef ROOT::Math::SMatrix<double, 5, 3, ROOT::Math::MatRepStd<double, 5, 3> > AlgebraicMatrix53;
0054 typedef ROOT::Math::SMatrix<double, 5, 4, ROOT::Math::MatRepStd<double, 5, 4> > AlgebraicMatrix54;
0055 typedef ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepStd<double, 5, 5> > AlgebraicMatrix55;
0056 typedef ROOT::Math::SMatrix<double, 5, 6, ROOT::Math::MatRepStd<double, 5, 6> > AlgebraicMatrix56;
0057 typedef ROOT::Math::SMatrix<double, 6, 1, ROOT::Math::MatRepStd<double, 6, 1> > AlgebraicMatrix61;
0058 typedef ROOT::Math::SMatrix<double, 6, 2, ROOT::Math::MatRepStd<double, 6, 2> > AlgebraicMatrix62;
0059 typedef ROOT::Math::SMatrix<double, 6, 3, ROOT::Math::MatRepStd<double, 6, 3> > AlgebraicMatrix63;
0060 typedef ROOT::Math::SMatrix<double, 6, 4, ROOT::Math::MatRepStd<double, 6, 4> > AlgebraicMatrix64;
0061 typedef ROOT::Math::SMatrix<double, 6, 5, ROOT::Math::MatRepStd<double, 6, 5> > AlgebraicMatrix65;
0062 typedef ROOT::Math::SMatrix<double, 6, 6, ROOT::Math::MatRepStd<double, 6, 6> > AlgebraicMatrix66;
0063 
0064 /// ============= When we need templated root objects
0065 template <unsigned int D1, unsigned int D2 = D1>
0066 struct AlgebraicROOTObject {
0067   typedef typename ROOT::Math::SVector<double, D1> Vector;
0068   typedef typename ROOT::Math::SMatrix<double, D1, D1, ROOT::Math::MatRepSym<double, D1> > SymMatrix;
0069   typedef typename ROOT::Math::SMatrix<double, D1, D2, ROOT::Math::MatRepStd<double, D1, D2> > Matrix;
0070 };
0071 
0072 typedef ROOT::Math::SMatrixIdentity AlgebraicMatrixID;
0073 
0074 #endif