9template <
size_t size,
class T>
10Magnum::Math::Vector<size, T>
cwiseMin(
const Magnum::Math::Vector<size, T>& a,
const Magnum::Math::Vector<size, T>& b) {
11 Magnum::Math::Vector<size, T> result;
12 for (
size_t i = 0; i < size; i++) {
13 result[i] = std::min(a[i], b[i]);
23template <
size_t size,
class T>
24void cwiseMinInplace(Magnum::Math::Vector<size, T>& a,
const Magnum::Math::Vector<size, T>& b) {
25 for (
size_t i = 0; i < size; i++) {
26 a[i] = std::min(a[i], b[i]);
36template <
size_t size,
class T>
37Magnum::Math::Vector<size, T>
cwiseMax(
const Magnum::Math::Vector<size, T>& a,
const Magnum::Math::Vector<size, T>& b) {
38 Magnum::Math::Vector<size, T> result;
39 for (
size_t i = 0; i < size; i++) {
40 result[i] = std::max(a[i], b[i]);
50template <
size_t size,
class T>
51void cwiseMaxInplace(Magnum::Math::Vector<size, T>& a,
const Magnum::Math::Vector<size, T>& b) {
52 for (
size_t i = 0; i < size; i++) {
53 a[i] = std::max(a[i], b[i]);
Magnum::Math::Vector< size, T > cwiseMax(const Magnum::Math::Vector< size, T > &a, const Magnum::Math::Vector< size, T > &b)
Calculate the component-wise maximum of the given vectors.
Definition Utils.h:37
void cwiseMinInplace(Magnum::Math::Vector< size, T > &a, const Magnum::Math::Vector< size, T > &b)
Calculate the component-wise minimum of the given vectors and stores it into the first given vector.
Definition Utils.h:24
void cwiseMaxInplace(Magnum::Math::Vector< size, T > &a, const Magnum::Math::Vector< size, T > &b)
Calculate the component-wise maximum of the given vectors and stores it into the first given vector.
Definition Utils.h:51
Magnum::Math::Vector< size, T > cwiseMin(const Magnum::Math::Vector< size, T > &a, const Magnum::Math::Vector< size, T > &b)
Calculate the component-wise minimum of the given vectors.
Definition Utils.h:10