Skip to content

Commit

Permalink
adjustments to documentation, corrections to bounds so that they are …
Browse files Browse the repository at this point in the history
…unaltered
  • Loading branch information
superwhiskers committed Jul 23, 2024
1 parent 9ad838e commit 9975bf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
3 changes: 1 addition & 2 deletions resolve/LinSolverDirectLUSOL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ namespace ReSolve
}

rows[insertion_offset] = row;
// why. why
values[insertion_offset] = -a_[offset];

offset--;
Expand Down Expand Up @@ -446,7 +445,7 @@ namespace ReSolve
{
// NOTE: determines a hopefully "good enough" size for a_, indc_, indr_.
// see lena_'s documentation for more details
lena_ = std::max({2 * nelem_, 10 * m_, 10 * n_, 1000000});
lena_ = std::max({2 * nelem_, 10 * m_, 10 * n_, 10000});

a_ = new real_type[lena_];
indc_ = new index_type[lena_];
Expand Down
25 changes: 1 addition & 24 deletions resolve/LinSolverDirectLUSOL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,30 +96,7 @@ namespace ReSolve
/// `indc_`, and `indr_`
///
/// This should be much greater than the number of nonzeroes in the input
/// matrix A, and a (hopefully optimal enough for most cases) formula derived
/// from correspondence with Michael Saunders is
///
/// ```cpp
/// //NOTE: parmlu_[7] specifies the threshold at which LUSOL uses a dense LU
/// // factorization, and is referred to within the source as "dens2"
/// if (nelem_ >= parmlu_[7] * m_ * n_) {
/// // A is dense
/// lena_ = m_ * n_;
/// } else {
/// // A is sparse
/// lena_ = min(5 * nelem_, 2 * m_ * n_);
/// }
/// ```
///
/// The idea behind the approximate bound `5 * nelem_` is that the LU factors are
/// almost always going to be significantly more dense compared to the density of
/// the input matrix A. However, there are cases with smaller (but still sparse)
/// matrices in which `2 * m_ * n_` is likely preferable.
///
/// In the dense case, predicated upon the number of nonzeroes exceeding
/// `parmlu_[7] * m_ * n_` (the threshold at which LUSOL uses a dense LU
/// factorization) is the use of the approximate bound `m_ * n_`, which should
/// always be enough.
/// matrix A, as stated in LUSOL's source code.
///
/// Note that this is not an upper bound on the required space; the size of this
/// buffer may be insufficient, in which case a call to a LUSOL subroutine
Expand Down

0 comments on commit 9975bf4

Please sign in to comment.