proj home

Files   Classes   Functions   Hierarchy  

gausselimtest Class Reference

Test gaussian elimination class guasselim. More...

#include <gausselimtest.h>

List of all members.

Static Public Member Functions

static void test01 ()
 Inconsistent gaussian elimination example.
static void test02 ()
 Solve a 3 by 3 linear equations system.


Detailed Description

Test gaussian elimination class guasselim.

Definition at line 7 of file gausselimtest.h.


Member Function Documentation

void gausselimtest::test01 (  )  [static]

Inconsistent gaussian elimination example.

Definition at line 8 of file gausselimtest.cpp.

References gausselim< T >::eval(), and SHOW.

Referenced by main().

00009 {
00010   double e2[] = 
00011   { 
00012     3.0, 5.0, 2.0,
00013     3.0, 5.0, 5.0
00014   };
00015 
00016   cout << "Inconsistent gaussian elimination example." << endl;
00017 
00018   gausselim<double> g(e2,2);
00019 
00020   cout << (stringc)g << endl;
00021 
00022   bool res = g.eval();
00023 
00024   cout << "Solve" << endl;
00025 
00026   cout << (stringc)g << endl;
00027 
00028   cout << "Result:  ";
00029  
00030   cout << SHOW(res) << endl;
00031 
00032 }

void gausselimtest::test02 (  )  [static]

Solve a 3 by 3 linear equations system.

Definition at line 34 of file gausselimtest.cpp.

References gausselim< T >::columnC(), gausselim< T >::eval(), and print().

Referenced by main().

00035 {
00036   double e3[] = 
00037   {
00038     1.0, 5.0, 0.0, 11.0,
00039     1.0, 1.0, 1.0, 0.0,
00040     2.0, 0.0, 1.0, -1.0
00041   };
00042 
00043   cout << "Solve a 3 by 3 linear equations system." << endl;
00044 
00045   gausselim<double> g(e3,3);
00046 
00047   cout << "Initial system" << endl;
00048   cout << (stringc)g << endl;
00049 
00050   cout << endl;
00051   cout << "Solve system." << endl;
00052 
00053   g.eval();
00054   
00055   cout << (stringc)g << endl;
00056 
00057   cout << "Get solution" << endl;
00058   double s[3];
00059   g.columnC(s);
00060 
00061   cout << print(s,s+3) << endl;
00062   cout << endl;
00063 
00064 }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:57 2011 for Chelton Evans Source by  doxygen 1.5.8