X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmof%2Fmath%2Fbasic_matrix.hpp;h=4213283443d37f1924089f3e910fc015672da8a9;hb=5fe9694db8fc2f28e6c6d999472b0774ea7f92ca;hp=143a8a45f9673be38c5b75e2a4ce259c06acde37;hpb=6a86c988a3d8a83b7bd2b71b2ff956ecc3837003;p=moflib%2Fmoflib.git diff --git a/src/mof/math/basic_matrix.hpp b/src/mof/math/basic_matrix.hpp index 143a8a4..4213283 100644 --- a/src/mof/math/basic_matrix.hpp +++ b/src/mof/math/basic_matrix.hpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -233,16 +234,22 @@ namespace math * @brief M[i][j]のように行列の要素を取得するための補助クラス */ template - class row_of_matrix + 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&& rhs) + : index_(rhs.index_), elements_(rhs.elements_) + { + } + float operator[](size_t j) const { if (Dim != index_) return elements_[index_][j];