Commit 592c13ab authored by Max Lyon's avatar Max Lyon
Browse files

add non-member versions of min and max for vector class

parent 05332c70
......@@ -759,6 +759,21 @@ VectorT<Scalar, DIM>& minimize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>&
return _v1.minimize(_v2);
}
/// \relates OpenMesh::VectorT
/// non-member max
template<typename Scalar, int DIM>
VectorT<Scalar, DIM>& max(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
return VectorT<Scalar, DIM>(_v1).maximize(_v2);
}
/// \relates OpenMesh::VectorT
/// non-member min
template<typename Scalar, int DIM>
VectorT<Scalar, DIM>& min(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
return VectorT<Scalar, DIM>(_v1).minimize(_v2);
}
//== TYPEDEFS =================================================================
/** 1-byte signed vector */
......
......@@ -317,6 +317,22 @@ VectorT<Scalar, DIM>& minimize(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>&
}
/// \relates OpenMesh::VectorT
/// non-member max
template<typename Scalar, int DIM>
VectorT<Scalar, DIM>& max(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
return VectorT<Scalar, DIM>(_v1).maximize(_v2);
}
/// \relates OpenMesh::VectorT
/// non-member min
template<typename Scalar, int DIM>
VectorT<Scalar, DIM>& max(VectorT<Scalar, DIM>& _v1, VectorT<Scalar, DIM>& _v2) {
return VectorT<Scalar, DIM>(_v1).minimize(_v2);
}
//== TYPEDEFS =================================================================
/** 1-byte signed vector */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment