OSDN Git Service

fix for build on winXP
authoro_ggy <o_ggy@users.sourceforge.jp>
Mon, 6 Sep 2010 03:33:25 +0000 (12:33 +0900)
committero_ggy <o_ggy@users.sourceforge.jp>
Mon, 6 Sep 2010 03:33:25 +0000 (12:33 +0900)
1  2 
.gitignore.swp
sample/numeric/.main.cpp.swp
src/mof/math/basic_matrix.hpp

diff --cc .gitignore.swp
index fb42d30,fb42d30..0000000
deleted file mode 100644,100644
Binary files differ
diff --cc sample/numeric/.main.cpp.swp
index b5e8020,b5e8020..0000000
deleted file mode 100644,100644
Binary files differ
@@@ -2,6 -2,6 +2,7 @@@
  #include <mof/base/mofdef.hpp>
  #include <mof/math/threshold.hpp>
  #include <boost/operators.hpp>
++#include <boost/utility.hpp>
  #include <ostream>
  #include <iomanip>
  #include <cmath>
@@@ -240,5 -217,39 +218,45 @@@ namespace mat
                }
  //}}}
        };
 -      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