code: private void read_problem() throws IOException
  	{
  		BufferedReader fp = new BufferedReader(new FileReader(input_file_name));
  		java.util.Vector vy = new java.util.Vector();
  		java.util.Vector vx = new java.util.Vector();
  		int max_index = 0;
  
  		while(true)
  		{
  			String line = fp.readLine();
  			if(line == null) break;
  
  			StringTokenizer st = new StringTokenizer(line," \t\n\r\f:");
  
  			vy.addElement(st.nextToken());
  			int m = st.countTokens()/2;
  			svm_node[] x = new svm_node[m];
  			for(int j=0;j<m;j++)
  			{
  				x[j] = new svm_node();
  				x[j].index = atoi(st.nextToken());
  				x[j].value = atof(st.nextToken());
  			}
  			if(m>0) max_index = Math.max(max_index, x[m-1].index);
  			vx.addElement(x);
  		}
  
  		prob = new svm_problem();
  		prob.l = vy.size();
  		prob.x = new svm_node[prob.l][];
  		for(int i=0;i<prob.l;i++)
  			prob.x[i] = (svm_node[])vx.elementAt(i);
  		prob.y = new double[prob.l];
  		for(int i=0;i<prob.l;i++)
  			prob.y[i] = atof((String)vy.elementAt(i));
  
  		if(param.gamma == 0)
  			param.gamma = 1.0/max_index;
  
  		fp.close();
  	}
docs: read in a problem (in svmlight format)