本文整理了Java中org.apache.sis.math.Vector.get()
方法的一些代码示例,展示了Vector.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.get()
方法的具体详情如下:
包路径:org.apache.sis.math.Vector
类名称:Vector
方法名:get
[英]Returns an estimation of the number of bits used by each value in this vector. This is an estimation only and should be used only as a hint.
[中]返回此向量中每个值使用的位数的估计值。这只是一个估计,只能作为提示使用。
代码示例来源:origin: org.apache.sis.core/sis-utility
@Override public Number get (int i) {return Vector.this.get (indices[i]);}
代码示例来源:origin: org.apache.sis.core/sis-utility
final Number inc = increment(tolerance);
if (inc != null) {
return createSequence(getElementType(), get(0), inc, length);
代码示例来源:origin: apache/sis
final Number inc = increment(tolerance);
if (inc != null) {
return createSequence(getElementType(), get(0), inc, length);
代码示例来源:origin: apache/sis
final int pz = Math.max(0, Math.min(i, (int) Math.rint(-first / inc))); // Presumed index of value zero.
if (doubleValue(pz) == 0) {
final Number value = (pz == i) ? get(pz-1) : get(pz+1); // Value adjacent to zero.
if (!(value instanceof Float)) {
代码示例来源:origin: apache/sis
@Override public Number get (int i) {return Vector.this.get (indices[i]);}
代码示例来源:origin: apache/sis
if (size != 0 && get(0) instanceof Double) {
return createForDecimal((float[]) array);
代码示例来源:origin: org.apache.sis.core/sis-utility
/**
* Returns the value at the given index.
*
* @throws ArrayIndexOutOfBoundsException if the given index is out of bounds.
*/
@Override
public Number get(int index) {
final Vector v;
if (index < limit) {
v = first;
} else {
v = second;
index -= limit;
}
return v.get(index);
}
代码示例来源:origin: apache/sis
assertEquals("Length of V3 should be the sum of V1 and V2 length.", 60, v3.size());
assertEquals("Component type should be the common parent of V1 and V2.", Number.class, v3.getElementType());
assertEquals("Sample from V1.", Float .valueOf(200), v3.get(20));
assertEquals("Sample from V2.", Integer.valueOf(500), v3.get(50));
for (int i=0; i<60; i++) {
assertEquals(i*10, v3.floatValue(i), 0f);
代码示例来源:origin: apache/sis
/**
* Returns the value at the given index.
*
* @throws ArrayIndexOutOfBoundsException if the given index is out of bounds.
*/
@Override
public Number get(int index) {
final Vector v;
if (index < limit) {
v = first;
} else {
v = second;
index -= limit;
}
return v.get(index);
}
代码示例来源:origin: apache/sis
/**
* Returns {@code true} if this vector in the given range is equals to the specified vector.
* NaN values are considered equal to all other NaN values, and -0.0 is different than +0.0.
*
* @param lower index of the first value to compare in this vector, inclusive.
* @param upper index after the last value to compare in this vector.
* @param other the other vector to compare values with this vector. May be {@code this}.
* @param otherOffset index of the first element to compare in the other vector.
* @return whether values over the specified range of the two vectors are equal.
*/
boolean equals(int lower, final int upper, final Vector other, int otherOffset) {
while (lower < upper) {
if (!get(lower++).equals(other.get(otherOffset++))) {
return false;
}
}
return true;
}
}
代码示例来源:origin: apache/sis
/**
* Returns the index of the first value which is equal (if {@code equality} is true)
* or different (if {@code equality} is false) to the value at the {@code toSearch} index.
* Subclasses should override if they can provide a more efficient implementation.
*
* @param toSearch index of the value to search.
* @param index index of the first value where to start the search.
* @param equality whether we search the first equal value, or the first different value.
* @return index of the value found, or the vector size if the value has not been found.
*/
int indexOf(final int toSearch, int index, final boolean equality) {
final Number first = get(toSearch);
final int size = size();
while (index < size && first.equals(get(index)) != equality) index++;
return index;
}
代码示例来源:origin: apache/sis
@Override public final Number get (int i) {return base.get (toBase(i));}
代码示例来源:origin: apache/sis
@Override public Number get (int index) {return Vector.this.get (toBacking(index));}
代码示例来源:origin: apache/sis
/**
* Returns a hash code for the values in this vector. The hash code is computed as if this vector was converted
* to an array of {@link Number}s, then the {@link Arrays#hashCode(Object[])} method invoked for that array.
*
* @return a hash code value for the values in this vector.
*
* @since 1.0
*/
@Override
public int hashCode() {
int hash = 0;
final int size = size();
for (int i=0; i<size; i++) {
hash = PRIME * hash + get(i).hashCode();
}
return hash;
}
代码示例来源:origin: org.apache.sis.core/sis-utility
@Override public Number get (int index) {return Vector.this.get (toBacking(index));}
代码示例来源:origin: apache/sis
/**
* Returns the ranges of sample values together with the conversion from samples to real values.
*/
@Override
@SuppressWarnings("ReturnOfCollectionOrArrayField")
public List<SampleDimension> getSampleDimensions() throws DataStoreContentException {
if (sampleDimensions == null) {
final SampleDimension[] dimensions = new SampleDimension[samplesPerPixel];
final SampleDimension.Builder builder = new SampleDimension.Builder();
final InternationalString name = Vocabulary.formatInternational(Vocabulary.Keys.Value);
for (int band = 0; band < samplesPerPixel;) {
builder.addQualitative(name, minValues.get(Math.min(band, minValues.size()-1)),
maxValues.get(Math.min(band, maxValues.size()-1)));
dimensions[band] = builder.setName(++band).build();
builder.clear();
}
sampleDimensions = UnmodifiableArrayList.wrap(dimensions);
}
return sampleDimensions; // Safe because unmodifiable.
}
代码示例来源:origin: apache/sis
case 1: value = keyDirectory.get(valueOffset); break;
default: final int[] array = new int[count];
for (int j=0; j<count; j++) {
case 1: value = numericParameters.get(valueOffset); break;
default: final double[] array = new double[count];
for (int j=0; j<count; j++) {
内容来源于网络,如有侵权,请联系作者删除!