private int variables;
private int observations;
public VariableSet(AtomicVector vector) {
this.vector = vector;
Vector dim = (Vector) vector.getAttribute(Symbols.DIM);
if(dim == Null.INSTANCE) {
this.observations = vector.length();
this.variables = 1;
} else {
if(dim.length() != 2) {
throw new EvalException("must be vector or matrix, not higher-order array");
}
this.observations = dim.getElementAsInt(0);
this.variables = dim.getElementAsInt(1);
}
}