{
Console.WriteLine("Boiling at Room {0}...", m_Location);
}
public final class ArrayUtil {
private ArrayUtil(){
}
/**
* Code shared by RegressionLine and WeightedAverage to discard prefix-zeros of array.
* if all the elems of array are zero, return null.
*/
public static double[] discardPrefixZero(double[] data){
int firstNoZeroIndex = -1;
for(int i=0;i<data.length;i++) {
if(data[i] == 0d) {
continue;
}
else{
firstNoZeroIndex = i;
break;
}
}
if(firstNoZeroIndex == -1)
return null;
double[] data2 = new double[data.length-firstNoZeroIndex];
System.arraycopy(data, firstNoZeroIndex, data2, 0, data.length-firstNoZeroIndex);
return data2;
}
}