edu.stanford.nlp.linalg
Class ColtSparseDoubleArray

java.lang.Object
  |
  +--edu.stanford.nlp.linalg.AbstractArray
        |
        +--edu.stanford.nlp.linalg.ColtSparseDoubleArray
All Implemented Interfaces:
Array, Cloneable

public class ColtSparseDoubleArray
extends AbstractArray

An Array Wrapper for cern.colt.matrix.SparseDoubleMatrix1D


Field Summary
 
Fields inherited from class edu.stanford.nlp.linalg.AbstractArray
ci
 
Constructor Summary
ColtSparseDoubleArray(double[] elements)
           
ColtSparseDoubleArray(cern.colt.matrix.DoubleMatrix1D array)
           
ColtSparseDoubleArray(int num_elements)
           
 
Method Summary
 int cardinality()
          overrides AbstractMatrix.cardinality()
 Object clone()
          Returns deep copy of Array
 boolean containsKey(int key)
          Returns true if the array contains index key
 double get(int index)
          Gets double value of element at index i
 Iterator iterator()
          Returns an iterator over the entries in the matrix
 Array newInstance(int size)
          Returns an empty Array of the same dynamic type with given size
 void set(int i, double val)
          Sets value of element at index i to val
 int size()
          size() returns number of elements in Array
 cern.colt.matrix.DoubleMatrix1D toDoubleMatrix1D()
           
 
Methods inherited from class edu.stanford.nlp.linalg.AbstractArray
add, columnIndex, distance, divide, divide, dot, entrySet, multiply, multiply, norm, normalize, scale, setAll, setColumnIndex, toLogSpace, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.nlp.linalg.Array
equals
 

Constructor Detail

ColtSparseDoubleArray

public ColtSparseDoubleArray(int num_elements)

ColtSparseDoubleArray

public ColtSparseDoubleArray(double[] elements)

ColtSparseDoubleArray

public ColtSparseDoubleArray(cern.colt.matrix.DoubleMatrix1D array)
Method Detail

newInstance

public Array newInstance(int size)
Description copied from interface: Array
Returns an empty Array of the same dynamic type with given size


get

public double get(int index)
Description copied from interface: Array
Gets double value of element at index i


set

public void set(int i,
                double val)
Description copied from interface: Array
Sets value of element at index i to val


size

public int size()
size() returns number of elements in Array


toDoubleMatrix1D

public cern.colt.matrix.DoubleMatrix1D toDoubleMatrix1D()

clone

public Object clone()
Description copied from interface: Array
Returns deep copy of Array

Specified by:
clone in interface Array
Specified by:
clone in class AbstractArray

containsKey

public boolean containsKey(int key)
Description copied from interface: Array
Returns true if the array contains index key


cardinality

public int cardinality()
overrides AbstractMatrix.cardinality()

Specified by:
cardinality in interface Array
Overrides:
cardinality in class AbstractArray

iterator

public Iterator iterator()
Returns an iterator over the entries in the matrix



Stanford NLP Group