]> git.tdb.fi Git - libs/math.git/blobdiff - source/linal/matrix.h
Don't qualify potentially overloaded functions with the std namespace
[libs/math.git] / source / linal / matrix.h
index ff73165d02c703c0efe263b27f23a522c54b7383..6c04454296e51ae2162e0534f1def87fa379afac 100644 (file)
@@ -54,9 +54,11 @@ inline Matrix<T, M, N>::Matrix(const T *d)
 
 template<typename T, unsigned M, unsigned N>
 template<typename U>
-inline Matrix<T, M, N>::Matrix(const Matrix<U, M, N> &m)
+inline Matrix<T, M, N>::Matrix(const Matrix<U, M, N> &other)
 {
-       std::copy(m.data, m.data+M*N, data);
+       for(unsigned i=0; i<M; ++i)
+               for(unsigned j=0; j<N; ++j)
+                       element(i, j) = other(i, j);
 }
 
 template<typename T, unsigned M, unsigned N>
@@ -187,8 +189,9 @@ inline bool operator==(const Matrix<T, M, N> &a, const Matrix<T, M, N> &b)
 template<typename T, unsigned M, unsigned N>
 inline Matrix<T, M, N> &Matrix<T, M, N>::exchange_rows(unsigned i, unsigned j)
 {
+       using std::swap;
        for(unsigned k=0; k<N; ++k)
-               std::swap(element(i, k), element(j, k));
+               swap(element(i, k), element(j, k));
        return *this;
 }