Changeset 998
- Timestamp:
- 11/01/08 09:13:04 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/chaos/lib/src/Base/Stat/NumericalSampleImplementation.cxx
r968 r998 630 630 const NumericalScalar factor1 = 1.0 / (static_cast<NumericalScalar>(size) - 1.0); 631 631 for (UnsignedLong i = 0; i < dimension; ++i) { 632 // kurtosis = 1 / size sum (Xi - Xmean)^4 / (var/(size-1))^2 - 3632 // kurtosis = 1 / size sum (Xi - Xmean)^4 / (var/(size-1))^2 633 633 kurtosis[i] *= factor * pow(var[i] * factor1, -2); 634 kurtosis[i] -= 3.0;635 634 } 636 635 return kurtosis; branches/chaos/lib/src/Uncertainty/Algorithm/OrthogonalBasis/EnumerateFunction.cxx
r889 r998 96 96 } 97 97 98 /* The bijective association between an integer and a set of indices */ 99 EnumerateFunction::Indices EnumerateFunction::operator() (UnsignedLong index) const 98 /* The bijective association between an integer and a set of indices. 99 First, we look for the total degree of the associated polynom. Then, we 100 compute recursively the complement by looping over the degree of the remainder. 101 */ 102 EnumerateFunction::Indices EnumerateFunction::operator() (const UnsignedLong index) const 100 103 { 101 104 Indices result(dimension_, 0); … … 113 116 } 114 117 index -= binomialCoefficient; 115 UnsignedLong remainingDegree(findBinomialCoefficient(index, dimension_ - i - 1, binomialCoefficient));118 const UnsignedLong remainingDegree(findBinomialCoefficient(index, dimension_ - i - 1, binomialCoefficient)); 116 119 result[i] = degree - remainingDegree; 117 120 degree = remainingDegree; … … 121 124 } 122 125 126 /* The inverse of the association */ 127 UnsignedLong EnumerateFunction::inverse(const Indices indices) const 128 { 129 UnsignedLong totalDegree(0); 130 for (UnsignedLong i = 0; i < dimension_; ++i) totalDegree += indices[i]; 131 UnsignedLong result(getStrateCumulatedCardinal(totalDegree)); 132 for (UnsignedLong i = 0; i < dimension_ - 1; i++) 133 { 134 // Accumulate the partial degree of the lower dimensional polynomials 135 } 136 return 0; 137 } 138 139 /* The cardinal of the given strate */ 140 UnsignedLong EnumerateFunction::getStrateCardinal(const UnsignedLong strateIndex) const 141 { 142 return static_cast<UnsignedLong>(round(exp(SpecFunc::LnGamma(dimension_ + strateIndex) - SpecFunc::LnGamma(dimension_) - SpecFunc::LnGamma(strateIndex + 1)))); 143 } 144 145 /* The cardinal of the cumulated strate above or equal to the given strate */ 146 UnsignedLong EnumerateFunction::getStrateCumulatedCardinal(const UnsignedLong strateIndex) const 147 { 148 return static_cast<UnsignedLong>(round(exp(SpecFunc::LnGamma(dimension_ + strateIndex + 1) - SpecFunc::LnGamma(dimension_ + 1) - SpecFunc::LnGamma(strateIndex + 1)))); 149 } 150 123 151 124 152 /* Dimension accessor */ branches/chaos/lib/src/Uncertainty/Algorithm/OrthogonalBasis/EnumerateFunction.hxx
r889 r998 68 68 69 69 /** The bijective association between an integer and a set of indices */ 70 virtual Indices operator() ( UnsignedLong index) const;70 virtual Indices operator() (const UnsignedLong index) const; 71 71 72 /** The inverse of the association */ 73 virtual UnsignedLong inverse(const Indices indices) const; 74 75 /** The cardinal of the given strate */ 76 virtual UnsignedLong getStrateCardinal(const UnsignedLong strateIndex) const; 77 78 /** The cardinal of the cumulated strate above or equal to the given strate */ 79 virtual UnsignedLong getStrateCumulatedCardinal(const UnsignedLong strateIndex) const; 80 72 81 /** Dimension accessor */ 73 82 void setDimension(const UnsignedLong dimension);
