00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_VECTOR_CONCEPTS_INCLUDE
00013 #define MTL_VECTOR_CONCEPTS_INCLUDE
00014
00015 #include <boost/numeric/mtl/mtl_fwd.hpp>
00016 #include <boost/numeric/mtl/concept/collection.hpp>
00017
00018 #ifdef __GXX_CONCEPTS__
00019 # include <concepts>
00020 #else
00021 # include <boost/numeric/linear_algebra/pseudo_concept.hpp>
00022 #endif
00023
00024 namespace mtl {
00025
00030 #ifdef __GXX_CONCEPTS__
00031 concept Vector<typename T>
00032 : AlgebraicCollection<T>
00033 {
00034 const_reference T::operator() (size_type index) const;
00035
00036 const_reference T::operator[] (size_type index) const;
00037
00038 size_type nnz(T);
00039 };
00040 #else
00041
00042
00064 template <typename T>
00065 struct Vector
00066 : public AlgebraicCollection<T>
00067 {
00069 const_reference T::operator() (size_type index) const;
00070
00072 const_reference T::operator[] (size_type index) const;
00073 };
00074 #endif
00075
00076
00077 #ifdef __GXX_CONCEPTS__
00078 concept MutableVector<typename T>
00079 : Vector<T>,
00080 MutableCollection<T>
00081 {
00082 reference T::operator() (size_type index);
00083
00084 reference T::operator[] (size_type index);
00085 };
00086 #else
00087
00088
00107 template <typename T>
00108 struct MutableVector
00109 : public Vector<T>,
00110 public MutableCollection<T>
00111 {};
00112 #endif
00113
00114
00115 #ifdef __GXX_CONCEPTS__
00116 concept ConstantSizeVector<typename T>
00117 : Vector<T>,
00118 ConstantSizeAlgebraicCollection<T>
00119 {};
00120 #else
00121
00122
00127 template <typename T>
00128 struct ConstantSizeVector
00129 : public Vector<T>,
00130 public ConstantSizeAlgebraicCollection<T>
00131 {};
00132 #endif
00133
00134
00135
00137
00138
00139 }
00140
00141 #endif // MTL_VECTOR_CONCEPTS_INCLUDE