if(!byRow && resultLength > 500) {
if(data instanceof DoubleVector) {
if(data.length() == 1) {
return new ConstantDoubleVector(data.getElementAsDouble(0), resultLength, attributes);
} else {
return new RepDoubleVector(data, resultLength, 1, attributes);
}
}
}
return allocMatrix(data, nrow, ncol, byRow, dimnames);
}