getValuesAt method

Float64List getValuesAt (List<List<double>> xxx, int integralType)

Calculates and returns the values of the Shape at the given positions xxx. xxx.length is the dimension of the shape, so a position has n coordinate values. xxx0.length is the number of points for which to calculate the shape value. xxxp the n-dimensional coordinate of a point p integralType - how the integral is computed. 0=sum of all values. -1 = compute no integral

Implementation

Float64List getValuesAt(List<List<double>> xxx, int integralType) {
  int dim = xxx.length;
  int npoints = xxx[0].length;
  Float64List values = new Float64List(npoints);
  List<double> curpoint = new List<double>(dim);

  integral = 0.0;
  for (int i = 0; i < npoints; i++) {
    for (int k = 0; k < dim; k++) {
      curpoint[k] = xxx[k][i];
    }

    values[i] = getValueAt(curpoint);

    if (integralType == 0) {
      integral += values[i];
    }
  }

  integralCalculated = false;
  if (integralType != -1) {
    integralCalculated = true;
  }
  return values;
}