inline Reduce_<> functions
All checks were successful
Linux arm64 / Build (push) Successful in 4m34s
All checks were successful
Linux arm64 / Build (push) Successful in 4m34s
This commit is contained in:
@@ -242,7 +242,7 @@ Vec3<T>& operator/=(Vec3<T>& vect, const Vec3<T>& other) {
|
||||
* @param v
|
||||
* @return constexpr T
|
||||
*/
|
||||
float ReduceMin(Vec3f v) {
|
||||
inline float ReduceMin(Vec3f v) {
|
||||
return fminf(fminf(v.x, v.y), v.z);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ float ReduceMin(Vec3f v) {
|
||||
* @param v
|
||||
* @return constexpr T
|
||||
*/
|
||||
float ReduceMax(Vec3f v) {
|
||||
inline float ReduceMax(Vec3f v) {
|
||||
return fmaxf(fmaxf(v.x, v.y), v.z);
|
||||
}
|
||||
|
||||
@@ -290,59 +290,59 @@ constexpr Vec3f Max(const Vec3f& self, const Vec3f& other) {
|
||||
};
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief returns the (signed) minimal coordinate of the vector
|
||||
// *
|
||||
// * @param v
|
||||
// * @return constexpr T
|
||||
// */
|
||||
// double ReduceMin(Vec3d v) {
|
||||
// return fmin(fmin(v.x, v.y), v.z);
|
||||
// }
|
||||
/**
|
||||
* @brief returns the (signed) minimal coordinate of the vector
|
||||
*
|
||||
* @param v
|
||||
* @return constexpr T
|
||||
*/
|
||||
inline double ReduceMin(Vec3d v) {
|
||||
return fmin(fmin(v.x, v.y), v.z);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief returns the (signed) maximal coordinate of the vector
|
||||
// *
|
||||
// * @param v
|
||||
// * @return constexpr T
|
||||
// */
|
||||
// double ReduceMax(Vec3d v) {
|
||||
// return fmax(fmax(v.x, v.y), v.z);
|
||||
// }
|
||||
/**
|
||||
* @brief returns the (signed) maximal coordinate of the vector
|
||||
*
|
||||
* @param v
|
||||
* @return constexpr T
|
||||
*/
|
||||
inline double ReduceMax(Vec3d v) {
|
||||
return fmax(fmax(v.x, v.y), v.z);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief returns the coordinate-wise minimum of the given vectors,
|
||||
// * where a coordinate in the returned vector is NAN iff any of the two compared ones are NAN
|
||||
// *
|
||||
// * @tparam T
|
||||
// * @param self
|
||||
// * @param other
|
||||
// * @return constexpr Vec3f
|
||||
// */
|
||||
// constexpr Vec3d Min(const Vec3d& self, const Vec3d& other) {
|
||||
// return {
|
||||
// (std::min)(self.x, other.x),
|
||||
// (std::min)(self.y, other.y),
|
||||
// (std::min)(self.z, other.z),
|
||||
// };
|
||||
// }
|
||||
/**
|
||||
* @brief returns the coordinate-wise minimum of the given vectors,
|
||||
* where a coordinate in the returned vector is NAN iff any of the two compared ones are NAN
|
||||
*
|
||||
* @tparam T
|
||||
* @param self
|
||||
* @param other
|
||||
* @return constexpr Vec3f
|
||||
*/
|
||||
constexpr Vec3d Min(const Vec3d& self, const Vec3d& other) {
|
||||
return {
|
||||
(std::min)(self.x, other.x),
|
||||
(std::min)(self.y, other.y),
|
||||
(std::min)(self.z, other.z),
|
||||
};
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @brief returns the coordinate-wise maximum of the given vectors,
|
||||
// * where a coordinate in the returned vector is NAN iff any of the two compared ones are NAN
|
||||
// *
|
||||
// * @tparam T
|
||||
// * @param self
|
||||
// * @param other
|
||||
// * @return constexpr Vec3d
|
||||
// */
|
||||
// constexpr Vec3d Max(const Vec3d& self, const Vec3d& other) {
|
||||
// return {
|
||||
// (std::max)(self.x, other.x),
|
||||
// (std::max)(self.y, other.y),
|
||||
// (std::max)(self.z, other.z),
|
||||
// };
|
||||
// }
|
||||
/**
|
||||
* @brief returns the coordinate-wise maximum of the given vectors,
|
||||
* where a coordinate in the returned vector is NAN iff any of the two compared ones are NAN
|
||||
*
|
||||
* @tparam T
|
||||
* @param self
|
||||
* @param other
|
||||
* @return constexpr Vec3d
|
||||
*/
|
||||
constexpr Vec3d Max(const Vec3d& self, const Vec3d& other) {
|
||||
return {
|
||||
(std::max)(self.x, other.x),
|
||||
(std::max)(self.y, other.y),
|
||||
(std::max)(self.z, other.z),
|
||||
};
|
||||
}
|
||||
|
||||
// Vec4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user