File tree Expand file tree Collapse file tree 2 files changed +51
-1
lines changed Expand file tree Collapse file tree 2 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -887,7 +887,7 @@ This interface is equivalent to the `pure` version of determinant [[stdlib_linal
887
887
888
888
### Return value
889
889
890
- Returns a real scalar value that represents the determinnt of the matrix.
890
+ Returns a real scalar value that represents the determinant of the matrix.
891
891
892
892
Raises ` LINALG_ERROR ` if the matrix is singular.
893
893
Raises ` LINALG_VALUE_ERROR ` if the matrix is non-square.
@@ -898,3 +898,37 @@ Exceptions trigger an `error stop`.
898
898
``` fortran
899
899
{!example/linalg/example_determinant2.f90!}
900
900
```
901
+
902
+ ## ` .inv. ` - Inverse operator of a square matrix
903
+
904
+ ### Status
905
+
906
+ Experimental
907
+
908
+ ### Description
909
+
910
+ This operator returns the inverse of a ` real ` or ` complex ` square matrix \( A \) .
911
+ The inverse \( A^{-1} \) is defined such that \( A \cdot A^{-1} = A^{-1} \cdot A = I_n \) .
912
+
913
+ This interface is equivalent to the function version of [[ stdlib_linalg(module): inv (interface)]] .
914
+
915
+ ### Syntax
916
+
917
+ ` b = ` [[ stdlib_linalg(module): operator (.inv.)(interface)]] ` (a) `
918
+
919
+ ### Arguments
920
+
921
+ ` a ` : Shall be a rank-2 square array of any ` real ` or ` complex ` kinds. It is an ` intent(in) ` argument.
922
+
923
+ ### Return value
924
+
925
+ Returns a rank-2 square array with the same type, kind and rank as ` a ` , that contains the inverse of ` a ` .
926
+
927
+ If the matrix is singular or non-square, the operator returns zeros.
928
+
929
+ ### Example
930
+
931
+ ``` fortran
932
+ {!example/linalg/example_inverse1.f90!}
933
+ ```
934
+
Original file line number Diff line number Diff line change @@ -589,6 +589,22 @@ module stdlib_linalg
589
589
590
590
! Operator interface
591
591
interface operator(.inv.)
592
+ !! version: experimental
593
+ !!
594
+ !! Inverse operator of a square matrix
595
+ !! ([Specification](../page/specs/stdlib_linalg.html#inv-inverse-operator-of-a-square-matrix))
596
+ !!
597
+ !!### Summary
598
+ !! Operator interface for computing the inverse of a square `real` or `complex` matrix.
599
+ !!
600
+ !!### Description
601
+ !!
602
+ !! This operator interface provides a convenient way to compute the inverse of a matrix.
603
+ !! Supported data types include `real` and `complex`.
604
+ !!
605
+ !!@note The provided functions are intended for square matrices.
606
+ !!@note BLAS/LAPACK backends do not currently support extended precision (``xdp``).
607
+ !!
592
608
#:for rk,rt,ri in RC_KINDS_TYPES
593
609
#:if rk!="xdp"
594
610
module function stdlib_linalg_inverse_${ri}$_operator(a) result(inva)
You can’t perform that action at this time.
0 commit comments