Tags.h

Go to the documentation of this file.
00001 /*
00002  * Expression Template Matrix Library
00003  *
00004  * Copyright (C) 2004 - 2006 Ricky Lung <mtlung@users.sourceforge.net>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 
00030 #ifdef _MSC_VER
00031 #pragma once
00032 #endif  // _MSC_VER
00033 
00034 #ifndef _EXMAT_TAGS_H
00035 #define _EXMAT_TAGS_H
00036 
00037 #include "Metaprogramming.h"
00038 
00039 namespace exmat {
00040 
00041 
00043 
00047 template<class C, class TAG>
00048 struct HasTagOf {
00049     enum {
00050         RET = IsDerivedFrom<C, TAG>::RET
00051     };
00052 };
00053 
00055 struct NullTag {
00056     EXMAT_INLINE2 NullTag() {}
00057 };
00058 
00060 struct LinearMemTag {
00061     EXMAT_INLINE2 LinearMemTag() {}
00062 };
00064 struct DenseTag {
00065     EXMAT_INLINE2 DenseTag() {}
00066 };
00068 struct ScalarTag {
00069     EXMAT_INLINE2 ScalarTag() {}
00070 };
00072 struct SIMDTag {
00073     EXMAT_INLINE2 SIMDTag() {}
00074 };
00076 struct SSETag {
00077     EXMAT_INLINE2 SSETag() {}
00078 };
00080 struct SSE2Tag {
00081     EXMAT_INLINE2 SSE2Tag() {}
00082 };
00084 struct RowMajorTag {
00085     EXMAT_INLINE2 RowMajorTag() {}
00086 };
00088 struct ColMajorTag {
00089     EXMAT_INLINE2 ColMajorTag() {}
00090 };
00091 
00093 struct UnaExpTag {
00094     EXMAT_INLINE2 UnaExpTag() {}
00095 };
00097 struct BinExpTag {
00098     EXMAT_INLINE2 BinExpTag() {}
00099 };
00101 struct AddExpTag {
00102     EXMAT_INLINE2 AddExpTag() {}
00103     static char* name()
00104     {   return "Add";   }
00105 };
00107 struct SubExpTag {
00108     EXMAT_INLINE2 SubExpTag() {}
00109     static char* name()
00110     {   return "Sub";   }
00111 };
00113 struct MulExpTag {
00114     EXMAT_INLINE2 MulExpTag() {}
00115     static char* name()
00116     {   return "Mul";   }
00117 };
00119 struct ScalarMulExpTag {
00120     EXMAT_INLINE2 ScalarMulExpTag() {}
00121     static char* name()
00122     {   return "Scalar Mul";    }
00123 };
00125 struct ScalarDivExpTag {
00126     EXMAT_INLINE2 ScalarDivExpTag() {}
00127     static char* name()
00128     {   return "Scalar Div";    }
00129 };
00130 
00132 struct ViewTag {
00133     EXMAT_INLINE2 ViewTag() {}
00134 };
00135 
00137 struct TransposeViewTag : public UnaExpTag, public ViewTag {
00138     EXMAT_INLINE2 TransposeViewTag() {}
00139     static char* name()
00140     {   return "Transpose"; }
00141 };
00143 struct DummyViewTag : public UnaExpTag, public ViewTag {
00144     EXMAT_INLINE2 DummyViewTag() {}
00145     static char* name()
00146     {   return "Dummy"; }
00147 };
00149 struct StaticSubVecViewTag : public UnaExpTag, public ViewTag {
00150     EXMAT_INLINE2 StaticSubVecViewTag() {}
00151     static char* name()
00152     {   return "Static sub-vector view";    }
00153 };
00155 struct DynSubVecViewTag : public UnaExpTag, public ViewTag {
00156     EXMAT_INLINE2 DynSubVecViewTag() {}
00157     static char* name()
00158     {   return "Dynamic sub-vector view";   }
00159 };
00161 struct StaticSubMatViewTag : public UnaExpTag, public ViewTag {
00162     EXMAT_INLINE2 StaticSubMatViewTag() {}
00163     static char* name()
00164     {   return "Static sub-matrix view";    }
00165 };
00167 struct DynSubMatViewTag : public UnaExpTag, public ViewTag {
00168     EXMAT_INLINE2 DynSubMatViewTag() {}
00169     static char* name()
00170     {   return "Dynamic sub-matrix view";   }
00171 };
00173 struct ReverseVecViewTag : public UnaExpTag, public ViewTag {
00174     EXMAT_INLINE2 ReverseVecViewTag() {}
00175     static char* name()
00176     {   return "Reverse vector view";   }
00177 };
00179 struct ColViewTag : public UnaExpTag, public ViewTag {
00180     EXMAT_INLINE2 ColViewTag() {}
00181     static char* name()
00182     {   return "Column view";   }
00183 };
00185 struct RowViewTag : public UnaExpTag, public ViewTag {
00186     EXMAT_INLINE2 RowViewTag() {}
00187     static char* name()
00188     {   return "Row view";  }
00189 };
00191 struct StaticMinorViewTag : public UnaExpTag, public ViewTag {
00192     EXMAT_INLINE2 StaticMinorViewTag() {}
00193     static char* name()
00194     {   return "Static minor view"; }
00195 };
00197 struct DynMinorViewTag : public UnaExpTag, public ViewTag {
00198     EXMAT_INLINE2 DynMinorViewTag() {}
00199     static char* name()
00200     {   return "Dynamic minor view";    }
00201 };
00203 struct CofactorsViewTag : public UnaExpTag, public ViewTag {
00204     EXMAT_INLINE2 CofactorsViewTag() {}
00205     static char* name()
00206     {   return "Cofactors view";    }
00207 };
00209 struct HMergeViewTag : public BinExpTag, public ViewTag {
00210     EXMAT_INLINE2 HMergeViewTag() {}
00211     static char* name()
00212     {   return "Horizontal merge view"; }
00213 };
00214 
00215 
00217 template<int I1, int I2> struct TParamINT2 {
00218     enum {
00219         INT1 = I1,
00220         INT2 = I2
00221     };
00222 };
00224 template<int I1, int I2, int I3, int I4> struct TParamINT4 {
00225     enum {
00226         INT1 = I1,
00227         INT2 = I2,
00228         INT3 = I3,
00229         INT4 = I4
00230     };
00231 };
00232 
00233 }   // namespace exmat
00234 
00235 #endif  // _EXMAT_TAGS_H

Generated on Sat May 6 23:12:03 2006 for Exmat by  doxygen 1.4.6-NO