00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ITL_PC_IDENTITY_INCLUDE
00013 #define ITL_PC_IDENTITY_INCLUDE
00014
00015 #include <boost/numeric/mtl/concept/collection.hpp>
00016
00017 namespace itl { namespace pc {
00018
00019 template <typename Matrix>
00020 class identity
00021 {
00022 public:
00023 typedef typename mtl::Collection<Matrix>::value_type value_type;
00024 typedef typename mtl::Collection<Matrix>::size_type size_type;
00025 typedef identity self;
00026
00027 identity(const Matrix&) {}
00028
00029 template <typename Vector>
00030 Vector solve(const Vector& x) const
00031 {
00032 return x;
00033 }
00034
00035 template <typename Vector>
00036 Vector adjoint_solve(const Vector& x) const
00037 {
00038 return x;
00039 }
00040 };
00041
00042
00043 template <typename Matrix, typename Vector>
00044 inline Vector solve(const identity<Matrix>&, const Vector& x)
00045 {
00046 return x;
00047 }
00048
00049 template <typename Matrix, typename Vector>
00050 inline Vector adjoint_solve(const identity<Matrix>&, const Vector& x)
00051 {
00052 return x;
00053 }
00054
00055
00056
00057 }}
00058
00059 #endif // ITL_PC_IDENTITY_INCLUDE