Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
06bfe4b
templated BLAS/LAPACK initials
perazz Apr 25, 2024
a2afe6b
base implementation
perazz Apr 25, 2024
d929077
exclude `xdp`
perazz Apr 25, 2024
5c817c8
`pure` interfaces
perazz Apr 25, 2024
4cef2ac
cleanup names
perazz Apr 25, 2024
7b7c051
submodule
perazz Apr 25, 2024
0be918e
`real` and `complex` tests
perazz Apr 25, 2024
9906c93
add `real` and `complex` examples
perazz Apr 26, 2024
a5d1b8a
add specs
perazz Apr 26, 2024
c1365ff
document interface
perazz Apr 26, 2024
af70ff9
Merge branch 'master' into linalg_solve
perazz Apr 26, 2024
3de6834
fix resolve conflict
perazz Apr 26, 2024
04f126d
Update doc/specs/stdlib_linalg.md
perazz Apr 27, 2024
7ae0510
Update doc/specs/stdlib_linalg.md
perazz Apr 27, 2024
ed135d9
Update doc/specs/stdlib_linalg.md
perazz Apr 30, 2024
e9bf020
Update doc/specs/stdlib_linalg.md
perazz Apr 30, 2024
3265f8f
Update src/stdlib_linalg.fypp
perazz Apr 30, 2024
77fc5bd
Update doc/specs/stdlib_linalg.md
perazz Apr 30, 2024
b04b3d9
Update doc/specs/stdlib_linalg.md
perazz Apr 30, 2024
8d5e682
Update src/stdlib_linalg_solve.fypp
perazz Apr 30, 2024
4458b88
fix test
perazz Apr 30, 2024
bc13246
Merge branch 'linalg_solve' of github.com:perazz/stdlib into linalg_s…
perazz Apr 30, 2024
316c44a
implement `subroutine` interface
perazz Apr 30, 2024
04f1465
Merge branch 'fortran-lang:master' into linalg_solve
perazz May 8, 2024
5e0620c
specify full-rank
perazz May 9, 2024
c9f5f0c
document `solve_lu`
perazz May 9, 2024
e75bb2f
add `solve_lu` test
perazz May 9, 2024
449d0a2
add pivot
perazz May 9, 2024
b288520
cleanup subroutine example; add preallocated pivot
perazz May 9, 2024
7aab844
document `solve_lu` interface
perazz May 9, 2024
da16d0f
Merge branch 'master' into linalg_solve
perazz May 9, 2024
a05809e
typo
perazz May 9, 2024
5832df5
avoid 128-bit random numbers
perazz May 9, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
document solve_lu
  • Loading branch information
perazz committed May 9, 2024
commit c9f5f0c6641d9fee1acb70dcb893b66ebf1c097d
56 changes: 54 additions & 2 deletions doc/specs/stdlib_linalg.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,9 @@ Experimental

This function computes the solution to a linear matrix equation \( A \cdot x = b \), where \( A \) is a square, full-rank, `real` or `complex` matrix.

Result vector or array `x` returns the exact solution to within numerical precision, provided that the matrix is not ill-conditioned. The solver is based on LAPACK's `*GESV` backends.
Result vector or array `x` returns the exact solution to within numerical precision, provided that the matrix is not ill-conditioned.
An error is returned if the matrix is rank-deficient or singular to working precision.
The solver is based on LAPACK's `*GESV` backends.

### Syntax

Expand Down Expand Up @@ -640,7 +642,57 @@ For a full-rank matrix, returns an array value that represents the solution to t

Raises `LINALG_ERROR` if the matrix is singular to working precision.
Raises `LINALG_VALUE_ERROR` if the matrix and rhs vectors have invalid/incompatible sizes.
Exceptions trigger an `error stop`.
If `err` is not present, exceptions trigger an `error stop`.

### Example

```fortran
{!example/linalg/example_solve1.f90!}

{!example/linalg/example_solve2.f90!}
```

## `solve_lu` - Solves a linear matrix equation or a linear system of equations (subroutine interface).

### Status

Experimental

### Description

This subroutine computes the solution to a linear matrix equation \( A \cdot x = b \), where \( A \) is a square, full-rank, `real` or `complex` matrix.

Result vector or array `x` returns the exact solution to within numerical precision, provided that the matrix is not ill-conditioned.
An error is returned if the matrix is rank-deficient or singular to working precision.
The solver is based on LAPACK's `*GESV` backends.

### Syntax

`Pure` interface:

`x = ` [[stdlib_linalg(module):solve_lu(interface)]] `(a, b, x, pivot [, overwrite_a, err])`

### Arguments

Two

`a`: Shall be a rank-2 `real` or `complex` square array containing the coefficient matrix. It is normally an `intent(in)` argument. If `overwrite_a=.true.`, it is an `intent(inout)` argument and is destroyed by the call.

`b`: Shall be a rank-1 or rank-2 array of the same kind as `a`, containing the right-hand-side vector(s). It is an `intent(in)` argument.

`x`: Shall be a rank-1 or rank-2 array of the same kind and size as `b`, that returns the solution(s) to the system. It is an `intent(inout)` argument, and must have the `contiguous` property.

`overwrite_a` (optional): Shall be an input logical flag. if `.true.`, input matrix `a` will be used as temporary storage and overwritten. This avoids internal data allocation. This is an `intent(in)` argument.

`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.

### Return value

For a full-rank matrix, returns an array value that represents the solution to the linear system of equations.

Raises `LINALG_ERROR` if the matrix is singular to working precision.
Raises `LINALG_VALUE_ERROR` if the matrix and rhs vectors have invalid/incompatible sizes.
If `err` is not present, exceptions trigger an `error stop`.

### Example

Expand Down