org.apache.sis.math.Vector.range()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.apache.sis.math.Vector.range()方法的一些代码示例,展示了Vector.range()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.range()方法的具体详情如下:
包路径:org.apache.sis.math.Vector
类名称:Vector
方法名:range

Vector.range介绍

[英]Returns the minimal and maximal values found in this vector.
[中]返回在此向量中找到的最小值和最大值。

代码示例

代码示例来源:origin: org.apache.sis.core/sis-utility

/** Delegates to the enclosing vector. */
  @Override NumberRange<?> range(final IntSupplier supplier, final int n) {
    if (supplier != null) {
      return Vector.this.range(new IntSupplier() {
        @Override public int getAsInt() {
          return indices[supplier.getAsInt()];
        }
      }, n);
    } else {
      return Vector.this.range(new IntSupplier() {
        private int index;
        @Override public int getAsInt() {
          return indices[index++];
        }
      }, n);
    }
  }
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/** Delegates to the enclosing vector */
  @Override NumberRange<?> range(final IntSupplier indices, final int n) {
    if (indices != null) {
      return Vector.this.range(new IntSupplier() {
        @Override public int getAsInt() {
          return toBacking(indices.getAsInt());
        }
      }, n);
    }
    IntSupplier supplier = null;
    if (first != 0 || step != 1) {
      supplier = new IntSupplier() {
        private int index = first;
        @Override public int getAsInt() {
          final int i = index;
          index += step;
          return i;
        }
      };
    }
    return Vector.this.range(supplier, n);
  }
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Computes the minimal and maximal values in this vector.
 * This is the union of the range of the two concatenated vectors.
 */
@Override
public NumberRange<?> range() {
  return first.range().unionAny(second.range());
}

代码示例来源:origin: apache/sis

/**
 * The range of values in this vector is the range of values in the {@linkplain #base} vector
 * if we use all its data.
 */
@Override
public final NumberRange<?> range() {
  return (cycleLength == base.size()) ? base.range() : super.range();
}

代码示例来源:origin: apache/sis

/**
 * Computes the minimal and maximal values in this vector.
 * This is the union of the range of the two concatenated vectors.
 */
@Override
public NumberRange<?> range() {
  return first.range().unionAny(second.range());
}

代码示例来源:origin: apache/sis

/** Delegates to the enclosing vector. */
@Override NumberRange<?> range(final IntSupplier supplier, final int n) {
  if (supplier != null) {
    return Vector.this.range(() -> indices[supplier.getAsInt()], n);
  } else {
    return Vector.this.range(new IntSupplier() {
      private int index;
      @Override public int getAsInt() {
        return indices[index++];
      }
    }, n);
  }
}

代码示例来源:origin: apache/sis

/**
 * Returns the minimal and maximal values found in this vector.
 *
 * @return minimal and maximal values found in this vector.
 */
public NumberRange<?> range() {
  return range(null, size());
}

代码示例来源:origin: org.apache.sis.core/sis-utility

/**
 * Returns the minimal and maximal values found in this vector.
 *
 * @return minimal and maximal values found in this vector.
 */
public NumberRange<?> range() {
  return range(null, size());
}

代码示例来源:origin: apache/sis

/** Delegates to the enclosing vector */
@Override NumberRange<?> range(final IntSupplier indices, final int n) {
  if (indices != null) {
    return Vector.this.range(() -> toBacking(indices.getAsInt()), n);
  }
  IntSupplier supplier = null;
  if (first != 0 || step != 1) {
    supplier = new IntSupplier() {
      private int index = first;
      @Override public int getAsInt() {
        final int i = index;
        index += step;
        return i;
      }
    };
  }
  return Vector.this.range(supplier, n);
}

代码示例来源:origin: apache/sis

/**
 * Overridden for efficiency in case {@link #base} itself overrides that method.
 * Overriding that method is optional; the default implementation would have worked.
 */
@Override
final NumberRange<?> range(final IntSupplier indices, final int count) {
  return base.range(() -> toBase(indices.getAsInt()), count);
}

代码示例来源:origin: org.apache.sis.core/sis-referencing

final NumberRange<?> range = source.range();
final double min  = range.getMinDouble(true);
final double span = range.getMaxDouble(true) - min;

代码示例来源:origin: apache/sis

final NumberRange<?> range = source.range();
final double min  = range.getMinDouble(true);
final double span = range.getMaxDouble(true) - min;

代码示例来源:origin: org.apache.sis.core/sis-utility

final NumberRange<?> range = range();
if (range != null && !range.isEmpty()) {
  final Number min = range.getMinValue();

代码示例来源:origin: apache/sis

final NumberRange<?> range = range();
if (range != null && !range.isEmpty()) {
  final Number min = range.getMinValue();

代码示例来源:origin: apache/sis

NumberRange<?> range = vec.range();
if (vec.isUnsigned()) {
  assertEquals(message, 2, range.getMinDouble(), STRICT);
range = sub.range();
assertEquals(message, 2, range.getMinDouble(), STRICT);
assertEquals(message, 7, range.getMaxDouble(), STRICT);
range = pick.range();
assertEquals(message, 3, range.getMinDouble(), STRICT);
assertEquals(message, 9, range.getMaxDouble(), STRICT);
range = union.range();
assertEquals(message, 2, range.getMinDouble(), STRICT);
assertEquals(message, 9, range.getMaxDouble(), STRICT);

相关文章