in src/main/java/org/apache/datasketches/vector/decomposition/MatrixOpsImplOjAlgo.java [61:91]
void svd(final Matrix A, final boolean computeVectors) {
assert A.getMatrixType() == MatrixType.OJALGO;
if (A.getNumRows() != n_) {
throw new IllegalArgumentException("A.numRows() != n_");
} else if (A.getNumColumns() != d_) {
throw new IllegalArgumentException("A.numColumns() != d_");
}
if (computeVectors && (Vt_ == null)) {
Vt_ = Primitive64Store.FACTORY.make(n_, d_);
S_ = SparseStore.makePrimitive(sv_.length, sv_.length);
}
switch (algo_) {
case FULL:
computeFullSVD((Primitive64Store) A.getRawObject(), computeVectors);
return;
case SISVD:
computeSISVD((Primitive64Store) A.getRawObject(), computeVectors);
return;
case SYM:
computeSymmEigSVD((Primitive64Store) A.getRawObject(), computeVectors);
return;
default:
throw new RuntimeException("SVDAlgo type not (yet?) supported: " + algo_.toString());
}
}