import java.util.ArrayList;
import java.util.List;
public class ComputerDecision {
//List> vector1 ;
//List> vector2 ;
List vector1 = new ArrayList();
List vector2 = new ArrayList();
static List vector3 = new ArrayList();
static List vector4 = new ArrayList();
public ComputerDecision(String string1, String string2) {
//把输入字符串中多个空格变为一个
String[] vector1String = string1.trim().replaceAll("\\s+", " ").split(" ");
String[] vector2String = string2.trim().replaceAll("\\s+", " ").split(" ");
for (String string : vector1String) {
vector1.add(Integer.parseInt(string));
}
for (String string : vector2String) {
vector2.add(Integer.parseInt(string));
}
}
public static void ComputerDecisiond1(String string1, String string2) {
//把输入字符串中多个空格变为一个
String[] vector1String = string1.trim().replaceAll("\\s+", " ").split(" ");
String[] vector2String = string2.trim().replaceAll("\\s+", " ").split(" ");
for (String string : vector1String) {
vector3.add(Double.valueOf(string));
}
for (String string : vector2String) {
vector4.add(Double.valueOf(string));
}
}
// 求余弦相似度
public double sim() {
double result = 0;
result = pointMulti(vector1