An interface for utilities that support incrementally building matrices on
disk, one column at a time. Instances of these class are designed to
abstract away the format-specific details of writing the matrix to disk.
Columns may be added via the
addColumn method until the matrix has the desired data. The underlying
matrix structure will expand to match the dimensions of the input data.
Great care should be taken when using
SparseArray and
DoubleVector instances to ensure that the values returned by their
respective
length methods are fixed to the actual data structure
size, rather than the a possible maximum size of the struture. This is
necessary to determine this matrix's dimension; passing in an array or vector
with a maximum size bound will greatly distort the matrix's size.
After all the data has been added, the
finish method should be
invoked. Instances should use this as a signal to finish any last remaining
writes or perform any necessary post processing for the matrix. Once this
method returns the
getMatrixFile method will allow access to the
finished data in its correct format.
Implementations may cache all, part, or none of the data prior to
finishing the matrix data. However, all implementations are expected to be
have a low memory overhead, especially when building large matrices.
All implementations are expected to be thread-safe.