00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_MATRIX_PERMUTATION_INCLUDE
00013 #define MTL_MATRIX_PERMUTATION_INCLUDE
00014
00015 #include <boost/numeric/mtl/operation/size.hpp>
00016 #include <boost/numeric/mtl/matrix/reorder.hpp>
00017
00018 namespace mtl { namespace matrix {
00019
00020
00021 namespace traits {
00022
00023
00024
00025 template <typename Value= double>
00026 struct permutation
00027 {
00028 typedef typename reorder<Value>::type type;
00029 };
00030 }
00031
00032 template <typename Value, typename PermutationVector>
00033 typename traits::permutation<Value>::type
00034 inline permutation(const PermutationVector& v)
00035 {
00036 using mtl::size;
00037 return reorder(v, size(v));
00038 }
00039
00041 template <typename PermutationVector>
00042 typename traits::permutation<>::type
00043 inline permutation(const PermutationVector& v)
00044 {
00045 return permutation<double>(v);
00046 }
00047
00048
00049 }}
00050
00051 namespace mtl { namespace vector {
00052
00054 using mtl::matrix::permutation;
00055
00056 }}
00057
00058 #endif // MTL_MATRIX_PERMUTATION_INCLUDE