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
- To construct a tridiagonal matrix of size `n x n` with constant diagonal elements `dl`, `dv`, and `du`:
69
+
- To construct a tridiagonal matrix of size `n x n` with constant diagonal elements `dl` (lower diagonal), `dv` (main diagonal), and `du` (upper diagonal):
70
70
71
71
`A = `[[stdlib_specialmatrices(module):tridiagonal(interface)]]`(dl, dv, du, n)`
72
72
73
+
#### Arguments
74
+
75
+
##### Constructing from arrays
76
+
77
+
`A = tridiagonal(dl, dv, du)`
78
+
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
+
-`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
+
-`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
+
83
+
##### Constructing from constant diagonal values
84
+
85
+
`A = tridiagonal(dl, dv, du, n)`
86
+
87
+
-`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
+
-`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
+
-`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.
91
+
73
92
#### Example
74
93
75
94
```fortran
@@ -98,6 +117,7 @@ $$
98
117
\end{bmatrix}.
99
118
$$
100
119
Hence, only one vector of size `n` and one vector of size `n-1` need to be stored to fully represent the matrix.
120
+
This particular structure also lends itself to specialized implementations for many linear algebra tasks.
101
121
Interfaces to the most common ones will soon be provided by `stdlib_specialmatrices`.
102
122
Symmetric tridiagonal matrices are available with all supported data types as `sym_tridiagonal_<kind>_type`, for example:
103
123
@@ -117,10 +137,27 @@ Symmetric tridiagonal matrices are available with all supported data types as `s
0 commit comments