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
Bidiagonal(dv::AbstractVector, ev::AbstractVector) =throw(ArgumentError("did you want an upper or lower Bidiagonal? Try again with an additional true (upper) or false (lower) argument."))
25
34
26
35
"""
27
-
Bidiagonal(dv, ev, uplo)
36
+
Bidiagonal(dv, ev, uplo::Char)
28
37
29
38
Constructs an upper (`uplo='U'`) or lower (`uplo='L'`) bidiagonal matrix using the
30
39
given diagonal (`dv`) and off-diagonal (`ev`) vectors. The result is of type `Bidiagonal`
31
40
and provides efficient specialized linear solvers, but may be converted into a regular
32
41
matrix with [`full`](:func:`full`). `ev`'s length must be one less than the length of `dv`.
42
+
43
+
**Example**
44
+
45
+
```julia
46
+
dv = rand(5)
47
+
ev = rand(4)
48
+
Bu = Bidiagonal(dv, ev, 'U') #e is on the first superdiagonal
49
+
Bl = Bidiagonal(dv, ev, 'L') #e is on the first subdiagonal
Copy file name to clipboardExpand all lines: doc/stdlib/linalg.rst
+29-9Lines changed: 29 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -71,24 +71,50 @@ Linear algebra functions in Julia are largely implemented by calling functions f
71
71
72
72
Constructs a matrix with ``V`` as its diagonal.
73
73
74
-
.. function:: Bidiagonal(dv, ev, isupper)
74
+
.. function:: Bidiagonal(dv, ev, isupper::Bool)
75
75
76
76
.. Docstring generated from Julia source
77
77
78
78
Constructs an upper (``isupper=true``\ ) or lower (``isupper=false``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .
79
79
80
-
.. function:: Bidiagonal(dv, ev, uplo)
80
+
**Example**
81
+
82
+
.. code-block:: julia
83
+
84
+
dv = rand(5)
85
+
ev = rand(4)
86
+
Bu = Bidiagonal(dv, ev, true) #e is on the first superdiagonal
87
+
Bl = Bidiagonal(dv, ev, false) #e is on the first subdiagonal
88
+
89
+
.. function:: Bidiagonal(dv, ev, uplo::Char)
81
90
82
91
.. Docstring generated from Julia source
83
92
84
93
Constructs an upper (``uplo='U'``\ ) or lower (``uplo='L'``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .
85
94
86
-
.. function:: Bidiagonal(A, uplo)
95
+
**Example**
96
+
97
+
.. code-block:: julia
98
+
99
+
dv = rand(5)
100
+
ev = rand(4)
101
+
Bu = Bidiagonal(dv, ev, 'U') #e is on the first superdiagonal
102
+
Bl = Bidiagonal(dv, ev, 'L') #e is on the first subdiagonal
103
+
104
+
.. function:: Bidiagonal(A, isupper::Bool)
87
105
88
106
.. Docstring generated from Julia source
89
107
90
108
Construct a ``Bidiagonal`` matrix from the main diagonal of ``A`` and its first super- (if ``isupper=true``\ ) or sub-diagonal (if ``isupper=false``\ ).
91
109
110
+
**Example**
111
+
112
+
.. code-block:: julia
113
+
114
+
A = rand(5,5)
115
+
Bu = Bidiagonal(A, true) #contains the main diagonal and first superdiagonal of A
116
+
Bl = Bidiagonal(A, false) #contains the main diagonal and first subdiagonal of A
117
+
92
118
.. function:: SymTridiagonal(dv, ev)
93
119
94
120
.. Docstring generated from Julia source
@@ -918,12 +944,6 @@ Linear algebra functions in Julia are largely implemented by calling functions f
918
944
919
945
Construct a tridiagonal matrix from the first subdiagonal, diagonal, and first superdiagonal, respectively. The result is of type ``Tridiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . The lengths of ``dl`` and ``du`` must be one less than the length of ``d``\ .
920
946
921
-
.. function:: Bidiagonal(dv, ev, isupper)
922
-
923
-
.. Docstring generated from Julia source
924
-
925
-
Constructs an upper (``isupper=true``\ ) or lower (``isupper=false``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .
0 commit comments