You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Eamon Doyle <ea...@cornercase.net> on 2011/02/10 17:10:10 UTC

[math] Having trouble using any Math functions

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

Re: [math] Having trouble using any Math functions

Posted by Brent Worden <br...@gmail.com>.
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 <ea...@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