Example #1
0
  public MipMap(Array1D domain, Array1D[] rangeTuples) {
    ArgChecker.isNotNull(domain, "domain");
    ArgChecker.isNotNull(rangeTuples, "rangeTuples");

    this.mipLevel = 0;
    this.domain = domain;
    this.rangeTuples = rangeTuples;
    this.flyweightTuple = new FlyweightTuple(this.domain, this.rangeTuples);
  }
Example #2
0
  MipMap(Array2D multiResDomain, Array2D[] multiResRangeTuple, int mipLevel) {
    ArgChecker.isNotNull(multiResDomain, "multiResDomain");
    ArgChecker.isNotNull(multiResRangeTuple, "multiResRangeTuple");
    ArgChecker.isNonNegative(mipLevel, "mipLevel");

    this.mipLevel = mipLevel;
    this.domain = multiResDomain.getRow(mipLevel);

    this.rangeTuples = new Array1D[multiResRangeTuple.length];
    for (int i = 0; i < this.rangeTuples.length; i++) {
      this.rangeTuples[i] = multiResRangeTuple[i].getRow(mipLevel);
    }
    this.flyweightTuple = new FlyweightTuple(this.domain, this.rangeTuples);
  }
Example #3
0
 /** Returns the datapoint tuple at the specified index within this {@link MipMap}. */
 public Tuple2D getTuple(int dataPointIndex) {
   ArgChecker.isLTE(dataPointIndex, this.size() - 1, "dataPointIndex");
   this.flyweightTuple.setDomainAndRange(domain, rangeTuples);
   this.flyweightTuple.setDataPointIndex(dataPointIndex);
   return this.flyweightTuple;
 }