00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_SIZE1D_INCLUDE
00013 #define MTL_SIZE1D_INCLUDE
00014
00015 #include <boost/numeric/mtl/mtl_fwd.hpp>
00016 #include <boost/numeric/mtl/concept/collection.hpp>
00017 #include <boost/numeric/mtl/operation/size.hpp>
00018
00019 #include <boost/type_traits.hpp>
00020 #include <boost/utility/enable_if.hpp>
00021
00022 namespace mtl {
00023
00024 namespace vector {
00025
00026 #if 0
00027 template <typename Vector>
00028 typename Collection<Vector>::size_type
00029 inline size1D(const Vector& v)
00030 {
00031 return size(v);
00032 }
00033 #endif
00034
00035
00036 template <typename Value, typename P>
00037 std::size_t inline size1D(const dense_vector<Value, P>& v)
00038 {
00039 return size(v);
00040 }
00041 }
00042
00043 namespace matrix {
00044
00045 template <typename Vector>
00046 typename Collection<multi_vector<Vector> >::size_type
00047 inline size1D(multi_vector<Vector>& A)
00048 {
00049 return num_cols(A);
00050 }
00051 }
00052
00054
00058 template <typename Vector>
00059 typename traits::size<Vector>::type
00060 inline size1D(const Vector& v)
00061 {
00062 return traits::size<Vector>()(v);
00063 }
00064
00065 }
00066
00067 #endif // MTL_SIZE1D_INCLUDE