Documentation of 'jsat.linear.ConcatenatedVec' Java class
ConcatenatedVec
jsat.linear

Class ConcatenatedVec

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<IndexValue>


    public class ConcatenatedVec
    extends Vec
    ConcatenatedVec provides a light wrapper around a list of vectors to provide a view of one single vector that's length is the sum of the lengths of the inputs.
    See Also:
    Serialized Form
    • Constructor Detail

      • ConcatenatedVec

        public ConcatenatedVec(java.util.List<Vec> vecs)
        Creates a new Vector that is the concatenation of the given vectors in the given order. The vector created is backed by the ones provided, and any mutation to one is visible in the others.
        Parameters:
        vecs - the list of vectors to concatenate
      • ConcatenatedVec

        public ConcatenatedVec(Vec... vecs)
        Creates a new Vector that is the concatenation of the given vectors in the given order. The vector created is backed by the ones provided, and any mutation to one is visible in the others.
        Parameters:
        vecs - the array of vectors to concatenate
    • Method Detail

      • length

        public int length()
        Description copied from class: Vec
        Returns the length of this vector
        Specified by:
        length in class Vec
        Returns:
        the length of this vector
      • get

        public double get(int index)
        Description copied from class: Vec
        Gets the value stored at a specific index in the vector
        Specified by:
        get in class Vec
        Parameters:
        index - the index to access
        Returns:
        the double value in the vector
      • set

        public void set(int index,
                        double val)
        Description copied from class: Vec
        Sets the value stored at a specified index in the vector
        Specified by:
        set in class Vec
        Parameters:
        index - the index to access
        val - the value to store in the index
      • increment

        public void increment(int index,
                              double val)
        Description copied from class: Vec
        Increments the value stored at a specified index in the vector
        Overrides:
        increment in class Vec
        Parameters:
        index - the index to access
        val - the value to store in the index
      • nnz

        public int nnz()
        Description copied from class: Vec
        Computes the number of non zero values in this vector
        Overrides:
        nnz in class Vec
        Returns:
        the number of non zero values stored
      • mutableAdd

        public void mutableAdd(double c,
                               Vec b)
        Description copied from class: Vec
        Alters this vector such that this = this + c * b

        This method should be overloaded for a serious implementation.
        Overrides:
        mutableAdd in class Vec
        Parameters:
        c - a scalar constant
        b - the vector to add to this
      • getNonZeroIterator

        public java.util.Iterator<IndexValue> getNonZeroIterator(int start)
        Description copied from class: Vec
        Returns an iterator that will go over the non zero values starting from the specified index in the given vector. The iterator does not support the Iterator.remove() method.

        This method should be overloaded for a serious implementation.
        Overrides:
        getNonZeroIterator in class Vec
        Parameters:
        start - the first index (inclusive) to start returning non-zero values from
        Returns:
        an iterator for the non zero index value pairs
      • isSparse

        public boolean isSparse()
        Description copied from class: Vec
        Indicates whether or not this vector is optimized for sparce computation, meaning that most values in the vector are zero - and considered implicit. Only non-zero values are stored.
        Specified by:
        isSparse in class Vec
        Returns:
        true if the vector is sparce, false otherwise.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.