de.grogra.gpuflux.scene.experiment
Class Measurement

java.lang.Object
  extended by de.grogra.gpuflux.scene.experiment.Measurement

public class Measurement
extends java.lang.Object

Since:
2011.0824 The Measurement class contains a vector of measurements applying to a single object or group of objects. The dimension and units for the measurements are not defined and depend on the context.
Author:
Dietger van Antwerpen

Field Summary
 double[] data
          Measurement vector data
 
Constructor Summary
Measurement()
          Constructor
Measurement(double[] data)
          Constructor
Measurement(int length)
          Constructor
 
Method Summary
 void add(Measurement m)
          Adds a measurement vector to this measurement.
 java.lang.Object clone()
           
 double integrate()
          Returns the sum of the measurement vector elements.
 boolean isEmpty()
           
 void mad(Measurement m, double scale)
          Scaled a measurement vector and adds it to this measurement.
 void mul(double scale)
          Scales a measurement vector by a single factor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

public double[] data
Measurement vector data

Constructor Detail

Measurement

public Measurement()
Constructor


Measurement

public Measurement(double[] data)
Constructor

Parameters:
data - the measurement vector data

Measurement

public Measurement(int length)
Constructor

Parameters:
length - the dimension of the measurement vector
Method Detail

add

public void add(Measurement m)
Adds a measurement vector to this measurement. The measurements are assumed to have the same dimensions and units.

Parameters:
m - measurement to add

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

integrate

public double integrate()
Returns the sum of the measurement vector elements. All dimensions are assumed to be of the same unit.

Returns:
sum of all vector elements

isEmpty

public boolean isEmpty()
Returns:
true if this measurement contains no data

mad

public void mad(Measurement m,
                double scale)
Scaled a measurement vector and adds it to this measurement. The measurements are assumed to have the same dimensions and units.

Parameters:
m - measurement to scall and add
scale - scale factor

mul

public void mul(double scale)
Scales a measurement vector by a single factor.

Parameters:
scale - the scaling factor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object