// // SPDX-License-Identifier: BSD-3-Clause // Copyright Contributors to the OpenEXR Project. // #ifdef NDEBUG # undef NDEBUG #endif #include #include #include #include #include #include #include #include "testBoxAlgo.h" // Include ImathForward *after* other headers to validate forward declarations #include using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; namespace { // // Test case generation utility - create a vector of IMATH_INTERNAL_NAMESPACE::Vec{2,3,4} // with all permutations of integers 1..T::dimensions(). // // Algorithm from www.bearcave.com/random_hacks/permute.html // template static void addItem (const std::vector& value, std::vector& perms) { T p; for (unsigned int i = 0; i < value.size(); i++) { p[i] = static_cast(value[i]); } perms.push_back (p); } template static void visit (int& level, int n, int k, std::vector& value, std::vector& perms) { level = level + 1; value[k] = level; if (level == n) addItem (value, perms); else for (int i = 0; i < n; i++) if (value[i] == 0) visit (level, n, i, value, perms); level = level - 1; value[k] = 0; } template static void permutations (std::vector& perms) { std::vector value (T::dimensions()); int level = -1; int n = T::dimensions(); visit (level, n, 0, value, perms); } template static void testConstructors (const char* type) { cout << " constructors for type " << type << endl; // // Empty // { IMATH_INTERNAL_NAMESPACE::Box b; assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); } // // Single point // { T p; for (unsigned int i = 0; i < T::dimensions (); i++) p[i] = static_cast(i); IMATH_INTERNAL_NAMESPACE::Box b (p); assert (b.min == p && b.max == p); } // // Min and max // { T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { p0[i] = static_cast(i); p1[i] = static_cast(10 * T::dimensions () - i - 1); } IMATH_INTERNAL_NAMESPACE::Box b (p0, p1); assert (b.min == p0 && b.max == p1); } } template void testMakeEmpty (const char* type) { cout << " makeEmpty() for type " << type << endl; // // Empty box // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeEmpty(); assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); } // // Non-empty, has volume // { IMATH_INTERNAL_NAMESPACE::Box b (T (-1), T (1)); b.makeEmpty(); assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); } // // Non-empty, no volume // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min (0); T max (0); max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b (min, max); b.makeEmpty(); assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); } } template void testMakeInfinite (const char* type) { cout << " makeInfinite() for type " << type << endl; // // Infinite box // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeInfinite (); assert ( b.min == T (T::baseTypeLowest ()) && b.max == T (T::baseTypeMax ())); for (unsigned int i=0; i c = b; c.max[i] = 0; assert (!c.isInfinite()); c = b; c.min[i] = 0; assert (!c.isInfinite()); } } // // Non-empty, has volume // { IMATH_INTERNAL_NAMESPACE::Box b (T (-1), T (1)); b.makeInfinite(); assert (b.min == T (T::baseTypeLowest()) && b.max == T (T::baseTypeMax())); } // // Non-empty, no volume // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min (0); T max (0); max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b (min, max); b.makeInfinite(); assert (b.min == T (T::baseTypeLowest()) && b.max == T (T::baseTypeMax())); } } template void testExtendByPoint (const char* type) { cout << " extendBy() point for type " << type << endl; IMATH_INTERNAL_NAMESPACE::Rand32 rand (0); const unsigned int iters = 10; // // Extend empty box with a single point. // for (unsigned int i = 0; i < iters; i++) { T p; for (unsigned int j = 0; j < T::dimensions(); j++) p[j] = typename T::BaseType (rand.nextf (-12345, 12345)); IMATH_INTERNAL_NAMESPACE::Box b; b.extendBy (p); assert (b.min == p && b.max == p); } // // Extend empty box with a number of random points. Note that // this also covers extending a non-empty box. // for (unsigned int i = 0; i < iters; i++) { IMATH_INTERNAL_NAMESPACE::Box b; T min; T max; for (unsigned int j = 0; j < i; j++) { T p; for (unsigned int k = 0; k < T::dimensions(); k++) p[k] = typename T::BaseType (rand.nextf (-12345, 12345)); if (j == 0) { min = p; max = p; } for (unsigned int k = 0; k < T::dimensions(); k++) { min[k] = std::min (min[k], p[k]); max[k] = std::max (max[k], p[k]); } b.extendBy (p); assert (b.min == min && b.max == max); } } } template void testExtendByBox (const char* type) { cout << " extendBy() box for type " << type << endl; // // Extend empty box with an empty box; // { IMATH_INTERNAL_NAMESPACE::Box b; b.extendBy (IMATH_INTERNAL_NAMESPACE::Box()); assert (b.min == T (T::baseTypeMax()) && b.max == T (T::baseTypeLowest())); } // // Extend empty box with a non-empty box and vice versa. // { std::vector perms; permutations (perms); for (unsigned int i = 0; i < perms.size(); i++) { for (unsigned int j = 0; j < perms.size(); j++) { T p0 = -perms[i]; T p1 = perms[j]; IMATH_INTERNAL_NAMESPACE::Box b0; b0.extendBy (IMATH_INTERNAL_NAMESPACE::Box (p0, p1)); assert (b0.min == p0 && b0.max == p1); IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); b1.extendBy (IMATH_INTERNAL_NAMESPACE::Box()); assert (b1.min == p0 && b1.max == p1); } } } // // Extend non-empty box with non-empty box. Starts with empty, then builds. // IMATH_INTERNAL_NAMESPACE::Rand32 rand (0); const unsigned int iters = 10; { IMATH_INTERNAL_NAMESPACE::Box b; T min, max; for (unsigned int i = 1; i < iters; i++) { T p0; T p1; for (unsigned int k = 0; k < T::dimensions(); k++) { p0[k] = typename T::BaseType (rand.nextf (0, 999)); p1[k] = typename T::BaseType (rand.nextf (1000, 1999)); } min = b.min; max = b.max; for (unsigned int k = 0; k < T::dimensions(); k++) { min[k] = std::min (min[k], p0[k]); max[k] = std::max (max[k], p1[k]); } b.extendBy (IMATH_INTERNAL_NAMESPACE::Box (p0, p1)); assert (b.min == min && b.max == max); } } } template void testComparators (const char* type) { cout << " comparators for type " << type << endl; IMATH_INTERNAL_NAMESPACE::Rand32 rand (0); // // Compare empty. // { IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1; assert (b0 == b1); assert (!(b0 != b1)); } // // Compare empty to non-empty. // { std::vector perms; permutations (perms); for (unsigned int i = 0; i < perms.size(); i++) { for (unsigned int j = 0; j < perms.size(); j++) { T p0 = -perms[i]; T p1 = perms[j]; IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); assert (!(b0 == b1)); assert (b0 != b1); } } } // // Compare two non-empty // { std::vector perms; permutations (perms); for (unsigned int i = 0; i < perms.size(); i++) { for (unsigned int j = 0; j < perms.size(); j++) { T p0 = -perms[i]; T p1 = perms[j]; T p2 = -perms[j]; T p3 = perms[i]; IMATH_INTERNAL_NAMESPACE::Box b0 (p0, p1); IMATH_INTERNAL_NAMESPACE::Box b1 (p2, p3); IMATH_INTERNAL_NAMESPACE::Box b2 (p0, p1); if (i == j) { assert (b0 == b1); assert (!(b0 != b1)); } else { assert (b0 != b1); assert (!(b0 == b1)); } assert (b0 == b2); assert (!(b0 != b2)); } } } } template void testIntersects (const char* type) { cout << " intersects() for type " << type << endl; IMATH_INTERNAL_NAMESPACE::Rand32 rand (0); // // Intersect point with empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; T p (1); assert (!b.intersects (p)); } // // Intersect point with non-empty, has-volume box. // { IMATH_INTERNAL_NAMESPACE::Box b (T (-1), T (1)); T p0 (0); T p1 (5); T p2 (-5); assert (b.intersects (p0)); assert (!b.intersects (p1)); assert (!b.intersects (p2)); } // // Intersect point with non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min (0); T max = min; max[T::dimensions() - 1] = 1; T p0 (0); T p1 (5); IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (b.intersects (p0)); assert (!b.intersects (p1)); } // // Intersect empty box with empty box. // { IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1; assert (!b0.intersects (b1)); assert (!b1.intersects (b0)); } // // Intersect empty box with non-empty has-volume boxes. // { IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1 (T (-1), T (1)); IMATH_INTERNAL_NAMESPACE::Box b2 (T (1), T (2)); assert (!b0.intersects (b1)); assert (!b0.intersects (b2)); assert (!b1.intersects (b0)); assert (!b2.intersects (b0)); } // // Intersect empty box with non-empty no-volume box. // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min (0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1 (min, max); assert (!b0.intersects (b1)); assert (!b1.intersects (b0)); } // // Intersect non-empty has-volume box with non-empty has-volume box. // { IMATH_INTERNAL_NAMESPACE::Box b1 (T (-1), T (1)); IMATH_INTERNAL_NAMESPACE::Box b2 (T (-1), T (1)); IMATH_INTERNAL_NAMESPACE::Box b3 (T (1), T (2)); IMATH_INTERNAL_NAMESPACE::Box b4 (T (2), T (3)); assert (b1.intersects (b1)); assert (b1.intersects (b3)); assert (!b1.intersects (b4)); assert (b3.intersects (b1)); assert (!b4.intersects (b1)); } // // Intersect non-empty has-volume box with non-empty no-volume box. // // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); T min (0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b1 (min, max); IMATH_INTERNAL_NAMESPACE::Box b2 (min + T (2), max + T (2)); assert (b0.intersects (b1)); assert (b1.intersects (b0)); assert (!b0.intersects (b2)); assert (!b2.intersects (b1)); } // // Intersect non-empty no-volume box with non-empty no-volume box. // // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min (0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b0 (min, max); IMATH_INTERNAL_NAMESPACE::Box b1 (min, max + T (2)); IMATH_INTERNAL_NAMESPACE::Box b2 (min + T (2), max + T (2)); assert (b0.intersects (b1)); assert (b1.intersects (b0)); assert (!b0.intersects (b2)); assert (!b2.intersects (b0)); } } template void testSize (const char* type) { cout << " size() for type " << type << endl; // // Size of empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert (b.size() == T (0)); } // // Size of non-empty, has-volume box. // Boxes are: // 2D: [(-1, -1), (1, 1) ] // 3D: [(-1, -1, -1), (1, 1, 1) ] // 4D: [(-1, -1, -1, -1), (1, 1, 1, 1) ] // // and // // 2D: [(-1, -2), (1, 2) ] // 3D: [(-1, -2, -3), (1, 2, 3) ] // 4D: [(-1, -2, -3, -4), (1, 2, 3, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); assert (b0.size() == T (2)); T p; for (unsigned int i = 0; i < T::dimensions(); i++) { p[i] = static_cast(i); } IMATH_INTERNAL_NAMESPACE::Box b1 (-p, p); assert (b1.size() == p * T (2)); } // // Size of non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min (0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (b.size() == max); } } template void testCenter (const char* type) { cout << " center() for type " << type << endl; // // Center of empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert (b.center() == T (0)); } // // Center of non-empty, has-volume box. // Boxes are: // 2D: [(-1, -1), (1, 1) ] // 3D: [(-1, -1, -1), (1, 1, 1) ] // 4D: [(-1, -1, -1, -1), (1, 1, 1, 1) ] // // and // // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); assert (b0.center() == T (0)); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); p0[i] = -static_cast(lo); p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); assert (b1.center() == (p1 + p0) / 2); } // // Center of non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min (0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (b.center() == max / 2); } } template void testIsEmpty (const char* type) { cout << " isEmpty() for type " << type << endl; // // Empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert (b.isEmpty()); } // // Non-empty, has-volume box. // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); assert (!b0.isEmpty()); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); p0[i] = -static_cast(lo); p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); assert (!b1.isEmpty()); } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min (0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (!b.isEmpty()); } } template void testIsInfinite (const char* type) { cout << " isInfinite() for type " << type << endl; // // Infinite box. // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeInfinite(); assert (b.isInfinite()); } // // Non-empty, has-volume box. // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); assert (!b0.isInfinite()); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); p0[i] = -static_cast(lo); p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); assert (!b1.isInfinite()); } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min (0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (!b.isInfinite()); } } template void testHasVolume (const char* type) { cout << " hasVolume() for type " << type << endl; // // Empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert (!b.hasVolume()); } // // Infinite box. // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeInfinite(); assert (b.hasVolume()); } // // Non-empty, has-volume box. // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0 (T (-1), T (1)); assert (b0.hasVolume()); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { int lo = 1 << (i + 1); int hi = 1 << (T::dimensions () - i); p0[i] = -static_cast(lo); p1[i] = static_cast(hi); } IMATH_INTERNAL_NAMESPACE::Box b1 (p0, p1); assert (b1.hasVolume()); } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min (0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b (min, max); assert (!b.hasVolume()); } } template void testMajorAxis (const char* type) { cout << " majorAxis() for type " << type << endl; // // Empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert (b.majorAxis() == 0); } // // Non-empty, has-volume box. // Boxes are [ (0, 0, ...), () ] // { std::vector perms; permutations (perms); for (unsigned int i = 0; i < perms.size(); i++) { IMATH_INTERNAL_NAMESPACE::Box b (T (0), perms[i]); unsigned int major = 0; T size = perms[i] - T (0); for (unsigned int j = 1; j < T::dimensions(); j++) if (size[j] > size[major]) major = j; assert (b.majorAxis() == major); } } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (1, 0) ] // 2D: [(0, 0), (0, 1) ] // // 3D: [(0, 0), (1, 0, 0) ] // 3D: [(0, 0), (0, 1, 0) ] // 3D: [(0, 0), (0, 0, 1) ] // // and similarly for 4D // { for (unsigned int i = 0; i < T::dimensions(); i++) { for (unsigned int j = 0; j < T::dimensions(); j++) { T max (0); max[j] = 1; IMATH_INTERNAL_NAMESPACE::Box b (T (0), max); assert (b.majorAxis() == j); } } } } } // anonymous namespace void testBox() { cout << "Testing box methods" << endl; // // Constructors // testConstructors ("V2s"); testConstructors ("V2i"); testConstructors ("V2i64"); testConstructors ("V2f"); testConstructors ("V2d"); testConstructors ("V3s"); testConstructors ("V3i"); testConstructors ("V3i64"); testConstructors ("V3f"); testConstructors ("V3d"); testConstructors ("V4s"); testConstructors ("V4i"); testConstructors ("V4i64"); testConstructors ("V4f"); testConstructors ("V4d"); // // makeEmpty() // testMakeEmpty ("V2s"); testMakeEmpty ("V2i"); testMakeEmpty ("V2i64"); testMakeEmpty ("V2f"); testMakeEmpty ("V2d"); testMakeEmpty ("V3s"); testMakeEmpty ("V3i"); testMakeEmpty ("V3i64"); testMakeEmpty ("V3f"); testMakeEmpty ("V3d"); testMakeEmpty ("V4s"); testMakeEmpty ("V4i"); testMakeEmpty ("V4i64"); testMakeEmpty ("V4f"); testMakeEmpty ("V4d"); // // makeInfinite() // testMakeInfinite ("V2s"); testMakeInfinite ("V2i"); testMakeInfinite ("V2i64"); testMakeInfinite ("V2f"); testMakeInfinite ("V2d"); testMakeInfinite ("V3s"); testMakeInfinite ("V3i"); testMakeInfinite ("V3i64"); testMakeInfinite ("V3f"); testMakeInfinite ("V3d"); testMakeInfinite ("V4s"); testMakeInfinite ("V4i"); testMakeInfinite ("V4i64"); testMakeInfinite ("V4f"); testMakeInfinite ("V4d"); // // extendBy() (point) // testExtendByPoint ("V2s"); testExtendByPoint ("V2i"); testExtendByPoint ("V2i64"); testExtendByPoint ("V2f"); testExtendByPoint ("V2d"); testExtendByPoint ("V3s"); testExtendByPoint ("V3i"); testExtendByPoint ("V3i64"); testExtendByPoint ("V3f"); testExtendByPoint ("V3d"); testExtendByPoint ("V4s"); testExtendByPoint ("V4i"); testExtendByPoint ("V4i64"); testExtendByPoint ("V4f"); testExtendByPoint ("V4d"); // // extendBy() box // testExtendByBox ("V2s"); testExtendByBox ("V2i"); testExtendByBox ("V2i64"); testExtendByBox ("V2f"); testExtendByBox ("V2d"); testExtendByBox ("V3s"); testExtendByBox ("V3i"); testExtendByBox ("V3i64"); testExtendByBox ("V3f"); testExtendByBox ("V3d"); testExtendByBox ("V4s"); testExtendByBox ("V4i"); testExtendByBox ("V4i64"); testExtendByBox ("V4f"); testExtendByBox ("V4d"); // // == and !== // testComparators ("V2s"); testComparators ("V2i"); testComparators ("V2i64"); testComparators ("V2f"); testComparators ("V2d"); testComparators ("V3s"); testComparators ("V3i"); testComparators ("V3i64"); testComparators ("V3f"); testComparators ("V3d"); testComparators ("V4s"); testComparators ("V4i"); testComparators ("V4i64"); testComparators ("V4f"); testComparators ("V4d"); // // size() // testSize ("V2s"); testSize ("V2i"); testSize ("V2i64"); testSize ("V2f"); testSize ("V2d"); testSize ("V3s"); testSize ("V3i"); testSize ("V3i64"); testSize ("V3f"); testSize ("V3d"); testSize ("V4s"); testSize ("V4i"); testSize ("V4i64"); testSize ("V4f"); testSize ("V4d"); // // center() // testCenter ("V2s"); testCenter ("V2i"); testCenter ("V2i64"); testCenter ("V2f"); testCenter ("V2d"); testCenter ("V3s"); testCenter ("V3i"); testCenter ("V3i64"); testCenter ("V3f"); testCenter ("V3d"); testCenter ("V4s"); testCenter ("V4i"); testCenter ("V4i64"); testCenter ("V4f"); testCenter ("V4d"); // // isEmpty() // testIsEmpty ("V2s"); testIsEmpty ("V2i"); testIsEmpty ("V2i64"); testIsEmpty ("V2f"); testIsEmpty ("V2d"); testIsEmpty ("V3s"); testIsEmpty ("V3i"); testIsEmpty ("V3i64"); testIsEmpty ("V3f"); testIsEmpty ("V3d"); testIsEmpty ("V4s"); testIsEmpty ("V4i"); testIsEmpty ("V4i64"); testIsEmpty ("V4f"); testIsEmpty ("V4d"); // // isInfinite() // testIsInfinite ("V2s"); testIsInfinite ("V2i"); testIsInfinite ("V2i64"); testIsInfinite ("V2f"); testIsInfinite ("V2d"); testIsInfinite ("V3s"); testIsInfinite ("V3i"); testIsInfinite ("V3i64"); testIsInfinite ("V3f"); testIsInfinite ("V3d"); testIsInfinite ("V4s"); testIsInfinite ("V4i"); testIsInfinite ("V4i64"); testIsInfinite ("V4f"); testIsInfinite ("V4d"); // // hasVolume() // testHasVolume ("V2s"); testHasVolume ("V2i"); testHasVolume ("V2i64"); testHasVolume ("V2f"); testHasVolume ("V2d"); testHasVolume ("V3s"); testHasVolume ("V3i"); testHasVolume ("V3i64"); testHasVolume ("V3f"); testHasVolume ("V3d"); testHasVolume ("V4s"); testHasVolume ("V4i"); testHasVolume ("V4i64"); testHasVolume ("V4f"); testHasVolume ("V4d"); // // majorAxis() // testMajorAxis ("V2s"); testMajorAxis ("V2i"); testMajorAxis ("V2i64"); testMajorAxis ("V2f"); testMajorAxis ("V2d"); testMajorAxis ("V3s"); testMajorAxis ("V3i"); testMajorAxis ("V3i64"); testMajorAxis ("V3f"); testMajorAxis ("V3d"); testMajorAxis ("V4s"); testMajorAxis ("V4i"); testMajorAxis ("V4i64"); testMajorAxis ("V4f"); testMajorAxis ("V4d"); cout << "ok\n" << endl; }