//! Compute component-wise minimum of two vectors.
NCollection_Vec2 cwiseMin (const NCollection_Vec2& theVec) const
{
- return NCollection_Vec2 (Min (v[0], theVec.v[0]),
- Min (v[1], theVec.v[1]));
+ return NCollection_Vec2 (v[0] < theVec.v[0] ? v[0] : theVec.v[0],
+ v[1] < theVec.v[1] ? v[1] : theVec.v[1]);
}
//! Compute component-wise maximum of two vectors.
NCollection_Vec2 cwiseMax (const NCollection_Vec2& theVec) const
{
- return NCollection_Vec2 (Max (v[0], theVec.v[0]),
- Max (v[1], theVec.v[1]));
+ return NCollection_Vec2 (v[0] > theVec.v[0] ? v[0] : theVec.v[0],
+ v[1] > theVec.v[1] ? v[1] : theVec.v[1]);
}
//! Compute per-component multiplication by scale factor.
//! Compute component-wise minimum of two vectors.
NCollection_Vec3 cwiseMin (const NCollection_Vec3& theVec) const
{
- return NCollection_Vec3 (Min (v[0], theVec.v[0]),
- Min (v[1], theVec.v[1]),
- Min (v[2], theVec.v[2]));
+ return NCollection_Vec3 (v[0] < theVec.v[0] ? v[0] : theVec.v[0],
+ v[1] < theVec.v[1] ? v[1] : theVec.v[1],
+ v[2] < theVec.v[2] ? v[2] : theVec.v[2]);
}
//! Compute component-wise maximum of two vectors.
NCollection_Vec3 cwiseMax (const NCollection_Vec3& theVec) const
{
- return NCollection_Vec3 (Max (v[0], theVec.v[0]),
- Max (v[1], theVec.v[1]),
- Max (v[2], theVec.v[2]));
+ return NCollection_Vec3 (v[0] > theVec.v[0] ? v[0] : theVec.v[0],
+ v[1] > theVec.v[1] ? v[1] : theVec.v[1],
+ v[2] > theVec.v[2] ? v[2] : theVec.v[2]);
}
//! Compute per-component division by scale factor.
//! Compute component-wise minimum of two vectors.
NCollection_Vec4 cwiseMin (const NCollection_Vec4& theVec) const
{
- return NCollection_Vec4 (Min (v[0], theVec.v[0]),
- Min (v[1], theVec.v[1]),
- Min (v[2], theVec.v[2]),
- Min (v[3], theVec.v[3]));
+ return NCollection_Vec4 (v[0] < theVec.v[0] ? v[0] : theVec.v[0],
+ v[1] < theVec.v[1] ? v[1] : theVec.v[1],
+ v[2] < theVec.v[2] ? v[2] : theVec.v[2],
+ v[3] < theVec.v[3] ? v[3] : theVec.v[3]);
}
//! Compute component-wise maximum of two vectors.
NCollection_Vec4 cwiseMax (const NCollection_Vec4& theVec) const
{
- return NCollection_Vec4 (Max (v[0], theVec.v[0]),
- Max (v[1], theVec.v[1]),
- Max (v[2], theVec.v[2]),
- Max (v[3], theVec.v[3]));
+ return NCollection_Vec4 (v[0] > theVec.v[0] ? v[0] : theVec.v[0],
+ v[1] > theVec.v[1] ? v[1] : theVec.v[1],
+ v[2] > theVec.v[2] ? v[2] : theVec.v[2],
+ v[3] > theVec.v[3] ? v[3] : theVec.v[3]);
}
//! Compute per-component division by scale factor.