EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.probfunction.math.apache.impl]

COVERAGE SUMMARY FOR SOURCE FILE [LognormalDistribution.java]

nameclass, %method, %block, %line, %
LognormalDistribution.java100% (1/1)16%  (5/31)14%  (30/220)16%  (9/56)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LognormalDistribution100% (1/1)16%  (5/31)14%  (30/220)16%  (9/56)
LognormalDistribution (): void 0%   (0/1)0%   (0/3)0%   (0/2)
LognormalDistribution (LognormalDistributionImpl): void 0%   (0/1)0%   (0/6)0%   (0/3)
add (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
checkConstrains (): void 0%   (0/1)0%   (0/4)0%   (0/1)
density (double): double 0%   (0/1)0%   (0/10)0%   (0/3)
div (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getArithmeticMeanValue (): double 0%   (0/1)0%   (0/17)0%   (0/4)
getCumulativeFunction (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getFourierTransform (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getInverseFourierTransform (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getLowerDomainBorder (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getMedian (): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getMu (): double 0%   (0/1)0%   (0/5)0%   (0/1)
getPercentile (int): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getSigma (): double 0%   (0/1)0%   (0/5)0%   (0/1)
getStandardDeviation (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getVariance (): double 0%   (0/1)0%   (0/20)0%   (0/4)
greaterThan (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
hasOrderedDomain (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
lessThan (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
mult (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
probabilisticEquals (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
scale (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
shiftDomain (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/24)0%   (0/5)
stretchDomain (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/28)0%   (0/5)
sub (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
cdf (double): double 100% (1/1)80%  (8/10)67%  (2/3)
inverseF (double): double 100% (1/1)80%  (8/10)67%  (2/3)
LognormalDistribution (double, double): void 100% (1/1)100% (10/10)100% (3/3)
getXinf (): double 100% (1/1)100% (2/2)100% (1/1)
getXsup (): double 100% (1/1)100% (2/2)100% (1/1)

1package de.uka.ipd.sdq.probfunction.math.apache.impl;
2 
3import org.apache.commons.math.MathException;
4 
5import de.uka.ipd.sdq.probfunction.math.apache.distribution.LognormalDistributionFromMomentsImpl;
6import de.uka.ipd.sdq.probfunction.math.apache.distribution.LognormalDistributionImpl;
7//import umontreal.iro.lecuyer.probdist.LognormalDist;
8//import umontreal.iro.lecuyer.probdist.LognormalDistFromMoments;
9import de.uka.ipd.sdq.probfunction.math.ILognormalDistribution;
10import de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction;
11import de.uka.ipd.sdq.probfunction.math.exception.DomainNotNumbersException;
12import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInFrequencyDomainException;
13import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInTimeDomainException;
14import de.uka.ipd.sdq.probfunction.math.exception.FunctionsInDifferenDomainsException;
15import de.uka.ipd.sdq.probfunction.math.exception.IncompatibleUnitsException;
16import de.uka.ipd.sdq.probfunction.math.exception.InvalidSampleValueException;
17import de.uka.ipd.sdq.probfunction.math.exception.NegativeDistanceException;
18import de.uka.ipd.sdq.probfunction.math.exception.ProbabilityFunctionException;
19import de.uka.ipd.sdq.probfunction.math.exception.ProbabilitySumNotOneException;
20import de.uka.ipd.sdq.probfunction.math.exception.UnitNameNotSetException;
21import de.uka.ipd.sdq.probfunction.math.exception.UnitNotSetException;
22import de.uka.ipd.sdq.probfunction.math.exception.UnknownPDFTypeException;
23import de.uka.ipd.sdq.probfunction.math.exception.UnorderedDomainException;
24 
25public class LognormalDistribution extends AbstractContinousPDF  implements ILognormalDistribution {
26        
27        public LognormalDistribution(double mu, double sigma) {
28                super();
29                this.internalFunction = new LognormalDistributionImpl(mu, sigma);
30        }
31        
32        protected LognormalDistribution(){
33                super();
34        }
35 
36        private LognormalDistribution(LognormalDistributionImpl internal){
37                super();
38                this.internalFunction = internal;
39        }
40        
41        
42        @Override
43        public double cdf(double x) {
44                //SSJ compatibility
45            if(x == 0.0)
46                    return 0;
47                return super.cdf(x);
48        }
49 
50        @Override
51        public double density(double x) {
52                //SSJ compatibility
53                if(x == 0.0)
54                        return 0.0;
55                
56                return super.density(x);
57        }
58 
59        @Override
60        public double inverseF(double u) 
61        {
62                //SSJ compatibility
63                if(u == 0.0)
64                        return 0.0;
65                return super.inverseF(u);
66        }
67 
68 
69        
70        public IProbabilityDensityFunction add(IProbabilityDensityFunction pdf)
71                        throws FunctionsInDifferenDomainsException,
72                        UnknownPDFTypeException, IncompatibleUnitsException {
73                throw new UnsupportedOperationException();
74        }
75 
76        
77        public IProbabilityDensityFunction div(IProbabilityDensityFunction pdf)
78                        throws FunctionsInDifferenDomainsException,
79                        UnknownPDFTypeException, IncompatibleUnitsException {
80                throw new UnsupportedOperationException();
81        }
82 
83        
84        public IProbabilityDensityFunction getCumulativeFunction()
85                        throws FunctionNotInTimeDomainException {
86                throw new UnsupportedOperationException();
87        }
88 
89        
90        public IProbabilityDensityFunction getFourierTransform()
91                        throws FunctionNotInTimeDomainException {
92                throw new UnsupportedOperationException();
93        }
94 
95        
96        public IProbabilityDensityFunction getInverseFourierTransform()
97                        throws FunctionNotInFrequencyDomainException {
98                throw new UnsupportedOperationException();
99        }
100 
101        
102        public double getLowerDomainBorder() {
103                throw new UnsupportedOperationException();
104        }
105 
106        
107        public double greaterThan(IProbabilityDensityFunction pdf)
108                        throws ProbabilityFunctionException {
109                throw new UnsupportedOperationException();
110        }
111 
112        
113        public double lessThan(IProbabilityDensityFunction pdf)
114                        throws ProbabilityFunctionException {
115                throw new UnsupportedOperationException();
116        }
117 
118        
119        public IProbabilityDensityFunction mult(IProbabilityDensityFunction pdf)
120                        throws FunctionsInDifferenDomainsException,
121                        UnknownPDFTypeException, IncompatibleUnitsException {
122                throw new UnsupportedOperationException();
123        }
124 
125        
126        public double probabilisticEquals(IProbabilityDensityFunction pdf)
127                        throws ProbabilityFunctionException {
128                throw new UnsupportedOperationException();
129        }
130 
131        
132        public IProbabilityDensityFunction scale(double scalar) {
133                throw new UnsupportedOperationException();
134        }
135 
136        
137        public IProbabilityDensityFunction sub(IProbabilityDensityFunction pdf)
138                        throws FunctionsInDifferenDomainsException,
139                        UnknownPDFTypeException, IncompatibleUnitsException {
140                throw new UnsupportedOperationException();
141        }
142 
143        
144        public void checkConstrains() throws NegativeDistanceException,
145                        ProbabilitySumNotOneException, FunctionNotInTimeDomainException,
146                        UnitNotSetException, UnitNameNotSetException,
147                        InvalidSampleValueException {
148                throw new UnsupportedOperationException();
149 
150        }
151 
152        
153        public Object getMedian() throws UnorderedDomainException {
154                throw new UnsupportedOperationException();
155        }
156 
157        
158        public Object getPercentile(int p) throws IndexOutOfBoundsException,
159                        UnorderedDomainException {
160                throw new UnsupportedOperationException();
161        }
162 
163        public boolean hasOrderedDomain() {
164                throw new UnsupportedOperationException();
165        }
166 
167        
168        public double getMu() {
169                return ((LognormalDistributionImpl)this.internalFunction).getMean();
170        }
171 
172        
173        public double getSigma() {
174                return ((LognormalDistributionImpl)this.internalFunction).getStandardDeviation();
175        }
176 
177        
178        public IProbabilityDensityFunction shiftDomain(double scalar)
179                        throws DomainNotNumbersException {
180                double newMean = this.getArithmeticMeanValue() + scalar;
181                double newVariance = this.getVariance();
182                try {
183                        return new LognormalDistribution(new LognormalDistributionFromMomentsImpl(newMean, newVariance));
184                } catch (MathException e) {
185                        throw new ProbabilityFunctionException(e.getLocalizedMessage());
186                }
187        }
188 
189        
190        public IProbabilityDensityFunction stretchDomain(double scalar) {
191                double newMean = this.getArithmeticMeanValue() * scalar;
192                double newVariance = this.getVariance() * scalar * scalar;
193                try {
194                        return new LognormalDistribution(new LognormalDistributionFromMomentsImpl(newMean, newVariance));
195                } catch (MathException e) {
196                        throw new ProbabilityFunctionException(e.getLocalizedMessage());
197                }
198        }
199 
200        @Override
201        public double getStandardDeviation() {
202                return Math.sqrt(getVariance());
203        }
204 
205        @Override
206        public double getXinf() {
207                return 0.0;
208        }
209 
210        @Override
211        public double getXsup() {
212                return Double.POSITIVE_INFINITY;
213        }
214 
215        @Override
216        public double getArithmeticMeanValue() throws DomainNotNumbersException,
217                        FunctionNotInTimeDomainException {
218                double sigma = getSigma();
219                double sigma2 = sigma*sigma;
220                double mu = getMu();
221                return Math.exp(mu+sigma2/2);
222        }
223 
224        @Override
225        public double getVariance() {
226                double sigma = getSigma();
227                double sigma2 = sigma*sigma;
228                double mu = getMu();
229                return Math.exp(sigma2 + 2*mu)*Math.expm1(sigma2);
230        }
231        
232        
233        
234 
235}

[all classes][de.uka.ipd.sdq.probfunction.math.apache.impl]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov