Class AbstractVector

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<VectorEntry>, Vector
    Direct Known Subclasses:
    DenseVector, DistVector, SparseVector

    public abstract class AbstractVector
    extends java.lang.Object
    implements Vector, java.io.Serializable
    Partial implementation of Vector. The following methods throw UnsupportedOperationException, and should be overridden by a subclass:
    • get(int)
    • set(int,double)
    • copy

    For the rest of the methods, simple default implementations using a vector iterator has been provided. There are some kernel operations which the simpler operations forward to, and they are:

    • add(double,Vector) and set(double,Vector).
    • scale(double).
    • dot(Vector) and all the norms.

    Finally, a default iterator is provided by this class, which works by calling the get function. A tailored replacement should be used by subclasses.

See Also:
Serialized Form