com.multicorebsp.util
Class VectorCollection<DataType extends MatrixData<DataType>>

java.lang.Object
  extended by com.multicorebsp.util.Matrix<DataType>
      extended by com.multicorebsp.util.VectorCollection<DataType>
All Implemented Interfaces:
com.multicorebsp.core.CompulsaryCloneable<VectorCollection<DataType>>, java.lang.Cloneable

public class VectorCollection<DataType extends MatrixData<DataType>>
extends Matrix<DataType>
implements com.multicorebsp.core.CompulsaryCloneable<VectorCollection<DataType>>

Represents a `matrix' with variably-sized rows.


Field Summary
 int[] n
          Length of each vector.
 int[][] p
          Global processor ID data.
 
Fields inherited from class com.multicorebsp.util.Matrix
m, nz
 
Constructor Summary
  VectorCollection(int m, boolean global_view)
          Base constructor.
protected VectorCollection(VectorCollection<DataType> toCopy)
          Deep copy constructor.
 
Method Summary
 void addVector(DataType data, int i, int n)
          Adds a new vector.
 java.lang.Object clone()
           
 DataType getVector(int index)
          Data accessor.
 void removeAndAddDuplicates()
          Removes and combines any double entries.
 VectorCollection<DataType> safeClone()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

n

public int[] n
Length of each vector.


p

public int[][] p
Global processor ID data.

Constructor Detail

VectorCollection

public VectorCollection(int m,
                        boolean global_view)
Base constructor.


VectorCollection

protected VectorCollection(VectorCollection<DataType> toCopy)
Deep copy constructor.

Method Detail

getVector

public DataType getVector(int index)
Data accessor.

Parameters:
index - Which vector to return.
Returns:
The requested vector.

addVector

public void addVector(DataType data,
                      int i,
                      int n)
Adds a new vector.

Parameters:
data - Where to store the new data
i - The vector index.
n - Length of this vector.

clone

public java.lang.Object clone()
Specified by:
clone in interface com.multicorebsp.core.CompulsaryCloneable<VectorCollection<DataType extends MatrixData<DataType>>>
Overrides:
clone in class java.lang.Object

safeClone

public VectorCollection<DataType> safeClone()
Specified by:
safeClone in interface com.multicorebsp.core.CompulsaryCloneable<VectorCollection<DataType extends MatrixData<DataType>>>

removeAndAddDuplicates

public void removeAndAddDuplicates()
Description copied from class: Matrix
Removes and combines any double entries.

Specified by:
removeAndAddDuplicates in class Matrix<DataType extends MatrixData<DataType>>