private void output(int index, double value, String toFile)
	{
		/* skip single-valued attribute */
		if(feature_max[index] == feature_min[index])
			return;

		if(value == feature_min[index])
			value = lower;
		else if(value == feature_max[index])
			value = upper;
		else
			value = lower + (upper-lower) * 
				(value-feature_min[index])/
				(feature_max[index]-feature_min[index]);

		if(value != 0)
		{
			if (toFile != null){
				outputtofile(toFile, index + ":" + value + " ", true);
			}else{
				System.out.print(index + ":" + value + " ");
			}
			new_num_nonzeros++;
		}
	}