LLNL / libROM

Model reduction library with an emphasis on large scale parallelism and linear subspace methods
https://www.librom.net
Other
201 stars 36 forks source link

BasisGenerator not taking a trivial sample #194

Closed dreamer2368 closed 1 year ago

dreamer2368 commented 1 year ago

BasisGenerator::takeSample does not take a trivial solution as sample, directed by the following if statement:

    // Check that u_in is not non-zero.
    Vector u_vec(u_in, getDim(), true);
    if (u_vec.norm() == 0.0) {
        return false;
    }

My intuition is that a trivial solution should be allowed to become a sample. Is there any special background or logic behind this?

siuwuncheung commented 1 year ago

Theoretically, having the trivial vectors or not do not alter the singular vectors pattern. By omitting these trivial vectors, we at least do not lose anything. It might save some memory as well. But I believe the more important reason for omitting them is that if the incremental SVD is used and the initial vector is zero (which can be the case, if we have zero initial condition), then the algorithm breaks down immediately in the normalization of the initial vector.