OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Attributes | List of all members
ossimVar Class Reference

A variable class to hold a variable as a term. More...

#include <ossimTerm.h>

Inheritance diagram for ossimVar:
ossimTerm

Public Member Functions

 ossimVar (const ossim_uint32 &variable)
 Public Constructor. More...
 
 ossimVar (const ossimVar &src)
 Public Copy Constructor. More...
 
 ~ossimVar ()
 Destroys the variable. More...
 
ossim_float64 evaluate (std::vector< ossim_float64 > point) const
 Evaluates a variable for a point. More...
 
ossimTermderivative (const ossim_uint32 &variable) const
 Calculates the derivative for a variable. More...
 
ossim_uint32 getType () const
 Gets the type of a variable. More...
 
ossimTermcopy () const
 Creates a copy of the variable. More...
 
- Public Member Functions inherited from ossimTerm
virtual ~ossimTerm ()
 Virtual destructor for destroying tree from the top node. More...
 
ossim_float64 operator() (std::vector< ossim_float64 > point) const
 Evaluates the function for a point. More...
 
ossimTermoperator+ (ossimTerm *rhs) const
 Returns a copy of the two terms in a polynomial. More...
 
ossimTermoperator* (ossimTerm *rhs) const
 Returns a copy of the two terms in a product. More...
 

Private Attributes

ossim_uint32 var
 

Detailed Description

A variable class to hold a variable as a term.

Definition at line 309 of file ossimTerm.h.

Constructor & Destructor Documentation

◆ ossimVar() [1/2]

ossimVar::ossimVar ( const ossim_uint32 variable)
inline

Public Constructor.

Parameters
[in]variableThe variable number

Definition at line 318 of file ossimTerm.h.

Referenced by copy(), and derivative().

318 : var(variable) {}
ossim_uint32 var
Definition: ossimTerm.h:363

◆ ossimVar() [2/2]

ossimVar::ossimVar ( const ossimVar src)
inline

Public Copy Constructor.

Parameters
[in]srcThe source to be copied

Definition at line 324 of file ossimTerm.h.

324 : var(src.var) {}
ossim_uint32 var
Definition: ossimTerm.h:363

◆ ~ossimVar()

ossimVar::~ossimVar ( )
inline

Destroys the variable.

Definition at line 328 of file ossimTerm.h.

328 {}

Member Function Documentation

◆ copy()

ossimTerm * ossimVar::copy ( ) const
virtual

Creates a copy of the variable.

Returns
A pointer to a copy of the variable

Implements ossimTerm.

Definition at line 150 of file ossimTerm.cpp.

References ossimVar(), and var.

150  {
151  return new ossimVar(var);
152 }
ossimVar(const ossim_uint32 &variable)
Public Constructor.
Definition: ossimTerm.h:318
ossim_uint32 var
Definition: ossimTerm.h:363

◆ derivative()

ossimTerm * ossimVar::derivative ( const ossim_uint32 variable) const
virtual

Calculates the derivative for a variable.

OSSIM VARIABLE AS A TERM.

Parameters
[in]variableThe variable in which the derivative is with respect too.
Returns
A pointer to that contains the derivative of the term.

Calculates the derivative for a variable

Parameters
[in]variableThe variable in which the derivative is with respect too.
Returns
A pointer to that contains the derivative of the term.

Implements ossimTerm.

Definition at line 139 of file ossimTerm.cpp.

References ossimVar(), var, and variable.

139  {
140  if(var == variable) return new ossimVar(var);
141 return new ossimConst(0);
142 }
ossimVar(const ossim_uint32 &variable)
Public Constructor.
Definition: ossimTerm.h:318
ossim_uint32 var
Definition: ossimTerm.h:363
A constant class to hold a constant as a term.
Definition: ossimTerm.h:372

◆ evaluate()

ossim_float64 ossimVar::evaluate ( std::vector< ossim_float64 point) const
inlinevirtual

Evaluates a variable for a point.

Parameters
[in]pointThe point to be evaluated
Returns
The value at a point.

Implements ossimTerm.

Definition at line 338 of file ossimTerm.h.

338 { return point[var]; }
ossim_uint32 var
Definition: ossimTerm.h:363

◆ getType()

ossim_uint32 ossimVar::getType ( ) const
inlinevirtual

Gets the type of a variable.

Returns
The type of a variable

Implements ossimTerm.

Definition at line 354 of file ossimTerm.h.

References variable.

354 { return termType::variable; }

Member Data Documentation

◆ var

ossim_uint32 ossimVar::var
private

Definition at line 363 of file ossimTerm.h.

Referenced by copy(), and derivative().


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