Class SparseVector

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface no.uib.cipr.matrix.Vector

        Vector.Norm
    • Constructor Summary

      Constructors 
      Constructor Description
      SparseVector​(int size)
      Constructor for SparseVector.
      SparseVector​(int size, int nz)
      Constructor for SparseVector.
      SparseVector​(int size, int[] index, double[] data)
      Constructor for SparseVector
      SparseVector​(int size, int[] index, double[] data, boolean deep)
      Constructor for SparseVector
      SparseVector​(Vector x)
      Constructor for SparseVector, and copies the contents from the supplied vector.
      SparseVector​(Vector x, boolean deep)
      Constructor for SparseVector, and copies the contents from the supplied vector.
    • Constructor Detail

      • 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