The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
|
Classes | |
class | cInequation |
class | cLinearConstrainFix |
class | cRangeFactor |
Functions | |
template<class tFactors > | |
vector< cLinearConstrainFix < tFactors > > & | crateDiagonalForm (vector< cLinearConstrainFix< tFactors > > &vecOfInequations) |
template<class tFactors > | |
vector< cLinearConstrainFix < tFactors > > & | nullConstantXFactors (vector< cLinearConstrainFix< tFactors > > &vecInputInequations, const vector< cRangeFactor< tFactors > > &vecXRanges, set< unsigned long > &setOpenAFactors) |
template<class tFactors > | |
vector< cLinearConstrainFix < tFactors > > & | nullConstantYFactors (vector< cLinearConstrainFix< tFactors > > &vecInputInequations, const vector< cRangeFactor< tFactors > > &vecYRanges) |
template<class tFactors > | |
vector< cLinearConstrainFix < tFactors > > | reduceNullFactors (const vector< cLinearConstrainFix< tFactors > > &vecInputInequations, vector< long > &vecFactorXMappings, vector< long > &vecFactorYMappings, unsigned long uiLastFactor=0) |
template<class tFactors > | |
vector< cInequation< tFactors > > | fixInequationsToInequations (const vector< cLinearConstrainFix< tFactors > > &vecOfInequations, const vector< long > &vecFactorXMappings, const vector< long > &vecFactorYMappings) |
template<class tFactors > | |
bool | reduceBounderies (const vector< cInequation< tFactors > > &vecOfInequations, vector< cRangeFactor< tFactors > > &vecXRanges, vector< cRangeFactor< tFactors > > &vecYRanges) |
template<class tFactors > | |
pair< vector< tFactors > , tFactors > | hillClimbingInRanges (const vector< cInequation< tFactors > > &vecOfInequations, const vector< cRangeFactor< tFactors > > &vecXRanges, const vector< cRangeFactor< tFactors > > &vecYRanges, unsigned long ulMaxIteration=256 *256) |
template<class tFactors > | |
tFactors | evalueErrorForFactors (const vector< tFactors > &vecActualPoint, const vector< cLinearConstrainFix< tFactors > > &vecOfInequations, const vector< cRangeFactor< tFactors > > &vecYRanges) |
template<class tFactors > | |
void | printInequations (vector< cLinearConstrainFix< tFactors > > vecOfInequations, ostream &outputStream) |
template<class tY > | |
vector< cRangeFactor< tY > > | solve (const vector< cLinearConstrainFix< tY > > &vecOfInequationsInput) |
vector< cLinearConstrainFix<tFactors> >& fib::algorithms::nLinearInequation::crateDiagonalForm | ( | vector< cLinearConstrainFix< tFactors > > & | vecOfInequations | ) |
This functions converts the given vector of inequation into a diagonal form. In this form ther exsists only one factor in the liniar formular (
vecOfInequations | a reference to the vector of inequation, which to convert into the triangle form (this is changed) |
tFactors fib::algorithms::nLinearInequation::evalueErrorForFactors | ( | const vector< tFactors > & | vecActualPoint, |
const vector< cLinearConstrainFix< tFactors > > & | vecOfInequations, | ||
const vector< cRangeFactor< tFactors > > & | vecYRanges | ||
) |
This function will evalue the error for the given x -factors vecActualPoint. For this the factors are inserted into the given inequations and it is checkt, if the evalued value is outside the given y -factor bounderies, if so the difference will be added to the error. Beware: In the vecOfInequations just the i'the y -factor is 1, every other y -factor should have the value 0 . This is a implicite assumption, the y -factors won't be checked.
vecActualPoint | the x -factors values, for which to evalue the error |
vecOfInequations | the inequations for which to evalue the error for the vecActualPoint |
vecYRanges | the y -factors ranges |
vector<cInequation<tFactors> > fib::algorithms::nLinearInequation::fixInequationsToInequations | ( | const vector< cLinearConstrainFix< tFactors > > & | vecOfInequations, |
const vector< long > & | vecFactorXMappings, | ||
const vector< long > & | vecFactorYMappings | ||
) |
This function converts the given
vecBounderyFactors[0] * yu_0 + ... + vecBounderyFactors[uiNumberOfDataPoints-1] * yu_{uiNumberOfDataPoints-1} (bGreaterEqual ? <= : =>) constant + vecFactors[0] * x_0 + ... + vecFactors[uiNumberOfFactors-1] * x_[uiNumberOfFactors-1} (bGreaterEqual ? <= : =>) vecBounderyFactors[0] * yo_0 + ... + vecBounderyFactors[uiNumberOfDataPoints-1] * yo_{uiNumberOfDataPoints-1} => -1 * constant <= vecFactors[0] * z_0 + ... + vecFactors[n] * z_n constant <= -1 * vecFactors[0] * z_0 - ... - vecFactors[n] * z_n
Wher:
The identifiers (
vecOfInequations | a vector with the (not original) inequations to convert |
vecFactorXMappings | the mappings for the x -factors in vecOfInequations to the original x -factors |
vecFactorYMappings | the mappings for the y -factors in vecOfInequations to the original y -factors |
pair< vector<tFactors>, tFactors> fib::algorithms::nLinearInequation::hillClimbingInRanges | ( | const vector< cInequation< tFactors > > & | vecOfInequations, |
const vector< cRangeFactor< tFactors > > & | vecXRanges, | ||
const vector< cRangeFactor< tFactors > > & | vecYRanges, | ||
unsigned long | ulMaxIteration = 256 *256 |
||
) |
This function implements a hillclimbing algorithm for finding good values for the x -factors. This function will try to minimize the error of the
vecOfInequations | the inequations, for which to find the factor values |
vecXRanges | the x -factors ranges, in which to find the factor values |
vecYRanges | the y -factors ranges |
ulMaxIteration | the maximal number of iterations / neibourpoints to check |
vector< cLinearConstrainFix<tFactors> >& fib::algorithms::nLinearInequation::nullConstantXFactors | ( | vector< cLinearConstrainFix< tFactors > > & | vecInputInequations, |
const vector< cRangeFactor< tFactors > > & | vecXRanges, | ||
set< unsigned long > & | setOpenAFactors | ||
) |
This function nulls all factors in the liniar formular (
vecInputInequations | a reference to the vector with the inequations, which x -factors should be nulled |
vecXRanges | a vector with the ranges of the x -factors |
setOpenAFactors | a refernce to the set of x -factors, which can be nulled; from this set the nulled factors will be removed; the set contains the numbers of the x -factors (counting begins with 0) |
vector< cLinearConstrainFix<tFactors> >& fib::algorithms::nLinearInequation::nullConstantYFactors | ( | vector< cLinearConstrainFix< tFactors > > & | vecInputInequations, |
const vector< cRangeFactor< tFactors > > & | vecYRanges | ||
) |
This function nulls all constrain/ bounderie factors in the inequations (
vecInputInequations | a reference to the vector with the inequations, of which the y -factors should be nulled |
vecYRanges | a vector with the ranges of the y -factors |
void fib::algorithms::nLinearInequation::printInequations | ( | vector< cLinearConstrainFix< tFactors > > | vecOfInequations, |
ostream & | outputStream | ||
) |
This function prints the given inequations. It simply calls
vecOfInequations | a vector with the inequations to output |
outputStream | a stream, wher to print the inequations to |
bool fib::algorithms::nLinearInequation::reduceBounderies | ( | const vector< cInequation< tFactors > > & | vecOfInequations, |
vector< cRangeFactor< tFactors > > & | vecXRanges, | ||
vector< cRangeFactor< tFactors > > & | vecYRanges | ||
) |
This function reduce the ranges for the given factors with the help of the given formulars. The reduced ranges of the factors are subsets of the given ranges. The reduction is done by checking all inequations as long as ranges change. For the check of one inequation, all it's elements except one are maximized by setting the factors to one of ther bounderies. For the not set element it is checked, wich minimum value it can have, If it's range is to big for this value, the range will be adapted to the minimal range, wich is consistent with the this value element.
example inequation: constant <= vecFactors[0] * z_0 + ... + vecFactors[n] * z_n
(vecFactors[0] * z_0) is an element
In ever inequation no more than one factor with a infinity boundery should exists.
The factor for an element is identified by the element identifier (
vecOfInequations | the inequations, with which to reduce the given ranges of the factors |
vecXRanges | the x -factors ranges to reduce |
vecYRanges | the y -factors ranges to reduce |
vector< cLinearConstrainFix<tFactors> > fib::algorithms::nLinearInequation::reduceNullFactors | ( | const vector< cLinearConstrainFix< tFactors > > & | vecInputInequations, |
vector< long > & | vecFactorXMappings, | ||
vector< long > & | vecFactorYMappings, | ||
unsigned long | uiLastFactor = 0 |
||
) |
This function elemitats all nullfactors from the given vector of inequations. Every -factor, that is 0 in all inequations, will be removed from all inequations. Later factors will decrase ther position. It is possible to set one factor as the last factor in the inequations.
vecInputInequations | the vector of the inequation, wher to remove the nullfactors |
vecFactorXMappings | the new x -factor (factors in the liniar formular) mappings, for the inequations; on position i in this vector stands the position, the i'th x -factor in the returned inequations, has in the given inequations vecInputInequations (returned[k].vecFactors[ i ] == vecInputInequations[k].vecFactors[ vecFactorXMappings[i] ]) |
vecFactorYMappings | the new y -factor (bounderie factor) mappings, for the inequations; on position i in this vector stands the position, the i'th y -factor in the returned inequations, has in the given inequations vecInputInequations (returned[k].vecBounderyFactors[ i ] == vecInputInequations[k].vecBounderyFactors[ vecFactorYMappings[i] ]) |
uiLastFactor | the x -factor ( |
vector< cRangeFactor<tY> > fib::algorithms::nLinearInequation::solve | ( | const vector< cLinearConstrainFix< tY > > & | vecOfInequationsInput | ) |
This function solves the given vector of inequiations.
vecOfInequationsInput | the vector of linear inequiations to solve |