我有这两个课
public class Iris_Setosa {
private double sepal_length;
private double sepal_width;
private double petal_length;
private double petal_width;
//Constractor
public Iris_Setosa(double s_length,double s_width,double p_length,double p_width)
{
this.sepal_length=s_length;
this.sepal_width=s_width;
this.petal_length=p_length;
this.petal_width=p_width;
}
public double sepal_length()
{
return this.sepal_length;
}
public double sepal_width()
{
return this.sepal_width;
}
public double petal_length()
{
return this.petal_length;
}
public double petal_width()
{
return this.petal_width;
}
}
public class Iris_Versicolour {
private double sepal_length;
private double sepal_width;
private double petal_length;
private double petal_width;
//Constractor
public Iris_Versicolour(double s_length,double s_width,double p_length,double p_width)
{
this.sepal_length=s_length;
this.sepal_width=s_width;
this.petal_length=p_length;
this.petal_width=p_width;
}
public double sepal_length()
{
return this.sepal_length;
}
public double sepal_width()
{
return this.sepal_width;
}
public double petal_length()
{
return this.petal_length;
}
public double petal_width()
{
return this.petal_width;
}
}
我定义了两个向量并设置数据:
Vector <Iris_Setosa> I_Setosa = new Vector <Iris_Setosa>();
Vector <Iris_Versicolour> I_Versicolour = new Vector <Iris_Versicolouלr>();
//data
I_Setosa.add(new Iris_Setosa (4.6,3.4,1.4,0.3));
I_Setosa.add(new Iris_Setosa (5.4,3.9,1.7,0.4));
I_Versicolour.add(new Iris_Versicolour(6.4,3.2,4.5,1.5));
I_Versicolour.add(new Iris_Versicolour(6.9,3.1,4.9,1.5));
.......
我们如何将这两个向量分类在一起,以便被视为空间中的点?