Examples of appendRange()


Examples of ucar.ma2.Section.appendRange()

    // each dimension in the target must be present in the source
    for (int i=0; i<toDims.size(); i++) {
      Dimension dim = toDims.get(i);
      int varIndex = fromDims.indexOf(toDims.get(i));
      if (varIndex < 0) throw new IllegalArgumentException("Dimension "+dim+" does not exist");
      result.appendRange(fromIndex[varIndex], fromIndex[varIndex]);
    }
    return result;
  }
}
View Full Code Here

Examples of ucar.ma2.Section.appendRange()

  private static Section randomSubset(Section all, int stride) throws InvalidRangeException {
    Section s = new Section();
    for (Range r : all.getRanges()) {
      int first = random(r.first(), r.last() / 2);
      int last = random(r.last() / 2, r.last());
      s.appendRange(first, last, stride);
    }
    return s;
  }

  private static Random r = new Random(System.currentTimeMillis());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.