Go to Overview over all GrAL packages.
Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Geometry/internal/test-primitives2d.C

Go to the documentation of this file.
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); // should be the same for all points
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   ap::inverse(e[0],e[1],inv[0],inv[1]);
00045   out << inv[0] << "  " << inv[1] << '\n';
00046   ap::inverse(e[1],e[0],inv[0],inv[1]);
00047   out << inv[0] << "  " << inv[1] << '\n';
00048   */
00049 
00050 }
00051 
00052 
00053 #endif

Copyright (c) Guntram Berti 1997-2002. See the GrAL Homepage for up-to-date information.

Generated at Tue Feb 26 15:57:26 2002 for Geometry by doxygen 1.2.11-20011104 written by Dimitri van Heesch, © 1997-2000