The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fib::algorithms::nD2 Namespace Reference

Classes

class  cDataPoint
class  cDataPointRange
class  cMatrix2D

Functions

template<class tX , class tY , class tZ >
vector< nD2::cDataPoint< tX,
tY, tZ > > 
derivate (const vector< nD2::cDataPoint< tX, tY, tZ > > &vecInput)
template<class tX , class tY , class tZ >
pair< vector
< nD2::cDataPointRange< tX, tY,
tZ > >, nD2::cDataPointRange
< tX, tY, tZ > > 
derivateDist (const vector< nD2::cDataPointRange< tX, tY, tZ > > &vecInput)
bool lowerFirstNumber (const pair< unsigned long, cFibElement * > &paFirst, const pair< unsigned long, cFibElement * > &paSecond)
template<class tX >
void integrateLineInAreas (list< pair< unsigned long, list< pair< fib::algorithms::nD1::cDataPoint< tX, tX >, fib::algorithms::nD1::cDataPoint< tX, tX > > > > > &areas, const pair< fib::algorithms::nD1::cDataPoint< tX, tX >, fib::algorithms::nD1::cDataPoint< tX, tX > > &paNewLine)
template<class tX >
cFibElementcreateAreasForPoints (const set< nD1::cDataPoint< tX, tX > > &setPoints, cFibElement *pUnderobject, cFibVariable *pVariableDimX, cFibVariable *pVariableDimY)
template<class tX >
cFibElementcreateSplineBorderAreasForPoints (const set< nD1::cDataPoint< tX, tX > > &setPoints, cFibElement *pUnderobject, cFibVariable *pVariableDimX, cFibVariable *pVariableDimY, const unsigned int uiMaxSplineParameters=4, const unsigned int uiMinBitsToStoreMantissa=1, const double maxValue=0.0, const unsigned long ulMaxMemoryCost=100000)
template<class tX >
cFibElementcreateSplineItrFastBorderAreasForPoints (const set< nD1::cDataPoint< tX, tX > > &setPoints, cFibElement *pUnderobject, cFibVariable *pVariableDimX, cFibVariable *pVariableDimY, const unsigned int uiMaxSplineParameters=4, const unsigned int uiMinBitsToStoreMantissa=1, double maxValue=0.0, const double maxError=0, const unsigned long ulMaxMemoryCost=100000)
template<class tX >
cFibElementcreateSplineItrFastBorderAreasForPoints (const set< nD1::cDataPoint< tX, tX > > &setMinimumArea, const set< nD1::cDataPoint< tX, tX > > &setMaximumArea, cFibElement *pUnderobject, cFibVariable *pVariableDimX, cFibVariable *pVariableDimY, const unsigned int uiMaxSplineParameters=4, set< nD1::cDataPoint< tX, tX > > *pOutSetMissingPoints=NULL, const unsigned int uiMinBitsToStoreMantissa=1, double maxValue=0.0, const double maxError=0, const unsigned long ulMaxMemoryCost=100000)
template<class tX >
cFibElementcreateNSplineBorderAreasForPoints (const set< nD1::cDataPoint< tX, tX > > &setPoints, cFibElement *pUnderobject, cFibVariable *pVariableDimX, cFibVariable *pVariableDimY, const unsigned int uiMaxSplineParameters=4, const unsigned int uiMinBitsToStoreMantissa=1, double maxValue=0.0, const double maxError=0, const unsigned long ulMaxMemoryCost=100000)
template<class tX >
cFibElementcreateNSplineBorderAreasForPoints (const set< nD1::cDataPoint< tX, tX > > &setMinimumArea, const set< nD1::cDataPoint< tX, tX > > &setMaximumArea, cFibElement *pUnderobject, cFibVariable *pVariableDimX, cFibVariable *pVariableDimY, const unsigned int uiMaxSplineParameters=4, set< nD1::cDataPoint< tX, tX > > *pOutSetMissingPoints=NULL, const unsigned int uiMinBitsToStoreMantissa=1, double maxValue=0.0, const double maxError=0, const unsigned long ulMaxMemoryCost=100000)

