# Tridiagonal

``````..  Tridiagonal(dl, d, du)

Construct a tridiagonal matrix from the lower diagonal, diagonal, and upper diagonal, respectively.  The result is of type ``Tridiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`.``````

## Examples

In the Julia programming language, the `Tridiagonal` function is used to construct a tridiagonal matrix from the lower diagonal (`dl`), diagonal (`d`), and upper diagonal (`du`). The resulting object is of type `Tridiagonal` and provides efficient specialized linear solvers. However, it can be converted into a regular matrix using the `full` function.

Here are some examples of using the `Tridiagonal` function:

1. Create a tridiagonal matrix:

``````julia> dl = [1, 2, 3, 4];
julia> d = [5, 6, 7, 8];
julia> du = [9, 10, 11, 12];
julia> tridiag = Tridiagonal(dl, d, du)
4×4 Tridiagonal{Int64,Array{Int64,1}}:
5   9   ⋅   ⋅
1   6  10   ⋅
⋅   2   7  11
⋅   ⋅   3   8``````

This example creates a 4x4 tridiagonal matrix with the provided lower diagonal, diagonal, and upper diagonal arrays.

2. Convert `Tridiagonal` to a full matrix:
``````julia> full_matrix = full(tridiag)
4×4 Array{Int64,2}:
5  9   0   0
1  6  10   0
0  2   7  11
0  0   3   8``````

The `full` function converts the `Tridiagonal` object to a regular matrix.

Please note that the `Tridiagonal` function is commonly used in numerical algorithms involving tridiagonal matrices, such as solving systems of linear equations efficiently.