SparseFieldVector implements FieldVector<T>, Serializable { public void setEntry(int index, T value) throws NullArgumentException, OutOfRangeException { MathUtils.checkNotNull(value); checkIndex(index); entries.put(index, value); } SparseFieldVector(Field<T> field);  SparseFieldVector(Field<T> field, int dimension); protected  SparseFieldVector(SparseFieldVector<T> v, int resize);  SparseFieldVector(Field<T> field, int dimension, int expectedSize);  SparseFieldVector(Field<T> field, T[] values);  SparseFieldVector(SparseFieldVector<T> v); FieldVector<T> add(SparseFieldVector<T> v); FieldVector<T> append(SparseFieldVector<T> v); FieldVector<T> append(FieldVector<T> v); FieldVector<T> append(T d); FieldVector<T> copy(); T dotProduct(FieldVector<T> v); FieldVector<T> ebeDivide(FieldVector<T> v); FieldVector<T> ebeMultiply(FieldVector<T> v); @Deprecated T[] getData(); int getDimension(); T getEntry(int index); Field<T> getField(); FieldVector<T> getSubVector(int index, int n); FieldVector<T> mapAdd(T d); FieldVector<T> mapAddToSelf(T d); FieldVector<T> mapDivide(T d); FieldVector<T> mapDivideToSelf(T d); FieldVector<T> mapInv(); FieldVector<T> mapInvToSelf(); FieldVector<T> mapMultiply(T d); FieldVector<T> mapMultiplyToSelf(T d); FieldVector<T> mapSubtract(T d); FieldVector<T> mapSubtractToSelf(T d); FieldMatrix<T> outerProduct(SparseFieldVector<T> v); FieldMatrix<T> outerProduct(FieldVector<T> v); FieldVector<T> projection(FieldVector<T> v); void set(T value); void setEntry(int index, T value); void setSubVector(int index, FieldVector<T> v); SparseFieldVector<T> subtract(SparseFieldVector<T> v); FieldVector<T> subtract(FieldVector<T> v); T[] toArray(); FieldVector<T> add(FieldVector<T> v); T walkInDefaultOrder(final FieldVectorPreservingVisitor<T> visitor); T walkInDefaultOrder(final FieldVectorPreservingVisitor<T> visitor,
                                final int start, final int end); T walkInOptimizedOrder(final FieldVectorPreservingVisitor<T> visitor); T walkInOptimizedOrder(final FieldVectorPreservingVisitor<T> visitor,
                                  final int start, final int end); T walkInDefaultOrder(final FieldVectorChangingVisitor<T> visitor); T walkInDefaultOrder(final FieldVectorChangingVisitor<T> visitor,
                                final int start, final int end); T walkInOptimizedOrder(final FieldVectorChangingVisitor<T> visitor); T walkInOptimizedOrder(final FieldVectorChangingVisitor<T> visitor,
                                  final int start, final int end); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testPredicates() { SparseFieldVector<Fraction> v = new SparseFieldVector<Fraction>(field, new Fraction[] { new Fraction(0), new Fraction(1), new Fraction(2) }); v.setEntry(0, field.getZero()); Assert.assertEquals(v, new SparseFieldVector<Fraction>(field, new Fraction[] { new Fraction(0), new Fraction(1), new Fraction(2) })); Assert.assertNotSame(v, new SparseFieldVector<Fraction>(field, new Fraction[] { new Fraction(0), new Fraction(1), new Fraction(2), new Fraction(3) })); }