#include <mof/base/mofdef.hpp>
#include <mof/math/threshold.hpp>
#include <boost/operators.hpp>
++#include <boost/utility.hpp>
#include <ostream>
#include <iomanip>
#include <cmath>
}
//}}}
};
- class row_of_matrix
+ //{{{ swap
+ template <size_t Dim, typename Derived, typename Coordinate>
+ void swap
+ (
+ basic_matrix<Dim, Derived, Coordinate>& a,
+ basic_matrix<Dim, Derived, Coordinate>& b
+ ) throw()
+ {
+ a.swap(b);
+ }
+ //}}}
+ //{{{ row_of_matrix
+ /**
+ * @brief M[i][j]のように行列の要素を取得するための補助クラス
+ */
+ template <size_t Dim>
++ class row_of_matrix : boost::noncopyable
+ {
+ size_t index_;
+ const float (&elements_)[Dim][Dim+1];
++
+ public:
+ row_of_matrix(size_t i, const float (&elements)[Dim][Dim+1])
+ : index_(i), elements_(elements)
+ {
+ }
+
++ row_of_matrix(const row_of_matrix<Dim>&& rhs)
++ : index_(rhs.index_), elements_(rhs.elements_)
++ {
++ }
++
+ float operator[](size_t j) const
+ {
+ if (Dim != index_) return elements_[index_][j];
+ else if (Dim == j) return 1;
+ else return 0;
+ }
+ };
+ //}}}
}// namespace math
}// namespace mof