Skip to content

Commit

Permalink
fix: Add test for precision in options arg of eigs
Browse files Browse the repository at this point in the history
  And also a fix for a small bug that the new test uncovered.
  • Loading branch information
gwhitney committed Oct 5, 2023
1 parent e19e555 commit 6d9f759
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/function/matrix/eigs/complexEigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function createComplexEigs ({ addScalar, subtract, flatten, multiply, mul
}

// return the diagonal row transformation matrix
return diag(Rdiag)
return findVectors ? diag(Rdiag) : null
}

/**
Expand Down
3 changes: 3 additions & 0 deletions test/unit-tests/function/matrix/eigs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ describe('eigs', function () {
// only one.
const poorm = eigs(matrix(difficult), 1e-14)
assert.deepStrictEqual(poorm.values.size(), [3])
// Make sure the precision argument can go in the options object
const stillbad = eigs(difficult, { precision: 1e-14, eigenvectors: false })
assert.deepStrictEqual(stillbad.values, poor.values)
})

it('diagonalizes matrix with bigNumber', function () {
Expand Down

0 comments on commit 6d9f759

Please sign in to comment.