Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/specs/stdlib_specialmatrices.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ Tridiagonal matrices are available with all supported data types as `tridiagonal

- To construct a tridiagonal matrix from already allocated arrays `dl` (lower diagonal, size `n-1`), `dv` (main diagonal, size `n`) and `du` (upper diagonal, size `n-1`):

`A = ` [[stdlib_specialmatrices(module):tridiagonal(interface)]] `(dl, dv, du)`
`A = ` [[stdlib_specialmatrices(module):tridiagonal(interface)]] `(dl, dv, du [, state])`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am correct, the variable state is callde err in the code. I suggest to keep err to keep the code and the specs aligned.


- To construct a tridiagonal matrix of size `n x n` with constant diagonal elements `dl`, `dv`, and `du`:

`A = ` [[stdlib_specialmatrices(module):tridiagonal(interface)]] `(dl, dv, du, n)`
`A = ` [[stdlib_specialmatrices(module):tridiagonal(interface)]] `(dl, dv, du, n [, state])`

Where `state` is an optional `intent(out)` argument of type `linalg_state_type`. If provided, it will catch and store error states (such as invalid sizes or array shape mismatches) instead of triggering a hard program stop.
Comment thread
loiseaujc marked this conversation as resolved.
Outdated

#### Example

Expand Down Expand Up @@ -207,5 +209,5 @@ The definition of all standard artihmetic operators have been overloaded to be a
`B = alpha` [[stdlib_specialmatrices(module):operator(*)(interface)]] `A`

@note
For addition (`+`) and subtraction (`-`), matrices `A`, `B` and `C` all need to be of the same type and kind. For scalar multiplication (`*`), `A` and `B` need to be of the same type and kind, while `alpha` is either `real` or `complex` (with the same kind again) depending on the type being used.
For addition (`+`) and subtraction (`-`), matrices `A`, `B` and `C` all need to be of the same type, kind, and must have matching dimensions (`n`). For scalar multiplication (`*`), `A` and `B` need to be of the same type and kind, while `alpha` is either `real` or `complex` (with the same kind again) depending on the type being used.
Comment thread
loiseaujc marked this conversation as resolved.
Outdated
@endnote
Loading