diff --git a/src/map/matrix.cpp b/src/map/matrix.cpp index eae769ad..b04dd0da 100644 --- a/src/map/matrix.cpp +++ b/src/map/matrix.cpp @@ -5,9 +5,6 @@ Matrix::~Matrix() { - if (isNull()) - return; - delete[] _m; } @@ -35,28 +32,6 @@ Matrix::Matrix(const Matrix& M) m(i,j) = M.m(i,j); } -Matrix &Matrix::operator=(const Matrix &M) -{ - if (this != &M) { - if (_h != M._h || _w != M._w) { - if (!isNull()) - delete[] _m; - - _h = M._h; _w = M._w; - if (isNull()) - _m = 0; - else - _m = new double[_h * _w]; - } - - for (size_t i = 0; i < _h; i++) - for (size_t j = 0; j < _w; j++) - m(i,j) = M.m(i,j); - } - - return *this; -} - bool Matrix::eliminate(double epsilon) { size_t i, j, k, maxrow; diff --git a/src/map/matrix.h b/src/map/matrix.h index d41e1fb7..86c108d5 100644 --- a/src/map/matrix.h +++ b/src/map/matrix.h @@ -13,8 +13,6 @@ public: Matrix(const Matrix& M); ~Matrix(); - Matrix &operator=(const Matrix &M); - size_t h() const {return _h;} size_t w() const {return _w;} double &m(size_t i, size_t j) {return _m[_w * i + j];} diff --git a/src/map/transform.cpp b/src/map/transform.cpp index 2d8b264b..ec84ee74 100644 --- a/src/map/transform.cpp +++ b/src/map/transform.cpp @@ -53,7 +53,7 @@ void Transform::affine(const QList &points) Q.m(i,j) += v[i] * v[j]; } - Matrix M = Q.augemented(c); + Matrix M(Q.augemented(c)); if (!M.eliminate()) { _errorString = "Singular transformation matrix"; return;