public static List<LabeledFeatureVector> getWieghtedSampleWithoutRp(List<LabeledFeatureVector> all,List<Double> w_temp,int num) throws Exception
	{
		List<LabeledFeatureVector> allVec=new Vector<LabeledFeatureVector>(all);
		List<Double> w=new Vector<Double>(w_temp);
		List<LabeledFeatureVector> re=new Vector<LabeledFeatureVector>();
		if(num>allVec.size())
		{
			System.out.println("11");
			return null;
		}
		if(num==allVec.size())
			return allVec;
		if(w.size()!=allVec.size())
			{
			System.out.println("12");
			return null;
			}
		//normal case
		for(int i=0;i<num;i++)
		{
			//normalize the vector and select the one to remove
			double sum=sum(w,0,w.size());
			double r=Math.random();
			int j=0;
			int break_point=-1;
			double temp_sum=0.0;
			for(j=0;j<w.size();j++)
			{
				w.set(j,w.get(j)/sum);
				temp_sum=temp_sum+w.get(j);
				if(r-temp_sum<0&&break_point==-1)
					break_point=j;
			}
			
			//remove the one and copy into the result list
			LabeledFeatureVector temp=allVec.remove(break_point);
			w.remove(break_point);
			int[] dims=new int[temp.size()];
			double[] vals=new double[temp.size()];
			for(j=0;j<temp.size();j++)
			{
				dims[j]=temp.getDimAt(j);
				vals[j]=temp.getValueAt(j);
			}
			LabeledFeatureVector newTemp=new LabeledFeatureVector(temp.getLabel(),dims,vals);
			re.add(newTemp);
			//update the weight vector
			for(j=0;j<w.size();j++)
			{
				w.set(j, w.get(j)/(1-w.get(j)));
			}
		}
		return re;
	}