Skip to content

Commit

Permalink
add pre/post condition notes to l/u factor extraction methods
Browse files Browse the repository at this point in the history
  • Loading branch information
superwhiskers committed Jul 30, 2024
1 parent 5124c56 commit cd0da50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion resolve/LinSolverDirectLUSOL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ namespace ReSolve
return -1;
}

/**
* @pre The input matrix has been factorized
*
* @post A pointer to the L factor of the input matrix is returned in CSC
* format. The linear solver instance owns this data
*/
matrix::Sparse* LinSolverDirectLUSOL::getLFactor()
{
if (!is_factorized_) {
Expand Down Expand Up @@ -271,7 +277,7 @@ namespace ReSolve

// fill the destination arrays. iterates over the stored columns, depermuting the
// column indices to fully compute P*L*Pt while sorting each column's contents using
// insertion sort
// insertion sort (where L is the L factor as stored in LUSOL's workspace)

offset = lena_ - 1;
for (index_type i = 0; i < initial_m; i++) {
Expand Down Expand Up @@ -312,6 +318,12 @@ namespace ReSolve
return L_;
}

/**
* @pre The input matrix has been factorized
*
* @post A pointer to the U factor of the input matrix is returned in CSR
* format. The linear solver instance owns this data
*/
matrix::Sparse* LinSolverDirectLUSOL::getUFactor()
{
if (!is_factorized_) {
Expand Down
2 changes: 1 addition & 1 deletion resolve/LinSolverDirectLUSOL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace ReSolve
int solve(vector_type* rhs, vector_type* x) override;
int solve(vector_type* x) override;

/// @brief Returns the L factor of the solution in CSC format (?)
/// @brief Returns the L factor of the solution in CSC format
matrix::Sparse* getLFactor() override;

/// @brief Returns the U factor of the solution in CSR format
Expand Down

0 comments on commit cd0da50

Please sign in to comment.