Skip to content

Commit

Permalink
Merge pull request #191 from IasonManolas/devel
Browse files Browse the repository at this point in the history
Forward declared Transpose function since it was used before declared…
  • Loading branch information
alemuntoni authored Mar 17, 2023
2 parents f413a74 + 285ba9c commit 970f4af
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vcg/math/matrix44.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ for 'column' vectors.
*/

template<class T> class Matrix44;
template<class T> Matrix44<T> &Transpose(Matrix44<T> &m);

/** This class represent a 4x4 matrix. T is the kind of element in the matrix.
*/
template <class T> class Matrix44 {
Expand Down Expand Up @@ -242,8 +245,6 @@ template <class T> class Matrix44 {

///Premultiply
template <class T> Point3<T> operator*(const Matrix44<T> &m, const Point3<T> &p);

template <class T> Matrix44<T> &Transpose(Matrix44<T> &m);
//return NULL matrix if not invertible
template <class T> Matrix44<T> Inverse(const Matrix44<T> &m);

Expand Down Expand Up @@ -661,7 +662,9 @@ template <class T> Point3<T> operator*(const Matrix44<T> &m, const Point3<T> &p)
return s;
}

template <class T> Matrix44<T> &Transpose(Matrix44<T> &m) {
template<class T>
Matrix44<T> &Transpose(Matrix44<T> &m)
{
for(int i = 1; i < 4; i++)
for(int j = 0; j < i; j++) {
std::swap(m.ElementAt(i, j), m.ElementAt(j, i));
Expand Down

0 comments on commit 970f4af

Please sign in to comment.