// Start with a zero-sized vector
super(0);
// Get vector information. Use the header if present, else use a safe
// default
VectorInfo info = null;
if (r.hasInfo())
info = r.readVectorInfo();
else
info = new VectorInfo(true, VectorField.Real);
VectorSize size = r.readVectorSize(info);
// Resize the vector to correct size
this.size = size.size();
data = new double[size.size()];
// Check that the vector is in an acceptable format
if (info.isPattern())
throw new UnsupportedOperationException(
"Pattern vectors are not supported");
if (info.isComplex())
throw new UnsupportedOperationException(
"Complex vectors are not supported");
// Read the entries
if (info.isCoordinate()) {
// Read coordinate data
int nz = size.numEntries();
int[] index = new int[nz];
double[] entry = new double[nz];