File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 30
30
Moler,
31
31
Neumann,
32
32
Oscillate,
33
+ Parter,
33
34
Triw
34
35
35
36
# include all matrices
@@ -60,6 +61,7 @@ include("minij.jl")
60
61
include (" moler.jl" )
61
62
include (" neumann.jl" )
62
63
include (" oscillate.jl" )
64
+ include (" parter.jl" )
63
65
include (" triw.jl" )
64
66
65
67
# matrix groups
@@ -95,6 +97,7 @@ MATRIX_GROUPS[GROUP_BUILTIN] = Set([
95
97
Moler,
96
98
Neumann,
97
99
Oscillate,
100
+ Parter,
98
101
Triw,
99
102
])
100
103
MATRIX_GROUPS[GROUP_USER] = Set ([])
Original file line number Diff line number Diff line change
1
+ """
2
+ Parter Matrix
3
+ =============
4
+ The Parter matrix is a Toeplitz and Cauchy matrix
5
+ with singular values near `π`.
6
+
7
+ *Input options:*
8
+
9
+ + dim: the dimension of the matrix.
10
+
11
+ *References:*
12
+
13
+ The MathWorks Newsletter, Volume 1, Issue 1,
14
+ March 1986, page 2. S. V. Parter, On the distribution of the
15
+ singular values of Toeplitz matrices, Linear Algebra and
16
+ Appl., 80 (1986), pp. 115-130.
17
+ """
18
+ struct Parter{T<: Number } <: AbstractMatrix{T}
19
+ n:: Integer
20
+
21
+ function Parter {T} (n:: Integer ) where {T<: Number }
22
+ n >= 0 || throw (ArgumentError (" $n < 0" ))
23
+ return new {T} (n)
24
+ end
25
+ end
26
+
27
+ # constructors
28
+ Parter (n:: Integer ) = Parter {Int} (n)
29
+ Parter {T} (n:: Integer ) where {T<: Integer } = Parter {Rational{T}} (n)
30
+
31
+ # metadata
32
+ @properties Parter [:eigen ]
33
+
34
+ # properties
35
+ size (A:: Parter ) = (A. n, A. n)
36
+
37
+ # functions
38
+ @inline Base. @propagate_inbounds function getindex (A:: Parter{T} , i:: Integer , j:: Integer ) where {T}
39
+ @boundscheck checkbounds (A, i, j)
40
+ return one (T) / T (i - j + 0.5 )
41
+ end
You can’t perform that action at this time.
0 commit comments