Function Documentation

template<class tX >
cFibElement* fib::algorithms::nD2::createAreasForPoints ( const set< nD1::cDataPoint< tX, tX > > &  setPoints,
cFibElement pUnderobject,
cFibVariable pVariableDimX,
cFibVariable pVariableDimY 
)

This function combines the given set of points to Fib objects. Beware: You have to care that the created underobjects will be deleted

Parameters:
setPointsthe set with the datapoints to combine to Fib objects with the help of area and function elements; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
pUnderobjecta pointer to the underobject, which the created Fib elements should contain and which should be evalued for the point positions
pVariableXa pointer to the variable for the x position
pVariableYa pointer to the variable for the y position
Returns:
a Fib object with the created Fib underobjects, wher the given variables for the given pUnderobject will go over all point positions in the given set setPoints or NULL if non such could be created; some positions can be evalued twice; the Fib underobjects, wich evalue the most points, are on the front of the listobject (have a lower underobject number); if NULL is returnd, you have to care that pUnderobject will be deleted, else pUnderobject will be included in one underobject of the created listobject and the other underobject will contain copies of pUnderobject Structur of the created Fib object: area( fun( fun( area( pUnderobject )))) or if this previos given structur is not possible list( area( fun( fun( area( pUnderobject )))) ... area( fun( fun( area( pUnderobject )))) ) (some fun or areas can be missing, if they are not needed, eg. for lines)
template<class tX >
cFibElement* fib::algorithms::nD2::createNSplineBorderAreasForPoints ( const set< nD1::cDataPoint< tX, tX > > &  setPoints,
cFibElement pUnderobject,
cFibVariable pVariableDimX,
cFibVariable pVariableDimY,
const unsigned int  uiMaxSplineParameters = 4,
const unsigned int  uiMinBitsToStoreMantissa = 1,
double  maxValue = 0.0,
const double  maxError = 0,
const unsigned long  ulMaxMemoryCost = 100000 
)

This function combines the given set of points to Fib objects, with the help of splies (polynoms with fixed number of parametes uiMaxSplineParameters) . For this the method

See also:
nD1::cSpline::evalueSpline() will be used. Beware: You have to care that the created underobjects will be deleted

uses

See also:
nD1::cSpline::evalueSpline() The method should give the same result as createSplineItrFastBorderAreasForPoints() but faster and with less Fib elements. It will iterativ increase the number of parameters for the splines (from 1 to uiMaxNumberOfParameters).
Parameters:
setPointsthe set with the datapoints to combine to Fib objects with the help of area and function elements; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
pUnderobjecta pointer to the underobject, which the created Fib elements should contain and which should be evalued for the point positions
pVariableXa pointer to the variable for the x position
pVariableYa pointer to the variable for the y position
uiMaxSplineParametersthe number of parameters for the spline; Don't choose this number to big, because the evaluation time will grow exponentialy with this number. Even splines with 8 parameters will take some time.
uiMinBitsToStoreMantissathe minimal number of bits to store the mantissa of the function value parameters, when the parameter is in the form: mantissa * 2^exponent ; the method will try to reduce the bits, to store a parameter of the returned vector, to the uiMinBitsToStoreMantissa value; if uiMinBitsToStoreMantissa is 0, no optimization for the mantissa bits will be done
maxValuethe maximum possible value in all parameters the evalued spline/function elements will allways have value parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size(); if 0 (standard value) is given, the maximum possible value will be evalued from the given data
maxErrorthe maximal error for the border polynoms to find; the error on the interpolated polynoms for the borders will be equal or less than maxError
ulMaxMemoryCosta number for the maximum memory cost this method is allowed to use; if 0 the maximum memory cost is unbounded
Returns:
a Fib object with the created Fib underobjects, wher the given variables for the given pUnderobject will go over all point positions in the given set setPoints or NULL if non such could be created; some positions can be evalued twice; the Fib underobjects, wich evalue the most points, are on the front of the listobject (have a lower underobject number); if NULL is returnd, you have to care that pUnderobject will be deleted, else pUnderobject will be included in one underobject of the created listobject and the other underobject will contain copies of pUnderobject Structur of the created Fib object: area( fun( fun( fun( area( pUnderobject ))))) or if this previos given structur is not possible list( area( fun( fun( fun( area( pUnderobject ))))) ... area( fun( fun( fun( area( pUnderobject ))))) ) (some fun or areas can be missing, if they are not needed, eg. for lines)
template<class tX >
cFibElement* fib::algorithms::nD2::createNSplineBorderAreasForPoints ( const set< nD1::cDataPoint< tX, tX > > &  setMinimumArea,
const set< nD1::cDataPoint< tX, tX > > &  setMaximumArea,
cFibElement pUnderobject,
cFibVariable pVariableDimX,
cFibVariable pVariableDimY,
const unsigned int  uiMaxSplineParameters = 4,
set< nD1::cDataPoint< tX, tX > > *  pOutSetMissingPoints = NULL,
const unsigned int  uiMinBitsToStoreMantissa = 1,
double  maxValue = 0.0,
const double  maxError = 0,
const unsigned long  ulMaxMemoryCost = 100000 
)

