00001 #ifndef GRAL_GB_GEOMETRY_TEST_PRIMITIVES2D_C
00002 #define GRAL_GB_GEOMETRY_TEST_PRIMITIVES2D_C
00003
00004 #include "Geometry/test-primitives2d.h"
00005 #include "Geometry/algebraic-primitives.h"
00006 #include "Geometry/primitives2d.h"
00007
00008 #include "Utility/pre-post-conditions.h"
00009
00010
00011 template<class POINT>
00012 void test_algebraic_primitives2d<POINT>::do_tests(std::ostream& out)
00013 {
00014 typedef point_traits<POINT> pt;
00015 typedef dimension_dependent_primitives_2d<POINT> ap;
00016
00017 POINT b = pt::Origin(2);
00018 int li = pt::LowerIndex(b);
00019
00020 POINT e[2];
00021 for(int i = 0; i < 2; ++i) {
00022 e[i] = pt::Origin(2);
00023 e[i][li + i] = 1;
00024 b[li+i] = 1;
00025 }
00026
00027 for(int i = 0; i < 2; ++i) {
00028 int j = (i < 1 ? i+1 : 0);
00029 out << "ap::det2(e["<<i<<"],e["<<j<<") = "
00030 << ap::det2(e[i],e[j]) << '\n';
00031 }
00032
00033 POINT x = pt::Origin(2);
00034 ap::solve2(e[0],e[1],x,b);
00035 out << x << '\n';
00036 ap::solve2(e[1],e[0],x,b);
00037 out << x << '\n';
00038
00039 POINT inv[2];
00040 for(int i = 0; i < 2; ++i) {
00041 inv[i] = pt::Origin(2);
00042 }
00043
00044
00045
00046
00047
00048
00049
00050 }
00051
00052
00053 #endif