in src/main/java/org/apache/datasketches/vector/decomposition/FrequentDirections.java [155:181]
private FrequentDirections(final int k, final int d, final Matrix B, final MatrixType type) {
if (k < 1) {
throw new IllegalArgumentException("Number of projected dimensions must be at least 1");
}
if (d < 1) {
throw new IllegalArgumentException("Number of feature dimensions must be at least 1");
}
k_ = k;
l_ = 2 * k;
d_ = d;
if (d_ < l_) {
throw new IllegalArgumentException("Running with d < 2k not yet supported");
}
svAdjustment_ = 0.0;
nextZeroRow_ = 0;
n_ = 0;
if (B == null) {
B_ = new MatrixBuilder().setType(type).build(l_, d_);
} else {
B_ = B;
}
}