Skip to content

Commit 867cf4e

Browse files
committed
update: docs to add arguments and missing sentence
1 parent 70796c9 commit 867cf4e

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

doc/specs/stdlib_specialmatrices.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,29 @@ Tridiagonal matrices are available with all supported data types as `tridiagonal
6666

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

69-
- 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):
7070

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

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+
7392
#### Example
7493

7594
```fortran
@@ -98,6 +117,7 @@ $$
98117
\end{bmatrix}.
99118
$$
100119
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.
101121
Interfaces to the most common ones will soon be provided by `stdlib_specialmatrices`.
102122
Symmetric tridiagonal matrices are available with all supported data types as `sym_tridiagonal_<kind>_type`, for example:
103123

@@ -117,10 +137,27 @@ Symmetric tridiagonal matrices are available with all supported data types as `s
117137

118138
`A = ` [[stdlib_specialmatrices(module):sym_tridiagonal(interface)]] `(du, dv)`
119139

120-
- To construct a symmetric tridiagonal matrix of size `n x n` with constant diagonal elements `du` and `dv`:
140+
- To construct a symmetric tridiagonal matrix of size `n x n` with constant diagonal elements `du` (off-diagonal) and `dv` (main diagonal):
121141

122142
`A = ` [[stdlib_specialmatrices(module):sym_tridiagonal(interface)]] `(du, dv, n)`
123143

144+
#### Arguments
145+
146+
##### Constructing from arrays
147+
148+
`A = sym_tridiagonal(du, dv)`
149+
150+
- `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.
151+
- `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.
152+
153+
##### Constructing from constant diagonal values
154+
155+
`A = sym_tridiagonal(du, dv, n)`
156+
157+
- `du`: Shall be a scalar of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
158+
- `dv`: Shall be a scalar of type `real` or `complex` with the same kind as the resulting matrix. It is an `intent(in)` argument.
159+
- `n`: Shall be a positive `integer`. It is an `intent(in)` argument.
160+
124161
#### Example
125162

126163
```fortran

0 commit comments

Comments
 (0)