#ifndef MTL_ORIEN_H #define MTL_ORIEN_H namespace mtl { struct row_orien; struct column_orien; struct row_major; struct column_major; //: Row Orientation // This is used in matrix_implementation and in the indexer objects // to map (row,column) to (major,minor). struct row_orien { template struct dims { enum { M = MM, N = NN }; }; typedef row_tag orientation; typedef row_major constructor_tag; typedef column_orien transpose_type; template static typename Dim::size_type row(Dim d) { return d.first(); } template static typename Dim::size_type column(Dim d){ return d.second();} template static Dim map(Dim d) { return d; } }; //: Column Orientation // This is used in matrix_implementation and in the indexer objects // to map (row,column) to (minor,major). struct column_orien { template struct dims { enum { M = NN, N = MM }; }; typedef column_tag orientation; typedef row_orien transpose_type; typedef column_major constructor_tag; template static typename Dim::size_type row(Dim d) { return d.second(); } template static typename Dim::size_type column(Dim d){ return d.first(); } #if 0 /* the static dim has already been transposed in matrix.h so no need to do it here */ template static typename Dim::transpose_type map(Dim d) { return d.transpose(); } #else template static Dim map(Dim d) { return Dim(d.second(), d.first()); } #endif }; } /* namespace mtl */ #endif /* MTL_ORIEN_H */