Skip to content

Commit adcc3b8

Browse files
committed
fix documentation
Signed-off-by: Steven Hahn <[email protected]>
1 parent 25eedad commit adcc3b8

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

resolve/matrix/MatrixHandlerCpu.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ namespace ReSolve
421421
*/
422422
static int updateMatrix(matrix::Sparse* A, index_type* row_data, index_type* col_data, real_type* val_data, index_type nnz)
423423
{
424-
if (A->destroyMatrixData(memory::HOST) == -1)
424+
if (A->destroyMatrixData(memory::HOST) != 0)
425425
{
426426
return 1;
427427
}
@@ -502,7 +502,8 @@ namespace ReSolve
502502
*/
503503
int MatrixHandlerCpu::scaleAddI(matrix::Csr* A, real_type alpha)
504504
{
505-
if (index_type info = scaleConst(A, alpha), info == 1)
505+
index_type info = scaleConst(A, alpha);
506+
if (info == 1)
506507
{
507508
return info;
508509
}

resolve/workspace/LinAlgWorkspaceCpu.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,21 @@ namespace ReSolve
1919
{
2020
}
2121

22+
/**
23+
* @brief Retrieve row sparsity pattern
24+
*
25+
* @return precalculated row pointers
26+
*/
2227
index_type* ScaleAddIBuffer::getRowData()
2328
{
2429
return row_data_.data();
2530
}
2631

32+
/**
33+
* @brief Retrieve column sparsity pattern
34+
*
35+
* @return precalculated column indices
36+
*/
2737
index_type* ScaleAddIBuffer::getColumnData()
2838
{
2939
return col_data_.data();

tests/unit/matrix/MatrixHandlerTests.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,10 @@ namespace ReSolve
705705
* @pre A is a valid, allocated CSR matrix
706706
* @invariant A
707707
* @param[in] A matrix::Csr* pointer to the matrix to be verified
708+
* @param[in] alpha matrix scale factor
708709
* @return bool true if the matrix is valid, false otherwise
709710
*/
710-
bool verifyScaleAddICsrMatrix(matrix::Csr* A, real_type scale)
711+
bool verifyScaleAddICsrMatrix(matrix::Csr* A, real_type alpha)
711712
{
712713
// Check if the matrix is valid
713714
if (A == nullptr)
@@ -727,7 +728,7 @@ namespace ReSolve
727728
index_type* scaled_row_ptr = A->getRowData(memory::HOST);
728729
real_type* scaled_value = A->getValues(memory::HOST);
729730

730-
const real_type expected = 30. * scale + 1.;
731+
const real_type expected = 30. * alpha + 1.;
731732

732733
// Verify values - each element scaled by scale. Diagonal elements should be 1.
733734
for (index_type i = 0; i < n; ++i)

0 commit comments

Comments
 (0)