Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Subtraction Class Reference

#include <Subtraction.h>

Inheritance diagram for Subtraction:

Inheritance graph
[legend]
Collaboration diagram for Subtraction:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Subtraction ()
 Default constructor.

 Subtraction (Implicit f, Implicit g, int cont=2)
 Constructor for a Subtraction.

virtual double proc (gmVector3 x)
virtual gmVector3 grad (gmVector3 x)
 grad returns the gradient of the function (proc()) for a point or region.

virtual gmMatrix3 hess (gmVector3 x)
 hess returns the Hessian of the function (proc()) for a point or region.

virtual Intervald proc (Box< double > x)
 proc returns the evaluation of the function that defines the Implicit surface.

virtual Box3d grad (Box< double > x)
virtual IMatrix3d hess (Box< double > x)
virtual int qlen ()
 Get the length of the q vector.

virtual void getq (double *q)
 Get the q vector.

virtual void _setq (double *q)
 Set the current q vector.

virtual void procq (gmVector3 p, double *q)
 Evaluate the derivative of proc with respect to q at a given point.

virtual void getqname (char **qn)
 Get the parameter names.


Private Member Functions

void init (Implicit f, Implicit g, int cont)
 Put all constructor initialization in one place.


Private Attributes

Intersection m_f
 The intersection which represents the subtraction.

Complement m_comp_g
 Storage for the complement of g.


Constructor & Destructor Documentation

Subtraction::Subtraction  )  [inline]
 

Default constructor.

Definition at line 38 of file Subtraction.h.

References init().

Subtraction::Subtraction Implicit  f,
Implicit  g,
int  cont = 2
[inline]
 

Constructor for a Subtraction.

Parameters:
f The function from which we subtract.
g The function which is subtracted.
cont The continuity desired.

Definition at line 47 of file Subtraction.h.

References init().


Member Function Documentation

virtual void Subtraction::_setq double *  q  )  [inline, virtual]
 

Set the current q vector.

Parameters:
q The new q vector. Must have this->qlen() elements.

Reimplemented from Blend.

Definition at line 76 of file Subtraction.h.

References Blend::_setq(), and m_f.

virtual void Subtraction::getq double *  q  )  [inline, virtual]
 

Get the q vector.

Parameters:
q On return, the current q vector. Must have at least this->qlen() elements.

Reimplemented from Blend.

Definition at line 70 of file Subtraction.h.

References Blend::getq(), and m_f.

virtual void Subtraction::getqname char **  qn  )  [inline, virtual]
 

Get the parameter names.

Parameters:
qn An array of pointers to hold the resulting parameter names. Must have this->qlen() elements.

Reimplemented from Blend.

Definition at line 91 of file Subtraction.h.

References Blend::getqname(), and m_f.

virtual Box3d Subtraction::grad Box< double >  x  )  [inline, virtual]
 

Reimplemented from Blend.

Definition at line 56 of file Subtraction.h.

References Blend::grad(), and m_f.

virtual gmVector3 Subtraction::grad gmVector3  x  )  [inline, virtual]
 

grad returns the gradient of the function (proc()) for a point or region.

Basically, the gradient returns a vector of partial derivatives, or more formally grad(proc()) = (dproc/dx,dproc/dy,dproc/dz).

Note:
Unless grad is overwritten, it defaults to the numerical approximation of the gradient = (proc(x+eps) - proc(x))/eps ...
Parameters:
x Where to evaluate the gradient of the function.
Returns:
The gradient result.
See also:
setEpsilon(double)

Reimplemented from Blend.

Definition at line 51 of file Subtraction.h.

References Blend::grad(), and m_f.

virtual IMatrix3d Subtraction::hess Box< double >  x  )  [inline, virtual]
 

Reimplemented from Blend.

Definition at line 57 of file Subtraction.h.

References Blend::hess(), and m_f.

virtual gmMatrix3 Subtraction::hess gmVector3  x  )  [inline, virtual]
 

hess returns the Hessian of the function (proc()) for a point or region.

Basically, the Hessian is a matrix of second partial derivatives, or more formally hess(proc()) =

d^2proc/dx^2, d^2proc/dxdy d^2proc/dxdz \ d^2proc/dxdy, d^2proc/dy^2 d^2proc/dydz \ d^2proc/dxdz, d^2proc/dydz d^2proc/dz^2

Note:
Unless hess is overwritten, it defaults to the numerical approximation of the Hessian.
Parameters:
x Where to evaluate the Hessian of the function.
Returns:
The Hessian result.
See also:
setEpsilon(double)
Note:
The Hessian is symmetric for our uses.

Reimplemented from Blend.

Definition at line 52 of file Subtraction.h.

References Blend::hess(), and m_f.

void Subtraction::init Implicit  f,
Implicit  g,
int  cont
[inline, private]
 

Put all constructor initialization in one place.

Definition at line 30 of file Subtraction.h.

References m_comp_g, and m_f.

Referenced by Subtraction().

virtual Intervald Subtraction::proc Box< double >  x  )  [inline, virtual]
 

proc returns the evaluation of the function that defines the Implicit surface.

In normal circumstances, the gmVector3 version of proc defaults to a pure virtual function which means that you must define proc(gmVector3) in its subclasses. When INTERVAL_EVAL_ONLY is defined, the Implicit version of proc defaults to a pure virtual function and the gmVector3 version calls the Interval version. Either way, you must define proc() in subclasses of Implicit.

Parameters:
x Where to evaluate the function.
Returns:
The function result. The function is positive outside the surface and negative inside.

Reimplemented from Blend.

Definition at line 55 of file Subtraction.h.

References Intervald, m_f, and Blend::proc().

virtual double Subtraction::proc gmVector3  x  )  [inline, virtual]
 

Reimplemented from Blend.

Definition at line 50 of file Subtraction.h.

References m_f, and Blend::proc().

virtual void Subtraction::procq gmVector3  p,
double *  q
[inline, virtual]
 

Evaluate the derivative of proc with respect to q at a given point.

Parameters:
p The point at which to evaluate.
q The derivatives with respect to q vector elements, on return. Must have this->qlen() elements.

Reimplemented from Blend.

Definition at line 84 of file Subtraction.h.

References m_f, and Blend::procq().

virtual int Subtraction::qlen void   )  [inline, virtual]
 

Get the length of the q vector.

Returns:
The length of the q vector.

Reimplemented from Blend.

Definition at line 63 of file Subtraction.h.

References m_f, and Blend::qlen().


Member Data Documentation

Complement Subtraction::m_comp_g [private]
 

Storage for the complement of g.

Definition at line 27 of file Subtraction.h.

Referenced by init().

Intersection Subtraction::m_f [private]
 

The intersection which represents the subtraction.

Any subtraction can simply be represented as the intersection with the complement of the function being subtracted.

Reimplemented from BinaryOp.

Definition at line 22 of file Subtraction.h.

Referenced by _setq(), getq(), getqname(), grad(), hess(), init(), proc(), procq(), and qlen().


The documentation for this class was generated from the following file:
Generated on Mon Jun 28 15:03:15 2004 for Advanced Surface Library by doxygen 1.3.4