org.lcsim.hmatrix
Class HMatrixBuilder

java.lang.Object
  extended byorg.lcsim.hmatrix.HMatrixBuilder

public class HMatrixBuilder
extends java.lang.Object

A class to construct an HMatrix.

Author:
Norman A. Graf
See Also:
HMatrix

Constructor Summary
HMatrixBuilder(int n, int key)
          Construct an n x n HMatrixBuilder.
 
Method Summary
 void accumulate(double[] dat)
          Add the measurement vector to the accumulated HMatrix
 HMatrix read(java.lang.String filename)
          Reads the HMatrix from an ASCII file
 HMatrix readSerialized(java.lang.String filename)
          Reads the HMatrix from a Serialized file
 java.lang.String toString()
          Output Stream
 void validate()
          Validates the HMatrix by performing the averages
 void write(java.lang.String filename, java.lang.String comment)
          Writes out the HMatrix to an ASCII file
 void writeSerialized(java.lang.String filename)
          Writes the HMatrix to a Serialized file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HMatrixBuilder

public HMatrixBuilder(int n,
                      int key)
Construct an n x n HMatrixBuilder. Leaves HMatrix in an invalid state. One must either accumulate entries to build up the HMatrix or read in the HMatrix values from a file.

Parameters:
n - The dimension of the measurement space.
key - The key by which to index this HMatrix.
Method Detail

accumulate

public void accumulate(double[] dat)
Add the measurement vector to the accumulated HMatrix

Parameters:
dat - The array of measurements.

validate

public void validate()
Validates the HMatrix by performing the averages


toString

public java.lang.String toString()
Output Stream

Returns:
String representation of the object

writeSerialized

public void writeSerialized(java.lang.String filename)
Writes the HMatrix to a Serialized file

Parameters:
filename - The file to which to write.

readSerialized

public HMatrix readSerialized(java.lang.String filename)
Reads the HMatrix from a Serialized file

Parameters:
filename - The Serialized file from which to read.
Returns:
The HMatrix

read

public HMatrix read(java.lang.String filename)
Reads the HMatrix from an ASCII file

Parameters:
filename - The ASCII file from which to read.
Returns:
The HMatrix

write

public void write(java.lang.String filename,
                  java.lang.String comment)
Writes out the HMatrix to an ASCII file

Parameters:
filename - The file to which to write.
comment - A comment for the header.