gpalta.multitree
Class MultiOutput

java.lang.Object
  extended by gpalta.core.Output
      extended by gpalta.multitree.MultiOutput
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ClusteringOutput

public class MultiOutput
extends Output

Implements an Output with multiple dimensions

See Also:
Serialized Form

Constructor Summary
MultiOutput(int dim, int nSamples)
           
 
Method Summary
 java.lang.Object clone()
          Must implement clone() so Outputs can be cloned witout knowing the actual subclass.
 double[] getArray(int wDim)
          Get an array representing outputs for each sample
 double[] getArrayCopy(int wDim)
          Get an independent array representing outputs for each sample
 int getDim()
          Get the dimension (number of scalar outputs per sample) of this Output
 void store(int wDim, double[] array)
          Store the content of an array as the corresponding dimension of the output.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiOutput

public MultiOutput(int dim,
                   int nSamples)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: Output
Must implement clone() so Outputs can be cloned witout knowing the actual subclass. Subclasses must override this to make sure that cloned instances are independent.

Overrides:
clone in class Output
Throws:
java.lang.CloneNotSupportedException

getArray

public double[] getArray(int wDim)
Get an array representing outputs for each sample

Parameters:
wDim - Which dimension of the output to get
Returns:
A pointer to the actual array. A pointer is returned instead of a copy for efficiency. Modifying the contents of this array can be problematic if this output object is associated with an individual

getArrayCopy

public double[] getArrayCopy(int wDim)
Get an independent array representing outputs for each sample

Parameters:
wDim - Wich dimension of the output to get
Returns:
A new array with all the outputs

store

public void store(int wDim,
                  double[] array)
Store the content of an array as the corresponding dimension of the output. The contents of the array are copied

Parameters:
wDim -
array -

getDim

public int getDim()
Get the dimension (number of scalar outputs per sample) of this Output

Specified by:
getDim in class Output