commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Worden <brent.wor...@gmail.com>
Subject Re: [math] Having trouble using any Math functions
Date Thu, 10 Feb 2011 16:40:38 GMT
Eamon,

You are not importing the correct package.  Try this instead:
import org.apache.commons.math.stat.descriptive.*;

HTH,

Brent.

On Thu, Feb 10, 2011 at 10:10 AM, Eamon Doyle <eamon@cornercase.net> wrote:
> Hi all.  I am new to Math (and including non-standard classes that aren't
> created by my own code for that matter) and I am having trouble calling
> DescriptiveStatistics.  Having searched for a solution for 3 days and having
> asked a number of friends, this is the logical next step.  When I try to run
> my program, I get two “cannot find symbol class DescriptiveStatistics”
> errors on the line that constructs the todaysDocsStats object.  If anyone
> has insight as to what I’m doing wrong here, I would really appreciate the
> help.
>
>
>
> Here are the relevant bits:
>
>
>
> The path to commons-math-2.1.jar is in my classpath.  If I remove it, then I
> also get the error “package org.apache.commons.math does not exist”
>
> Some code:
>
> import java.util.*;
>
> import org.apache.commons.math.*;
>
>
>
> public class CalcTAT {
>
>
>
>                public Date startProcessingTime;
>
>                public Date endProcessingTime;
>
>                public Date currentTime;
>
>
>
>                public CalcTAT(Date startTimeHold, Date endTimeHold)
>
>                {
>
>                                startProcessingTime = startTimeHold;
>
>                                endProcessingTime = endTimeHold;
>
>                }
>
>
>
>    public ArrayList findTAT( ArrayList docRes )
>
>    {
>
> **stuff removed**
>
>                                DescriptiveStatistics todaysDocsStats
= new
> DescriptiveStatistics();
>
>                                while(conditions )
>
>                                {
>
>                                                todaysDocsStats.add(**an
> int**);
>
>
>
>                                }
>
>                                                System.out.println(
> todaysDocsStats.percentile(85));
>
>                }
>
>    }
>
> }
>
>
>
>
> Thanks for any help you can provide.
>
> -Eamon
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message