/* * to sort a band, we have */ void band::sortBand (void) { int MadeChange = true; int i; /* * just a simple bubblesort, since the amount of elements * is limited, and the function is only called on set up */ while (MadeChange) { MadeChange = false; for (i = 0; i < amount - 1; i ++) if (getFrequency (i) > getFrequency (i + 1)) { int f1, v1; f1 = getFrequency (i + 1); v1 = getVoltage (i + 1); setFrequency (i + 1, getFrequency (i)); setVoltage (i + 1, getVoltage (i)); setFrequency (i, f1); setVoltage (i, v1); MadeChange = true; } } setLowerBound (getFrequency (0)); setUpperBound (getFrequency (amount - 1)); }
TriangularDistribution::TriangularDistribution(double mode, double lowerBound, double upperBound) : UncertaintyDescription(std::shared_ptr<detail::UncertaintyDescription_Impl>( new detail::UncertaintyDescription_Impl(TriangularDistribution::type()))) { setMode(mode); setLowerBound(lowerBound); setUpperBound(upperBound); }
BetaDistribution::BetaDistribution(double alpha, double beta, double lowerBound, double upperBound) : UncertaintyDescription(boost::shared_ptr<detail::UncertaintyDescription_Impl>( new detail::UncertaintyDescription_Impl(BetaDistribution::type()))) { setAlpha(alpha); setBeta(beta); setLowerBound(lowerBound); setUpperBound(upperBound); }