You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`A = `[[stdlib_specialmatrices(module):tridiagonal(interface)]]`(dl, dv, du [, err])`
68
68
69
69
- To construct a tridiagonal matrix of size `n x n` with scalar diagonal elements `dl` (lower diagonal), `dv` (main diagonal), and `du` (upper diagonal):
70
70
71
-
`A = `[[stdlib_specialmatrices(module):tridiagonal(interface)]]`(dl, dv, du, n)`
71
+
`A = `[[stdlib_specialmatrices(module):tridiagonal(interface)]]`(dl, dv, du, n [, err])`
72
72
73
73
#### Arguments
74
74
75
75
##### Constructing from arrays
76
76
77
-
`A = tridiagonal(dl, dv, du)`
77
+
`A = tridiagonal(dl, dv, du [, err])`
78
78
79
79
-`dl`: Shall be a rank-1 array of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
80
80
-`dv`: Shall be a rank-1 array of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
81
81
-`du`: Shall be a rank-1 array of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
82
+
-`err` (optional): Shall be a `type(linalg_state_type)` variable. It is an `intent(out)` argument.
83
+
If the input arrays are not of compatible sizes, the routine calls `linalg_error_handling`.
84
+
If `err` is present, it is assigned `LINALG_VALUE_ERROR`.
85
+
If `err` is not present, the program terminates via `error stop`.
86
+
In either case, the elements of the resulting matrix `A` are unassigned.
82
87
83
88
##### Constructing from constant diagonal values
84
89
85
-
`A = tridiagonal(dl, dv, du, n)`
90
+
`A = tridiagonal(dl, dv, du, n [, err])`
86
91
87
92
-`dl`: Shall be a scalar of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
88
93
-`dv`: Shall be a scalar of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
89
94
-`du`: Shall be a scalar of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
90
-
`n`: Shall be a positive `integer`. It is an `intent(in)` argument.
95
+
-`n`: Shall be a positive `integer`. It is an `intent(in)` argument.
96
+
-`err` (optional): Shall be a `type(linalg_state_type)` variable. It is an `intent(out)` argument.
97
+
If a non-positive matrix size is provided, the routine calls `linalg_error_handling`.
98
+
If `err` is present, it is assigned `LINALG_VALUE_ERROR`.
99
+
If `err` is not present, the program terminates via `error stop`.
100
+
In either case, the elements of the resulting matrix `A` are unassigned.
91
101
92
102
#### Example
93
103
@@ -135,28 +145,38 @@ Symmetric tridiagonal matrices are available with all supported data types as `s
135
145
136
146
- To construct a symmetric tridiagonal matrix from already allocated arrays `du` (off-diagonal, size `n-1`) and `dv` (main diagonal, size `n`):
0 commit comments