This function combines the given set of points to Fib objects, with the help of splies (polynoms with fixed number of parametes uiMaxSplineParameters) . For this the method

See also:
nD1::cSpline::evalueSpline() will be used. Beware: You have to care that the created underobjects will be deleted

uses

See also:
nD1::cSpline::evalueSpline() The method should give the same result as createSplineItrFastBorderAreasForPoints() but faster and with less Fib elements. It will iterativ increase the number of parameters for the splines (from 1 to uiMaxNumberOfParameters).
Parameters:
setMinimumAreathe set with the datapoints to combine to Fib objects with the help of area and function elements; the created area should contain all of these points; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
setMaximumAreathe set with the datapoints to combine to Fib objects with the help of area and function elements; the created area can contain these points; this set should contain all points from setMinimumArea; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
pUnderobjecta pointer to the underobject, which the created Fib elements should contain and which should be evalued for the point positions
pVariableXa pointer to the variable for the x position
pVariableYa pointer to the variable for the y position
uiMaxSplineParametersthe number of parameters for the spline; Don't choose this number to big, because the evaluation time will grow exponentialy with this number. Even splines with 8 parameters will take some time.
pOutSetMissingPointsif not NULL, the points not in the created area will be inserted/added into this set, when this function returns
uiMinBitsToStoreMantissathe minimal number of bits to store the mantissa of the function value parameters, when the parameter is in the form: mantissa * 2^exponent ; the method will try to reduce the bits, to store a parameter of the returned vector, to the uiMinBitsToStoreMantissa value; if uiMinBitsToStoreMantissa is 0, no optimization for the mantissa bits will be done
maxValuethe maximum possible value in all parameters the evalued spline/function elements will allways have value parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size(); if 0 (standard value) is given, the maximum possible value will be evalued from the given data
maxErrorthe maximal error for the border polynoms to find; the error on the interpolated polynoms for the borders will be equal or less than maxError
ulMaxMemoryCosta number for the maximum memory cost this method is allowed to use; if 0 the maximum memory cost is unbounded
Returns:
a Fib object with the created Fib underobjects, wher the given variables for the given pUnderobject will go over all point positions in the given set setPoints or NULL if non such could be created; some positions can be evalued twice; the Fib underobjects, wich evalue the most points, are on the front of the listobject (have a lower underobject number); if NULL is returnd, you have to care that pUnderobject will be deleted, else pUnderobject will be included in one underobject of the created listobject and the other underobject will contain copies of pUnderobject Structur of the created Fib object: area( fun( fun( fun( area( pUnderobject ))))) or if this previos given structur is not possible list( area( fun( fun( fun( area( pUnderobject ))))) ... area( fun( fun( fun( area( pUnderobject ))))) ) (some fun or areas can be missing, if they are not needed, eg. for lines)
template<class tX >
cFibElement* fib::algorithms::nD2::createSplineBorderAreasForPoints ( const set< nD1::cDataPoint< tX, tX > > &  setPoints,
cFibElement pUnderobject,
cFibVariable pVariableDimX,
cFibVariable pVariableDimY,
const unsigned int  uiMaxSplineParameters = 4,
const unsigned int  uiMinBitsToStoreMantissa = 1,
const double  maxValue = 0.0,
const unsigned long  ulMaxMemoryCost = 100000 
)

