hi,
i'm coding to take a input vector inputdata, and continuously find standard deviation to count how many distinct data ar available.for this i implement a small method called findk().
public int findk(Vector inputdata ,double minSD)
{
inputdata=new Vector();
double tolerance=0.001,thisSD;
Collections.sort(inputdata);
if(minSD<0.0)
this.minSD =inputdata.getStandardDeviation();
inputdata d1= getHalf(1,inputdata);
inputdata d2 = getHalf(2,inputdata);
thisSD=d1.getStandardDeviation();
if(thisSD+tolerance < minSD)
return 1 + findk(d1,thisSD);
thisSD=d2.getStandardDeviation();
if(thisSD+tolerance < minSD)
return 1 + findk(d2,thisSD);
return 0;
}
but the code shows the following error
[output]
C:\Program Files\Java\jdk1.6.0_03\bin>javac ClusterAnalysis.java
ClusterAnalysis.java:336: cannot find symbol
symbol : method getStandardDeviation()
location: class java.util.Vector
this.minSD =inputdata.getStandardDeviation();
^
ClusterAnalysis.java:337: cannot find symbol
symbol : class inputdata
location: class ClusterAnalysis
inputdata d1= getHalf(1,inputdata);
^
ClusterAnalysis.java:337: cannot find symbol
symbol : method getHalf(int,java.util.Vector)
location: class ClusterAnalysis
inputdata d1= getHalf(1,inputdata);
^
ClusterAnalysis.java:338: cannot find symbol
symbol : class inputdata
location: class ClusterAnalysis
inputdata d2 = getHalf(2,inputdata);
^
ClusterAnalysis.java:338: cannot find symbol
symbol : method getHalf(int,java.util.Vector)
location: class ClusterAnalysis
inputdata d2 = getHalf(2,inputdata);
^
ClusterAnalysis.java:342: operator + cannot be applied to int,<any>
return 1 + findk(d1,thisSD);
^
ClusterAnalysis.java:342: incompatible types
found : <nulltype>
required: int
return 1 + findk(d1,thisSD);
^
ClusterAnalysis.java:345: operator + cannot be applied to int,<any>
return 1 + findk(d2,thisSD);
^
ClusterAnalysis.java:345: incompatible types
found : <nulltype>
required: int
return 1 + findk(d2,thisSD);
^
Note: ClusterAnalysis.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
[/output]
Plz help me to solve this problem. Thanks in advance.