proj home

Files   Classes   Functions   Hierarchy  

solver< T > Class Template Reference

#include <mathlib.h>

List of all members.

Static Public Member Functions

template<typename W >
static boolc d2linearequ (W &x, W const &a0, W const &a1, W const &c)
 Solve the 2D simultaneous equation.
static boolc d2linearequ (T &x, T &y, T const a00, T const a01, T const a10, T const a11, T const c0, T const c1)
 Solve the 2D simultaneous equation.


Detailed Description

template<typename T>
class solver< T >

Definition at line 359 of file mathlib.h.


Member Function Documentation

template<typename T >
boolc solver< T >::d2linearequ ( T x,
T y,
T const   a00,
T const   a01,
T const   a10,
T const   a11,
T const   c0,
T const   c1 
) [inline, static]

Solve the 2D simultaneous equation.

Definition at line 1100 of file mathlib.h.

01110 {
01111   T det = a00*a11-a01*a10;
01112   if (det*det<=zero<T>::val)
01113     return false;
01114 
01115   T detInv = (T)1.0/det;
01116    
01117   x = (c0*a11 - c1*a01)*detInv;
01118   y = (c1*a00 - c0*a10)*detInv;
01119 
01120   return true;
01121 }

template<typename T >
template<typename W >
static boolc solver< T >::d2linearequ ( W &  x,
W const &  a0,
W const &  a1,
W const &  c 
) [inline, static]

Solve the 2D simultaneous equation.

All elements are column vectors.

Definition at line 367 of file mathlib.h.

Referenced by solverInconsistent< T >::d2linearequ(), line< PT, PD >::intersects(), line< PT, PD >::lineD3minimized(), linechoppedindexed< PT, PD, INDX >::split(), and linechopped< PT, PD >::split().

00373   {
00374     T det = a0.x*a1.y - a1.x*a0.y;
00375     if (det*det<=zero<T>::val)
00376       return false;
00377 
00378     T detInv = (T)1.0/det;
00379 
00380     x.x = (c.x*a1.y - c.y*a1.x)*detInv;
00381     x.y = (c.y*a0.x - c.x*a0.y)*detInv;
00382 
00383     return true;
00384   }


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

Generated on Fri Mar 4 00:50:18 2011 for Chelton Evans Source by  doxygen 1.5.8