This function combines the given set of points to Fib objects, with the help of splies (polynoms with fixed number of parametes uiMaxSplineParameters) . Beware: You have to care that the created underobjects will be deleted

uses

See also:
nD1::cPolynom::evalueSpline()
Parameters:
setPointsthe set with the datapoints to combine to Fib objects with the help of area and function elements; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
pUnderobjecta pointer to the underobject, which the created Fib elements should contain and which should be evalued for the point positions
pVariableXa pointer to the variable for the x position
pVariableYa pointer to the variable for the y position
uiMaxSplineParametersthe number of parameters for the spline; Don't choose this number to big, because the evaluation time will grow exponentialy with this number. Even splines with 8 parameters will take some time.
uiMinBitsToStoreMantissathe minimal number of bits to store the mantissa of the function value parameters, when the parameter is in the form: mantissa * 2^exponent ; the method will try to reduce the bits, to store a parameter of the returned vector, to the uiMinBitsToStoreMantissa value; if uiMinBitsToStoreMantissa is 0, no optimization for the mantissa bits will be done
maxValuethe maximum possible value in all parameters the evalued spline/function elements will allways have value parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size(); if 0 (standard value) is given, the maximum possible value will be evalued from the given data
ulMaxMemoryCosta number for the maximum memory cost this method is allowed to use; if 0 the maximum memory cost is unbounded
Returns:
a Fib object with the created Fib underobjects, wher the given variables for the given pUnderobject will go over all point positions in the given set setPoints or NULL if non such could be created; some positions can be evalued twice; the Fib underobjects, wich evalue the most points, are on the front of the listobject (have a lower underobject number); if NULL is returnd, you have to care that pUnderobject will be deleted, else pUnderobject will be included in one underobject of the created listobject and the other underobject will contain copies of pUnderobject Structur of the created Fib object: area( fun( fun( fun( area( pUnderobject ))))) or if this previos given structur is not possible list( area( fun( fun( fun( area( pUnderobject ))))) ... area( fun( fun( fun( area( pUnderobject ))))) ) (some fun or areas can be missing, if they are not needed, eg. for lines)
template<class tX >
cFibElement* fib::algorithms::nD2::createSplineItrFastBorderAreasForPoints ( const set< nD1::cDataPoint< tX, tX > > &  setPoints,
cFibElement pUnderobject,
cFibVariable pVariableDimX,
cFibVariable pVariableDimY,
const unsigned int  uiMaxSplineParameters = 4,
const unsigned int  uiMinBitsToStoreMantissa = 1,
double  maxValue = 0.0,
const double  maxError = 0,
const unsigned long  ulMaxMemoryCost = 100000 
)

This function combines the given set of points to Fib objects, with the help of splies (polynoms with fixed number of parametes uiMaxSplineParameters) . Beware: You have to care that the created underobjects will be deleted

uses

