Class SparseVector

java.lang.Object
no.uib.cipr.matrix.AbstractVector
no.uib.cipr.matrix.sparse.SparseVector
All Implemented Interfaces:
Serializable, Iterable<VectorEntry>, ISparseVector, Vector

public class SparseVector extends AbstractVector implements ISparseVector
Sparse vector
See Also:
  • Constructor Details

    • SparseVector

      public SparseVector(int size, int nz)
      Constructor for SparseVector.
      Parameters:
      size - Size of the vector
      nz - Initial number of non-zeros
    • SparseVector

      public SparseVector(Vector x, boolean deep)
      Constructor for SparseVector, and copies the contents from the supplied vector.
      Parameters:
      x - Vector to copy from
      deep - True if a deep copy is to be made. If the copy is shallow, x must be a SparseVector
    • SparseVector

      public SparseVector(Vector x)
      Constructor for SparseVector, and copies the contents from the supplied vector. Zero initial pre-allocation
      Parameters:
      x - Vector to copy from. A deep copy is made
    • SparseVector

      public SparseVector(int size)
      Constructor for SparseVector. Zero initial pre-allocation
      Parameters:
      size - Size of the vector
    • SparseVector

      public SparseVector(int size, int[] index, double[] data, boolean deep)
      Constructor for SparseVector
      Parameters:
      size - Size of the vector
      index - Indices of the vector
      data - Entries of the vector
      deep - True for a deep copy. For shallow copies, the given indices will be used internally
    • SparseVector

      public SparseVector(int size, int[] index, double[] data)
      Constructor for SparseVector
      Parameters:
      size - Size of the vector
      index - The vector indices are copies from this array
      data - The vector entries are copies from this array
  • Method Details