public DMatrix(int dim, int cls, int num){
		samplenum = num;
		dimension = dim;
		groundcls = new int[samplenum];
		knewcls = new int[samplenum];
		nnnewcls = new int[samplenum];
		test = new int[samplenum];
		for(int i = 0; i < samplenum; i++){
			groundcls[i] = cls;
			knewcls[i] = -1;
			nnnewcls[i] = -1;
			test[i] = 0;
		}

		XMatrix = new Matrix[samplenum];
		for(int i = 0; i < samplenum; i++){
			XMatrix[i] = new Matrix(dim,1);
		}
	}