See also:
nD1::cPolynom::evalueSplineIterativFast() The method should give the same result as createSplineBorderAreasForPoints() but faster. It will iterativ increase the number of parameters for the splines (from 1 to uiMaxNumberOfParameters) and will try to not use all of the given range points to find the polynom.
Parameters:
setPointsthe set with the datapoints to combine to Fib objects with the help of area and function elements; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
pUnderobjecta pointer to the underobject, which the created Fib elements should contain and which should be evalued for the point positions
pVariableXa pointer to the variable for the x position
pVariableYa pointer to the variable for the y position
uiMaxSplineParametersthe number of parameters for the spline; Don't choose this number to big, because the evaluation time will grow exponentialy with this number. Even splines with 8 parameters will take some time.
uiMinBitsToStoreMantissathe minimal number of bits to store the mantissa of the function value parameters, when the parameter is in the form: mantissa * 2^exponent ; the method will try to reduce the bits, to store a parameter of the returned vector, to the uiMinBitsToStoreMantissa value; if uiMinBitsToStoreMantissa is 0, no optimization for the mantissa bits will be done
maxValuethe maximum possible value in all parameters the evalued spline/function elements will allways have value parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size(); if 0 (standard value) is given, the maximum possible value will be evalued from the given data
maxErrorthe maximal error for the border polynoms to find; the error on the interpolated polynoms for the borders will be equal or less than maxError
ulMaxMemoryCosta number for the maximum memory cost this method is allowed to use; if 0 the maximum memory cost is unbounded
Returns:
a Fib object with the created Fib underobjects, wher the given variables for the given pUnderobject will go over all point positions in the given set setPoints or NULL if non such could be created; some positions can be evalued twice; the Fib underobjects, wich evalue the most points, are on the front of the listobject (have a lower underobject number); if NULL is returnd, you have to care that pUnderobject will be deleted, else pUnderobject will be included in one underobject of the created listobject and the other underobject will contain copies of pUnderobject Structur of the created Fib object: area( fun( fun( fun( area( pUnderobject ))))) or if this previos given structur is not possible list( area( fun( fun( fun( area( pUnderobject ))))) ... area( fun( fun( fun( area( pUnderobject ))))) ) (some fun or areas can be missing, if they are not needed, eg. for lines)
template<class tX >
cFibElement* fib::algorithms::nD2::createSplineItrFastBorderAreasForPoints ( const set< nD1::cDataPoint< tX, tX > > &  setMinimumArea,
const set< nD1::cDataPoint< tX, tX > > &  setMaximumArea,
cFibElement pUnderobject,
cFibVariable pVariableDimX,
cFibVariable pVariableDimY,
const unsigned int  uiMaxSplineParameters = 4,
set< nD1::cDataPoint< tX, tX > > *  pOutSetMissingPoints = NULL,
const unsigned int  uiMinBitsToStoreMantissa = 1,
double  maxValue = 0.0,
const double  maxError = 0,
const unsigned long  ulMaxMemoryCost = 100000 
)

This function combines the given set of points to Fib objects, with the help of splies (polynoms with fixed number of parametes uiMaxSplineParameters) . Beware: You have to care that the created underobjects will be deleted

uses

