com.multicorebsp.util
Class DoubleData

java.lang.Object
  extended by com.multicorebsp.util.MatrixData<DoubleData>
      extended by com.multicorebsp.util.DoubleData
All Implemented Interfaces:
com.multicorebsp.core.CompulsaryCloneable<DoubleData>, java.lang.Cloneable

public class DoubleData
extends MatrixData<DoubleData>

Enables storage of double data types in matrices.


Field Summary
 double[] values
          Stores the real values in double precision.
 
Constructor Summary
  DoubleData()
          Base constructor, all data arrays remain null.
  DoubleData(double[] _R)
          Base constructor, copies data handle by reference(!).
protected DoubleData(DoubleData toCopy)
          Deep copy constructor.
  DoubleData(int length)
          Base constructor, initialises zero data.
 
Method Summary
 void add(int i, int j)
          Adds the values of two nonzeroes and saves it at the last index available.
 void parseAndWrite(int i, java.util.Scanner s)
          Parses an input stream and writes the contect to the i'th index.
 void removeDuplicates(int nr)
          Removes duplicates from the data structure.
 DoubleData safeClone()
           
 DoubleData safeClone(int i, int j)
          Clones only a subset of the data.
 void swap(int i, int j)
          Swaps data elements.
 
Methods inherited from class com.multicorebsp.util.MatrixData
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

public double[] values
Stores the real values in double precision.

Constructor Detail

DoubleData

public DoubleData()
Base constructor, all data arrays remain null.


DoubleData

public DoubleData(int length)
Base constructor, initialises zero data.


DoubleData

public DoubleData(double[] _R)
Base constructor, copies data handle by reference(!).


DoubleData

protected DoubleData(DoubleData toCopy)
Deep copy constructor.

Method Detail

add

public void add(int i,
                int j)
Description copied from class: MatrixData
Adds the values of two nonzeroes and saves it at the last index available.

Specified by:
add in class MatrixData<DoubleData>
Parameters:
i - First nonzero index (will remain unchanged).
j - Second nonzero index (will be replaced by sum).

removeDuplicates

public void removeDuplicates(int nr)
Description copied from class: MatrixData
Removes duplicates from the data structure. Assumed is all duplicates reside at the last part of the data structure.

Specified by:
removeDuplicates in class MatrixData<DoubleData>
Parameters:
nr - Number of elements to remove.

swap

public void swap(int i,
                 int j)
Description copied from class: MatrixData
Swaps data elements.

Specified by:
swap in class MatrixData<DoubleData>
Parameters:
i - First index
j - Second index

safeClone

public DoubleData safeClone()

safeClone

public DoubleData safeClone(int i,
                            int j)
Description copied from class: MatrixData
Clones only a subset of the data.

Specified by:
safeClone in class MatrixData<DoubleData>
Parameters:
i - Lower bound of the index to copy.
j - Upper bound on the index to copy.
Returns:
Partial clone of the current object.

parseAndWrite

public void parseAndWrite(int i,
                          java.util.Scanner s)
Description copied from class: MatrixData
Parses an input stream and writes the contect to the i'th index.

Specified by:
parseAndWrite in class MatrixData<DoubleData>
Parameters:
i - At what index to save input.
s - Where to get the input from.