OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
template class for multivariate polynom algebra More...
#include <ossimPolynom.h>
Classes | |
struct | EXP_TUPLE_LESSTHAN |
type to store multivariate input More... | |
Public Types | |
typedef std::vector< int > | EXP_TUPLE |
inner types More... | |
typedef std::vector< T > | VAR_TUPLE |
type to store exponent tuples More... | |
typedef std::map< EXP_TUPLE, T, EXP_TUPLE_LESSTHAN > | MONOM_MAP |
typedef std::set< EXP_TUPLE, EXP_TUPLE_LESSTHAN > | EXPT_SET |
for storing polynom More... | |
Public Member Functions | |
ossimPolynom (const T &epsilon=0) | |
for storing set of exponent tuples More... | |
ossimPolynom (const ossimPolynom &p) | |
~ossimPolynom () | |
const ossimPolynom & | operator= (const ossimPolynom< T, DIM > &pt) |
void | setMonom (const EXP_TUPLE &m, const T &v) |
void | setMonom (const int mexp[DIM], const T &v) |
void | delMonom (const EXP_TUPLE &m) |
T | getCoeff (const EXP_TUPLE &m) const |
void | nullify () |
bool | isNull () const |
const MONOM_MAP & | getMonoms () const |
const T & | getEpsilon () const |
no setEpsilon beacause might erase monoms More... | |
bool | operator== (const ossimPolynom &pt) const |
comparison operators -don't compare theEpsilon values -use my own epsilon in comparisons (not the compared to's epsilon) More... | |
bool | operator!= (const ossimPolynom &pt) const |
bool | isNegligible (const T &v) const |
can v be considered as zero? More... | |
int | getOrder (int d) const |
orders More... | |
int | getTotalOrder () const |
returns maximum order of monoms More... | |
T | eval (const VAR_TUPLE &v) const |
evaluation : needs DIM values as input More... | |
void | pdiff (int pdim, ossimPolynom &result) const |
partial differentiation polynom More... | |
const ossimPolynom & | operator*= (const T &k) |
operations with scalar More... | |
ossimPolynom | operator+ (const ossimPolynom &p) const |
arithmetic operators More... | |
ossimPolynom | operator- (const ossimPolynom &p) const |
const ossimPolynom & | operator+= (const ossimPolynom &p) |
const ossimPolynom & | operator-= (const ossimPolynom &p) |
ossimPolynom | operator* (const ossimPolynom &p) const |
product operator : use epsilon from left side More... | |
const ossimPolynom & | operator*= (const ossimPolynom &p) |
std::ostream & | print (std::ostream &os) const |
I/O. More... | |
std::ostream & | printNice (std::ostream &os, const char symbols[DIM]) |
classic representation (bad accuracy, for display only) More... | |
std::istream & | import (std::istream &is) |
note that it can only import for the template type T and dimesnion DIM More... | |
EXPT_SET | builExpSet (const EXP_TUPLE &orders) const |
constructs simple exponent tuples set for using LMSfit need order for each dimension More... | |
void | addExpTupleRight (int newdim, int totalOrder, EXPT_SET &eset) const |
concatenate exponents (at the right) to existing tuple set, for a given maximum total order eg: with eset={(0,1),(0,0)} , then addExpTuple(2,1,eset) = {(0,1,0,0),(0,1,0,1),(0,1,1,0), (0,0,0,0),(0,0,0,1),(0,0,1,0)} More... | |
bool | LMSfit (const EXPT_SET &expset, const std::vector< VAR_TUPLE > obs_input, const std::vector< T > obs_output, T *prms=NULL) |
fits the polynom to the observations using Least Mean Squares returns true on success (can fail if not enough observations) More... | |
bool | SLSfit (const EXPT_SET &expset, const std::vector< VAR_TUPLE > obs_input, const std::vector< T > obs_output, T *prms=NULL) |
Standard least squares Modified version of LMSfit that uses standard NEWMAT inverse as alternative to SVD solution. More... | |
Static Public Member Functions | |
static void | addExpTuple (EXP_TUPLE &m1, const EXP_TUPLE &m2) |
Protected Member Functions | |
void | discardNullMonoms () |
positive values below epsilon are considered 0 More... | |
void | addMonomQuick (const EXP_TUPLE &m, const T &v) |
add value without testing for negligible More... | |
NEWMAT::Matrix | invert (const NEWMAT::Matrix &m) const |
invert stolen from ossimRpcSolver More... | |
Protected Attributes | |
MONOM_MAP | theMonoms |
protected data members More... | |
T | theEpsilon |
associate a scalar to each tuple of orders : monom More... | |
template class for multivariate polynom algebra
T : the storage type, constraints: must have 0 (zero) as value, support ops fabs + - * / DIM : the dimension of the input space, integer (>=1, default : 1)
stores a set of monoms, a monom is (exponent tuples + coefficient) requires a precion (epsilon) for comparisons note: monoms absolute values below epsilon are removed from the map
Definition at line 38 of file ossimPolynom.h.
typedef std::vector< int > ossimPolynom< T, DIM >::EXP_TUPLE |
inner types
Definition at line 44 of file ossimPolynom.h.
typedef std::set< EXP_TUPLE, EXP_TUPLE_LESSTHAN > ossimPolynom< T, DIM >::EXPT_SET |
for storing polynom
Definition at line 68 of file ossimPolynom.h.
typedef std::map< EXP_TUPLE, T , EXP_TUPLE_LESSTHAN > ossimPolynom< T, DIM >::MONOM_MAP |
Definition at line 66 of file ossimPolynom.h.
typedef std::vector< T > ossimPolynom< T, DIM >::VAR_TUPLE |
type to store exponent tuples
Definition at line 45 of file ossimPolynom.h.
|
inline |
for storing set of exponent tuples
construction : must supply epsilon value, default 0
Definition at line 75 of file ossimPolynom.h.
|
inline |
Definition at line 79 of file ossimPolynom.h.
|
inline |
Definition at line 84 of file ossimPolynom.h.
|
inlinestatic |
Definition at line 344 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::operator*().
|
inline |
concatenate exponents (at the right) to existing tuple set, for a given maximum total order eg: with eset={(0,1),(0,0)} , then addExpTuple(2,1,eset) = {(0,1,0,0),(0,1,0,1),(0,1,1,0), (0,0,0,0),(0,0,0,1),(0,0,1,0)}
Definition at line 569 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::addExpTupleRight(), and ossimPolynomProjection::setupDesiredExponents().
|
inlineprotected |
add value without testing for negligible
Definition at line 807 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::operator*().
|
inline |
constructs simple exponent tuples set for using LMSfit need order for each dimension
Definition at line 534 of file ossimPolynom.h.
|
inline |
Definition at line 119 of file ossimPolynom.h.
|
inlineprotected |
positive values below epsilon are considered 0
method to erase all negligible monoms : user don't need that (automatic)
Definition at line 789 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::operator*(), and ossimPolynom< ossim_float64, 3 >::operator*=().
|
inline |
evaluation : needs DIM values as input
Definition at line 219 of file ossimPolynom.h.
Referenced by ossimPolynomProjection::lineSampleHeightToWorld(), and ossimPolynomProjection::worldToLineSample().
|
inline |
Definition at line 124 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::operator+=(), ossimPolynom< ossim_float64, 3 >::operator-=(), and ossimPolynom< ossim_float64, 3 >::operator==().
|
inline |
no setEpsilon beacause might erase monoms
Definition at line 150 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::invert(), ossimPolynom< ossim_float64, 3 >::operator*(), ossimPolynom< ossim_float64, 3 >::operator=(), and ossimPolynom< ossim_float64, 3 >::print().
|
inline |
Definition at line 145 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::eval(), ossimPolynom< ossim_float64, 3 >::getOrder(), ossimPolynom< ossim_float64, 3 >::getTotalOrder(), ossimPolynom< ossim_float64, 3 >::import(), ossimPolynom< ossim_float64, 3 >::operator*(), ossimPolynom< ossim_float64, 3 >::operator*=(), ossimPolynom< ossim_float64, 3 >::operator+=(), ossimPolynom< ossim_float64, 3 >::operator-=(), ossimPolynom< ossim_float64, 3 >::operator=(), ossimPolynom< ossim_float64, 3 >::operator==(), ossimPolynom< ossim_float64, 3 >::pdiff(), ossimPolynom< ossim_float64, 3 >::print(), and ossimPolynom< ossim_float64, 3 >::printNice().
|
inline |
orders
returns maximum order of monoms for a specific dimension (d starts at 0)
Definition at line 186 of file ossimPolynom.h.
|
inline |
|
inline |
note that it can only import for the template type T and dimesnion DIM
Definition at line 440 of file ossimPolynom.h.
Referenced by operator>>().
|
inlineprotected |
invert stolen from ossimRpcSolver
Definition at line 822 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::LMSfit().
|
inline |
can v be considered as zero?
Definition at line 178 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::discardNullMonoms(), ossimPolynom< ossim_float64, 3 >::operator==(), and ossimPolynom< ossim_float64, 3 >::setMonom().
|
inline |
Definition at line 140 of file ossimPolynom.h.
|
inline |
fits the polynom to the observations using Least Mean Squares returns true on success (can fail if not enough observations)
Definition at line 611 of file ossimPolynom.h.
Referenced by ossimPolynomProjection::optimizeFit().
|
inline |
Definition at line 135 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::import(), ossimPolynom< ossim_float64, 3 >::LMSfit(), ossimPolynom< ossim_float64, 3 >::pdiff(), and ossimPolynom< ossim_float64, 3 >::SLSfit().
|
inline |
Definition at line 173 of file ossimPolynom.h.
|
inline |
product operator : use epsilon from left side
Definition at line 315 of file ossimPolynom.h.
|
inline |
operations with scalar
Definition at line 266 of file ossimPolynom.h.
|
inline |
Definition at line 339 of file ossimPolynom.h.
|
inline |
|
inline |
Definition at line 290 of file ossimPolynom.h.
|
inline |
Definition at line 284 of file ossimPolynom.h.
|
inline |
Definition at line 301 of file ossimPolynom.h.
|
inline |
Definition at line 87 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::operator*=().
|
inline |
comparison operators -don't compare theEpsilon values -use my own epsilon in comparisons (not the compared to's epsilon)
Definition at line 160 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::operator!=().
|
inline |
partial differentiation polynom
Definition at line 246 of file ossimPolynom.h.
Referenced by ossimPolynomProjection::buildLineDerivatives(), and ossimPolynomProjection::buildSampDerivatives().
|
inline |
I/O.
stream serialization format : [ k1 (e1_1,e1_2,...,e1_DIM) ; k2 (e2_1,e2_2,..,e2_DIM) ; kN (eN_1,...eN_DIM)]
N is the number of monoms ei_j is exponent for dimension j and monom i
order is not important all monoms should have the same dimension : DIM you should add eps=xxxx at the beginning, separated by semi-colon ; (by default epsilon is 0)
examples: [ ] is the null polynom, [ eps=1.0e-5 ] too [ 1.0 (0) 3.5 (1) ] is polynom 1.0 + 3.5*x, with epsilon = 0 [ eps=1.0E-12 ; 2.0 (1,1,0) ; -1.0 (0,0,1) ] is polynom 2*x*y-z, with epsilon=10^-12
Definition at line 370 of file ossimPolynom.h.
|
inline |
classic representation (bad accuracy, for display only)
Definition at line 406 of file ossimPolynom.h.
|
inline |
Definition at line 97 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::LMSfit(), ossimPolynom< ossim_float64, 3 >::operator+=(), ossimPolynom< ossim_float64, 3 >::operator-=(), ossimPolynom< ossim_float64, 3 >::pdiff(), and ossimPolynom< ossim_float64, 3 >::SLSfit().
|
inline |
Definition at line 107 of file ossimPolynom.h.
|
inline |
Standard least squares Modified version of LMSfit that uses standard NEWMAT inverse as alternative to SVD solution.
Definition at line 700 of file ossimPolynom.h.
|
protected |
associate a scalar to each tuple of orders : monom
Definition at line 783 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::getEpsilon(), ossimPolynom< ossim_float64, 3 >::import(), ossimPolynom< ossim_float64, 3 >::isNegligible(), and ossimPolynom< ossim_float64, 3 >::operator=().
|
protected |
protected data members
Definition at line 781 of file ossimPolynom.h.
Referenced by ossimPolynom< ossim_float64, 3 >::addMonomQuick(), ossimPolynom< ossim_float64, 3 >::delMonom(), ossimPolynom< ossim_float64, 3 >::discardNullMonoms(), ossimPolynom< ossim_float64, 3 >::getCoeff(), ossimPolynom< ossim_float64, 3 >::getMonoms(), ossimPolynom< ossim_float64, 3 >::import(), ossimPolynom< ossim_float64, 3 >::isNull(), ossimPolynom< ossim_float64, 3 >::nullify(), ossimPolynom< ossim_float64, 3 >::operator=(), and ossimPolynom< ossim_float64, 3 >::setMonom().