See also:
nD1::cPolynom::evalueSplineIterativFast() The method should give the same result as createSplineBorderAreasForPoints() but faster. It will iterativ increase the number of parameters for the splines (from 1 to uiMaxNumberOfParameters) and will try to not use all of the given range points to find the polynom.
Parameters:
setMinimumAreathe set with the datapoints to combine to Fib objects with the help of area and function elements; the created area should contain all of these points; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
setMaximumAreathe set with the datapoints to combine to Fib objects with the help of area and function elements; the created area can contain these points; this set should contain all points from setMinimumArea; The given points should be positions in an matrix, positions in the matrix but not given, will be considerd not to be in the area to create.
pUnderobjecta pointer to the underobject, which the created Fib elements should contain and which should be evalued for the point positions
pVariableXa pointer to the variable for the x position
pVariableYa pointer to the variable for the y position
uiMaxSplineParametersthe number of parameters for the spline; Don't choose this number to big, because the evaluation time will grow exponentialy with this number. Even splines with 8 parameters will take some time.
pOutSetMissingPointsif not NULL, the points not in the created area will be inserted/added into this set, when this function returns
uiMinBitsToStoreMantissathe minimal number of bits to store the mantissa of the function value parameters, when the parameter is in the form: mantissa * 2^exponent ; the method will try to reduce the bits, to store a parameter of the returned vector, to the uiMinBitsToStoreMantissa value; if uiMinBitsToStoreMantissa is 0, no optimization for the mantissa bits will be done
maxValuethe maximum possible value in all parameters the evalued spline/function elements will allways have value parameters vecFactors[i] with -1 * maxValue <= vecFactors[i] <= maxValue for 0 <= i < vecFactors.size(); if 0 (standard value) is given, the maximum possible value will be evalued from the given data
maxErrorthe maximal error for the border polynoms to find; the error on the interpolated polynoms for the borders will be equal or less than maxError
ulMaxMemoryCosta number for the maximum memory cost this method is allowed to use; if 0 the maximum memory cost is unbounded
Returns:
a Fib object with the created Fib underobjects, wher the given variables for the given pUnderobject will go over all point positions in the given set setPoints or NULL if non such could be created; some positions can be evalued twice; the Fib underobjects, wich evalue the most points, are on the front of the listobject (have a lower underobject number); if NULL is returnd, you have to care that pUnderobject will be deleted, else pUnderobject will be included in one underobject of the created listobject and the other underobject will contain copies of pUnderobject Structur of the created Fib object: area( fun( fun( fun( area( pUnderobject ))))) or if this previos given structur is not possible list( area( fun( fun( fun( area( pUnderobject ))))) ... area( fun( fun( fun( area( pUnderobject ))))) ) (some fun or areas can be missing, if they are not needed, eg. for lines)
template<class tX , class tY , class tZ >
vector< nD2::cDataPoint<tX, tY, tZ> > fib::algorithms::nD2::derivate ( const vector< nD2::cDataPoint< tX, tY, tZ > > &  vecInput)

This function evaluats a derivate of a vector with datapoints. To evalue the derivate the differnce in the y values of to neibourpoints is divided with ther distance.

Parameters:
vecInputthe vector with the range data points, for which the derivate is to be evalued
Returns:
the vector with derivate range datapoints
template<class tX , class tY , class tZ >
pair< vector< nD2::cDataPointRange<tX, tY, tZ> >, nD2::cDataPointRange<tX, tY, tZ> > fib::algorithms::nD2::derivateDist ( const vector< nD2::cDataPointRange< tX, tY, tZ > > &  vecInput)

This function evaluats a derivate of a vector with range datapoints. To evalue the derivate a point with the minimal range size is choosen as the devolopment point. For every other point the maximal and minimal distance betwean two bounderies of the point and the devolopment point is evalued and divided by the distance betwean the points.

Parameters:
vecInputthe vector with the range data points, for which the derivate is to be evalued
Returns:
a pair with it's elements:
  • the first element is the vector with derivate range datapoints
  • the second element is the devolopment point which was choosen
template<class tX >
void fib::algorithms::nD2::integrateLineInAreas ( list< pair< unsigned long, list< pair< fib::algorithms::nD1::cDataPoint< tX, tX >, fib::algorithms::nD1::cDataPoint< tX, tX > > > > > &  areas,
const pair< fib::algorithms::nD1::cDataPoint< tX, tX >, fib::algorithms::nD1::cDataPoint< tX, tX > > &  paNewLine 
)

This function integrats the given line into the given areas. The given line will be appended to all areas to which it is connected. (It is connected if one of it's 8 neibours is in the area.) If no area exist a nuw area with the line will be added. If an area exists wich is connected with the given line paNewLine, but already has points on the same x row, the area is duplicated without theas line and the new line is added to it.

Parameters:
areasa list of areas, wher the line should be integrated into
paNewLinethe (new) line to integrate as a pare of it lowest and biggest datapoints
bool fib::algorithms::nD2::lowerFirstNumber ( const pair< unsigned long, cFibElement * > &  paFirst,
const pair< unsigned long, cFibElement * > &  paSecond 
)
Parameters:
paFirstthe first pair to compare with
paSecondthe second pair to compare with
Returns:
true if the number of the first element of the first pair paFirst is lower than that of the second paSecond, if they bouth are equal, returns true if the pointer of the second element of the first pair is lower than that of the second