From 0b4b073860f35bbdeff1468078cc10fa159ba530 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 12 Sep 2024 12:30:21 +0000 Subject: [PATCH] build based on 2e61535 --- dev/.documenter-siteinfo.json | 2 +- dev/index.html | 2 +- dev/manual/1.getting-started/index.html | 146 +++++++++---------- dev/manual/2.performance/index.html | 2 +- dev/references/1.types/index.html | 2 +- dev/references/2.interfaces/index.html | 10 +- dev/references/3.properties/index.html | 2 +- dev/references/4.builtin-matrices/index.html | 2 +- dev/search_index.js | 2 +- 9 files changed, 85 insertions(+), 85 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 0c958cb..e815fa2 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-09T08:36:47","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-12T12:30:18","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index eb231a0..fec6959 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · TypedMatrices.jl

TypedMatrices.jl Documentation

Welcome to the documentation for TypedMatrices.jl.

An extensible Julia matrix collection utilizing type system to enhance performance.

Check Getting Started for a quick start.

Features

  • Types of matercies, can be used in algorithm tests or other.
  • Optimized matrix operations for these types
  • Properties (tags) for matrices.
  • Grouping matercies and allow user to define their own types.
  • Filtering matrices by properties or groups.
+Home · TypedMatrices.jl

TypedMatrices.jl Documentation

Welcome to the documentation for TypedMatrices.jl.

An extensible Julia matrix collection utilizing type system to enhance performance.

Check Getting Started for a quick start.

Features

  • Types of matercies, can be used in algorithm tests or other.
  • Optimized matrix operations for these types
  • Properties (tags) for matrices.
  • Grouping matercies and allow user to define their own types.
  • Filtering matrices by properties or groups.
diff --git a/dev/manual/1.getting-started/index.html b/dev/manual/1.getting-started/index.html index ac185b8..40b3f94 100644 --- a/dev/manual/1.getting-started/index.html +++ b/dev/manual/1.getting-started/index.html @@ -1,25 +1,25 @@ Getting Started · TypedMatrices.jl

Getting Started

Installation

TypedMatrices.jl is a registered package in the Julia package registry. Use Julia's package manager to install it:

pkg> add TypedMatrices

Setup

Use the package:

julia> using TypedMatrices

You can list all matrices available with list_matrices:

julia> list_matrices()63-element Vector{Type{<:AbstractMatrix}}:
- Ipjfact
- Krylov
- Wathen
- Chow
- Cauchy
- Neumann
- Comparison
- RIS
- Dramadah
- Binomial
+ Forsythe
+ Hadamard
+ KMS
+ Frank
+ Hilbert
+ Involutory
+ Magic
+ Minij
+ Oscillate
+ Companion
  ⋮
- Lauchli
+ Wilkinson
+ Clement
  Invhess
- Randcorr
- Smoke
- Oscillate
- Hilbert
- Rando
- Parter
- Poisson

Creating Matrices

Each type of matrix has its own type and constructors. For example, to create a 5x5 Hilbert matrix:

julia> h = Hilbert(5)5×5 Hilbert{Rational{Int64}}:
+ Leslie
+ Moler
+ Krylov
+ Lesp
+ Riemann
+ Rosser

Creating Matrices

Each type of matrix has its own type and constructors. For example, to create a 5x5 Hilbert matrix:

julia> h = Hilbert(5)5×5 Hilbert{Rational{Int64}}:
   1    1//2  1//3  1//4  1//5
  1//2  1//3  1//4  1//5  1//6
  1//3  1//4  1//5  1//6  1//7
@@ -40,73 +40,73 @@
  Property(:illcond)
  Property(:posdef)
  Property(:totpos)

To view all available properties, use list_properties:

julia> list_properties()37-element Vector{Property}:
- Property(:orthogonal)
- Property(:nilpotent)
- Property(:tridiagonal)
- Property(:normal)
+ Property(:infdiv)
+ Property(:random)
+ Property(:totpos)
  Property(:singval)
  Property(:integer)
- Property(:circulant)
- Property(:indefinite)
  Property(:graph)
+ Property(:orthogonal)
  Property(:sparse)
+ Property(:tridiagonal)
+ Property(:normal)
  ⋮
- Property(:rankdef)
- Property(:complex)
- Property(:inverse)
  Property(:illcond)
- Property(:correlation)
- Property(:binary)
+ Property(:eigen)
  Property(:totnonneg)
+ Property(:correlation)
  Property(:symmetric)
- Property(:unimodular)

Grouping

This package has a grouping feature to group matrices. All builtin matrices are in the builtin group, we also create a user group for user-defined matrices. You can list all groups with:

julia> list_groups()2-element Vector{Group}:
- Group(:user)
- Group(:builtin)

To add a matrix to groups and enable it to be listed by list_matrices, use add_to_groups:

julia> add_to_groups(Matrix, :user, :test)
julia> list_matrices(Group(:user))1-element Vector{Type{<:AbstractMatrix}}: + Property(:complex) + Property(:inverse) + Property(:hessenberg) + Property(:diagdom)

Grouping

This package has a grouping feature to group matrices. All builtin matrices are in the builtin group, we also create a user group for user-defined matrices. You can list all groups with:

julia> list_groups()2-element Vector{Group}:
+ Group(:builtin)
+ Group(:user)

To add a matrix to groups and enable it to be listed by list_matrices, use add_to_groups:

julia> add_to_groups(Matrix, :user, :test)
julia> list_matrices(Group(:user))1-element Vector{Type{<:AbstractMatrix}}: Matrix (alias for Array{T, 2} where T)

We can also add builtin matrices to our own groups:

julia> add_to_groups(Hilbert, :test)
julia> list_matrices(Group(:test))2-element Vector{Type{<:AbstractMatrix}}: - Matrix (alias for Array{T, 2} where T) - Hilbert

To remove a matrix from a group or all groups, use remove_from_group or remove_from_all_groups. The empty group will automatically be removed:

julia> remove_from_group(Hilbert, :test)
julia> remove_from_all_groups(Matrix)
julia> list_groups()2-element Vector{Group}: - Group(:user) - Group(:builtin)

Finding Matrices

list_matrices is very powerful to list matrices, and filter by groups and properties. All arguments are "and" relationship, i.e. listed matrices must satisfy all conditions.

For example, to list all matrices in the builtin group, and all matrices with symmetric property:

julia> list_matrices(Group(:builtin))63-element Vector{Type{<:AbstractMatrix}}:
- Ipjfact
- Krylov
- Wathen
- Chow
- Cauchy
- Neumann
- Comparison
- RIS
- Dramadah
- Binomial
+ Hilbert
+ Matrix (alias for Array{T, 2} where T)

To remove a matrix from a group or all groups, use remove_from_group or remove_from_all_groups. The empty group will automatically be removed:

julia> remove_from_group(Hilbert, :test)
julia> remove_from_all_groups(Matrix)
julia> list_groups()2-element Vector{Group}: + Group(:builtin) + Group(:user)

Finding Matrices

list_matrices is very powerful to list matrices, and filter by groups and properties. All arguments are "and" relationship, i.e. listed matrices must satisfy all conditions.

For example, to list all matrices in the builtin group, and all matrices with symmetric property:

julia> list_matrices(Group(:builtin))63-element Vector{Type{<:AbstractMatrix}}:
+ Forsythe
+ Hadamard
+ KMS
+ Frank
+ Hilbert
+ Involutory
+ Magic
+ Minij
+ Oscillate
+ Companion
  ⋮
- Lauchli
+ Wilkinson
+ Clement
  Invhess
- Randcorr
- Smoke
- Oscillate
- Hilbert
- Rando
- Parter
- Poisson
julia> list_matrices(Property(:symmetric))21-element Vector{Type{<:AbstractMatrix}}: - Ipjfact - Wathen - Cauchy - RIS - Fiedler + Leslie Moler - Pascal - Wilkinson + Krylov + Lesp + Riemann + Rosser
julia> list_matrices(Property(:symmetric))21-element Vector{Type{<:AbstractMatrix}}: KMS + Hilbert + Minij + Pascal Hankel - ⋮ - GCDMat - DingDong Lehmer - InverseHilbert + Randcorr Prolate + Poisson + GCDMat + ⋮ Pei - Randcorr - Hilbert - Poisson

To list all matrices in the builtin group with inverse, illcond, and eigen properties:

julia> list_matrices(
+ Wathen
+ DingDong
+ Cauchy
+ RIS
+ Ipjfact
+ Wilkinson
+ Moler
+ Rosser

To list all matrices in the builtin group with inverse, illcond, and eigen properties:

julia> list_matrices(
            [
                Group(:builtin),
            ],
@@ -116,10 +116,10 @@
                Property(:eigen),
            ]
        )3-element Vector{Type{<:AbstractMatrix}}:
- Lotkin
- Pascal
- Forsythe

To list all matrices with symmetric, eigen, and posdef properties:

julia> list_matrices(:symmetric, :eigen, :posdef)4-element Vector{Type{<:AbstractMatrix}}:
- Wathen
+ Forsythe
  Pascal
+ Lotkin

To list all matrices with symmetric, eigen, and posdef properties:

julia> list_matrices(:symmetric, :eigen, :posdef)4-element Vector{Type{<:AbstractMatrix}}:
  Minij
- Poisson

There are many alternative interfaces using list_matrices, please check the list_matrices or use Julia help system for more information.

+ Pascal + Poisson + Wathen

There are many alternative interfaces using list_matrices, please check the list_matrices or use Julia help system for more information.

diff --git a/dev/manual/2.performance/index.html b/dev/manual/2.performance/index.html index 334273d..fd8de69 100644 --- a/dev/manual/2.performance/index.html +++ b/dev/manual/2.performance/index.html @@ -133,4 +133,4 @@ ▁▄██████████████▇▆▆▆▆▆▆▆▄▄▄▄▄▄▃▃▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁ ▃ 244 μs Histogram: frequency by time 647 μs < - Memory estimate: 16 bytes, allocs estimate: 1. + Memory estimate: 16 bytes, allocs estimate: 1. diff --git a/dev/references/1.types/index.html b/dev/references/1.types/index.html index 05d9f4f..a44948e 100644 --- a/dev/references/1.types/index.html +++ b/dev/references/1.types/index.html @@ -1,3 +1,3 @@ Types · TypedMatrices.jl

Types

+TypedMatrices.PropertyTypes.Symmetricsource
TypedMatrices.PropertyType
Property

Property type. Similar to symbol, just to distinguish it from group.

See also list_properties, @properties, properties.

source
TypedMatrices.GroupType
Group

Group type. Similar to symbol, just to distinguish it from property.

See also list_matrices, list_groups, add_to_groups, remove_from_group, remove_from_all_groups.

source
diff --git a/dev/references/2.interfaces/index.html b/dev/references/2.interfaces/index.html index fa2675a..7e14330 100644 --- a/dev/references/2.interfaces/index.html +++ b/dev/references/2.interfaces/index.html @@ -1,5 +1,5 @@ -Interfaces · TypedMatrices.jl

Interfaces

TypedMatrices.@propertiesMacro
@properties Type [propa, propb, ...]

Register properties for a type. The properties are a vector of symbols.

See also: properties.

Examples

julia> @properties Matrix [:symmetric, :inverse, :illcond, :posdef, :eigen]
source
TypedMatrices.propertiesFunction
properties(type)
+Interfaces · TypedMatrices.jl

Interfaces

TypedMatrices.@propertiesMacro
@properties Type [propa, propb, ...]

Register properties for a type. The properties are a vector of symbols.

See also: properties.

Examples

julia> @properties Matrix [:symmetric, :inverse, :illcond, :posdef, :eigen]
source
TypedMatrices.propertiesFunction
properties(type)
 properties(matrix)

Get the properties of a type or matrix.

See also: @properties.

Examples

julia> @properties Matrix [:symmetric, :posdef]
 
 julia> properties(Matrix)
@@ -10,19 +10,19 @@
 julia> properties(Matrix(ones(1, 1)))
 2-element Vector{Property}:
  Property(:symmetric)
- Property(:posdef)
source
TypedMatrices.add_to_groupsFunction
add_to_groups(type, groups)

Add a matrix type to groups. If a group is not exists, it will be created.

Groups :builtin and :user are special groups. It is suggested always to add matrices to the :user group.

groups can be vector/varargs of Group or symbol.

See also remove_from_group, remove_from_all_groups.

Examples

julia> add_to_groups(Matrix, [Group(:user), Group(:test)])
+ Property(:posdef)
source
TypedMatrices.add_to_groupsFunction
add_to_groups(type, groups)

Add a matrix type to groups. If a group is not exists, it will be created.

Groups :builtin and :user are special groups. It is suggested always to add matrices to the :user group.

groups can be vector/varargs of Group or symbol.

See also remove_from_group, remove_from_all_groups.

Examples

julia> add_to_groups(Matrix, [Group(:user), Group(:test)])
 
 julia> add_to_groups(Matrix, Group(:user), Group(:test))
 
 julia> add_to_groups(Matrix, [:user, :test])
 
-julia> add_to_groups(Matrix, :user, :test)
source
TypedMatrices.remove_from_groupFunction
remove_from_group(type, group)

Remove a matrix type from a group. If the group is empty, it will be deleted.

See also add_to_groups, remove_from_all_groups.

Examples

julia> add_to_groups(Matrix, Group(:user))
 
 julia> remove_from_group(Matrix, Group(:user))
 
 julia> add_to_groups(Matrix, :user)
 
-julia> remove_from_group(Matrix, :user)
source
TypedMatrices.list_matricesFunction
list_matrices(groups, props)

List all matrices that are in groups and have properties.

groups can be vector/varargs of Group or symbol.

props can be vector/varargs of Property, symbol, subtype of PropertyTypes.AbstractProperty or instance of AbstractProperty.

Examples

julia> list_matrices()
+julia> remove_from_group(Matrix, :user)
source
TypedMatrices.list_matricesFunction
list_matrices(groups, props)

List all matrices that are in groups and have properties.

groups can be vector/varargs of Group or symbol.

props can be vector/varargs of Property, symbol, subtype of PropertyTypes.AbstractProperty or instance of AbstractProperty.

Examples

julia> list_matrices()
 
 julia> list_matrices([Group(:builtin), Group(:user)], [Property(:symmetric), Property(:inverse)])
 
@@ -44,4 +44,4 @@
 
 julia> list_matrices(Group(:builtin), Group(:user))
 
-julia> list_matrices([Group(:builtin), Group(:user)])
source
+julia> list_matrices([Group(:builtin), Group(:user)])
source
diff --git a/dev/references/3.properties/index.html b/dev/references/3.properties/index.html index e36aa58..3cdefd3 100644 --- a/dev/references/3.properties/index.html +++ b/dev/references/3.properties/index.html @@ -1,2 +1,2 @@ -Properties · TypedMatrices.jl

Properties

Some documentation of the following properties are adapted from MatrixDepot.jl.

+Properties · TypedMatrices.jl

Properties

Some documentation of the following properties are adapted from MatrixDepot.jl.

diff --git a/dev/references/4.builtin-matrices/index.html b/dev/references/4.builtin-matrices/index.html index 478087d..e380e60 100644 --- a/dev/references/4.builtin-matrices/index.html +++ b/dev/references/4.builtin-matrices/index.html @@ -1,2 +1,2 @@ -Builtin Matrices · TypedMatrices.jl

Builtin Matrices

TypedMatrices.BinomialType

Binomial Matrix

The matrix is a multiple of an involutory matrix.

Input Options

  • dim: the dimension of the matrix.

References

G. Boyd, C.A. Micchelli, G. Strang and D.X. Zhou, Binomial matrices, Adv. in Comput. Math., 14 (2001), pp 379-391.

source
TypedMatrices.CauchyType

Cauchy Matrix

Given two vectors x and y, the (i,j) entry of the Cauchy matrix is 1/(x[i]+y[j]).

Input Options

  • x: an integer, as vectors 1:x and 1:x.
  • x, y: two integers, as vectors 1:x and 1:y.
  • x: a vector. y defaults to x.
  • x, y: two vectors.

References

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1

source
TypedMatrices.ChebSpecType

Chebyshev Spectral Differentiation Matrix

If k = 0,the generated matrix is nilpotent and a vector with all one entries is a null vector. If k = 1, the generated matrix is nonsingular and well-conditioned. Its eigenvalues have negative real parts.

Input Options

  • dim, k: dim is the dimension of the matrix and k = 0 or 1.
  • dim: k=0.

References

L. N. Trefethen and M. R. Trummer, An instability phenomenon in spectral methods, SIAM J. Numer. Anal., 24 (1987), pp. 1008-1023.

source
TypedMatrices.ChowType

Chow Matrix

The Chow matrix is a singular Toeplitz lower Hessenberg matrix.

Input Options

  • dim, alpha, delta: dim is dimension of the matrix. alpha, delta are scalars such that A[i,i] = alpha + delta and A[i,j] = alpha^(i + 1 -j) for j + 1 <= i.
  • dim: alpha = 1, delta = 0.

References

T. S. Chow, A class of Hessenberg matrices with known eigenvalues and inverses, SIAM Review, 11 (1969), pp. 391-395.

source
TypedMatrices.CirculantType

Circulant Matrix

A circulant matrix has the property that each row is obtained by cyclically permuting the entries of the previous row one step forward.

Input Options

  • vec: a vector.
  • dim: an integer, as vector 1:dim.

References

P. J. Davis, Circulant Matrices, John Wiley, 1977.

source
TypedMatrices.ClementType

Clement Matrix

The Clement matrix is a tridiagonal matrix with zero diagonal entries. If k = 1, the matrix is symmetric.

Input Options

  • dim, k: dim is the dimension of the matrix. If k = 0, the matrix is of type Tridiagonal. If k = 1, the matrix is of type SymTridiagonal.
  • dim: k = 0.

References

P. A. Clement, A class of triple-diagonal matrices for test purposes, SIAM Review, 1 (1959), pp. 50-52.

source
TypedMatrices.CompanionType

Companion Matrix

The companion matrix to a monic polynomial a(x) = a_0 + a_1x + ... + a_{n-1}x^{n-1} + x^n is the n-by-n matrix with ones on the subdiagonal and the last column given by the coefficients of a(x).

Input Options

  • vec: vec is a vector of coefficients.
  • dim: vec = [1:dim;]. dim is the dimension of the matrix.
  • polynomial: polynomial is a polynomial. vector will be appropriate values from coefficients.
source
TypedMatrices.ComparisonType

Comparison Matrix

The comparison matrix for another matrix.

Input Options

  • B, k: B is a matrix. k = 0: each element is absolute value of B, except each diagonal element is negative absolute value. k = 1: each diagonal element is absolute value of B, except each off-diagonal element is negative largest absolute value in the same row.
  • B: B is a matrix and k = 1.
source
TypedMatrices.CycolType

Cycol Matrix

The cycol matrix repeats columns.

Input Options

  • m, n, k: m and n are size of the matrix. The repetition is randn(m, k).
  • n, k: n is size of the matrix. The repetition is randn(n, k).
  • n: n is size of the matrix. k = round(n/4)
source
TypedMatrices.DingDongType

Dingdong Matrix

The Dingdong matrix is a symmetric Hankel matrix invented by DR. F. N. Ris of IBM, Thomas J Watson Research Centre. The eigenvalues cluster around π/2 and -π/2.

Input Options

  • dim: the dimension of the matrix.

References

J. C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).

source
TypedMatrices.DorrType

Dorr Matrix

Dorr Matrix is a diagonally dominant, illcond, tridiagonal sparse matrix.

Input Options

  • dim, theta: dim is the dimension of the matrix and theta is the parameter of the matrix.
  • dim: theta = 0.01.
source
TypedMatrices.DramadahType

Dramadah Matrix

Dramadah matrix is a matrix with 0s and 1s.

Input Options

  • dim, k: the dimension of the matrix and k. k = 1 abs(det(A)) = 1, the inverse has integer entries. k = 2 the inverse has integer entries. k = 3 det(A) is equal to nth Fibonacci number.
  • dim: k = 1.
source
TypedMatrices.FiedlerType

Fiedler Matrix

The Fiedler matrix is symmetric matrix with a dominant positive eigenvalue and all the other eigenvalues are negative.

Input Options

  • vec: a vector.
  • dim: dim is the dimension of the matrix. vec=[1:dim;].

References

G. Szego, Solution to problem 3705, Amer. Math. Monthly, 43 (1936), pp. 246-259.

J. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra, Birkhauser, Basel, and Academic Press, New York, 1977, p. 159.

source
TypedMatrices.ForsytheType

Forsythe Matrix

The Forsythe matrix is a n-by-n perturbed Jordan block. This generator is adapted from N. J. Higham's Test Matrix Toolbox.

Input Options

  • dim, alpha, lambda: dim is the dimension of the matrix. alpha and lambda are scalars.
  • dim: alpha = sqrt(eps(type)) and lambda = 0.
source
TypedMatrices.FrankType

Frank Matrix

The Frank matrix is an upper Hessenberg matrix with determinant 1. The eigenvalues are real, positive and very ill conditioned.

Input Options

  • dim, k: dim is the dimension of the matrix, k = 0 or 1. If k = 1 the matrix reflect about the anti-diagonal.
  • dim: the dimension of the matrix.

References

W. L. Frank, Computing eigenvalues of complex matrices by determinant evaluation and by methods of Danilewski and Wielandt, J. Soc. Indust. Appl. Math., 6 (1958), pp. 378-392 (see pp. 385, 388).

source
TypedMatrices.GCDMatType

GCDMat Matrix

A matrix with (i,j) entry gcd(i,j). It is a symmetric positive definite matrix.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.GearMatType

Gear Matrix

A gear matrix. 1's on the sub and super diagonal, sign(i) on the (1,abs(i)) and sign(j) on the (n,n+1-abs(j)) position, other elements are 0.

Input Options

  • dim: the dimension of the matrix. i = n and j = -n by default.
  • dim, i, j: the dimension of the matrix and the position of the 1's.
source
TypedMatrices.GolubType

Golub Matrix

Golub matrix is the product of two random unit lower and upper triangular matrices respectively. LU factorization without pivoting fails to reveal that such matrices are badly conditioned.

Input Options

  • dim: the dimension of the matrix.

References

D. Viswanath and N. Trefethen. Condition Numbers of Random Triangular Matrices, SIAM J. Matrix Anal. Appl. 19, 564-581, 1998.

source
TypedMatrices.GrcarType

Grcar Matrix

The Grcar matrix is a Toeplitz matrix with sensitive eigenvalues.

Input Options

  • dim, k: dim is the dimension of the matrix and k is the number of superdiagonals.
  • dim: the dimension of the matrix.

References

J. F. Grcar, Operator coefficient methods for linear equations, Report SAND89-8691, Sandia National Laboratories, Albuquerque, New Mexico, 1989 (Appendix 2).

source
TypedMatrices.HadamardType

Hadamard Matrix

The Hadamard matrix is a square matrix whose entries are 1 or -1. It was named after Jacques Hadamard. The rows of a Hadamard matrix are orthogonal.

Input Options

  • dim: the dimension of the matrix, dim is a power of 2.

References

S. W. Golomb and L. D. Baumert, The search for Hadamard matrices, Amer. Math. Monthly, 70 (1963) pp. 12-17

source
TypedMatrices.HankelType

Hankel Matrix

A Hankel matrix is a matrix that is symmetric and constant across the anti-diagonals.

Input Options

  • vc, vr: vc and vc are the first column and last row of the matrix. If the last element of vc differs from the first element of vr, the last element of rc prevails.
  • v: a vector, as vc = v and vr will be zeros.
  • dim: dim is the dimension of the matrix. v = [1:dim;].
source
TypedMatrices.HanowaType

Hanowa Matrix

The Hanowa matrix is a matrix which eigenvalues lie on a vertical line in the complex plane.

Input Options

  • dim: the dimension of the matrix and alpha = -1.
  • dim, alpha: the dimension and alpha.
source
TypedMatrices.HilbertType

Hilbert Matrix

The Hilbert matrix has (i,j) element 1/(i+j-1). It is notorious for being ill conditioned. It is symmetric positive definite and totally positive.

See also InverseHilbert.

Input Options

  • dim: the dimension of the matrix.
  • row_dim, col_dim: the row and column dimensions.

References

M. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.

source
TypedMatrices.InverseHilbertType

Inverse of the Hilbert Matrix

See also Hilbert.

Input Options

  • dim: the dimension of the matrix.

References

M. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.

source
TypedMatrices.InvhessType

Invhess Matrix

Inverse of upper Hessenberg matrix.

Input Options

  • dim: the dimension of the matrix. x = [1:dim;].
  • x: x vector. y = -x[1:end-1].
  • x, y: x and y vectors.
source
TypedMatrices.InvolutoryType

Involutory Matrix

An involutory matrix is a matrix that is its own inverse.

Input Options

  • dim: dim is the dimension of the matrix.

References

A. S. Householder and J. A. Carpenter, The singular values of involutory and of idempotent matrices, Numer. Math. 5 (1963), pp. 234-237.

source
TypedMatrices.IpjfactType

Ipjfact Matrix

Hankel matrix with factorial elements.

Input Options

  • dim: the dimension of the matrix.
  • dim, k: k = 0 element (i, j) is factorial(i + j). k = 1 element (i, j) is 1 / factorial(i + j).
source
TypedMatrices.JordBlocType

Jordan Block Matrix

Jordan block matrix with lambda on the diagonal and 1 on the superdiagonal. It's eigenvalues are lambda.

Input Options

  • dim: dimension of the matrix. lambda = 1.
  • dim, lambda: dimension of the matrix and the lambda.
source
TypedMatrices.KahanType

Kahan Matrix

The Kahan matrix is an upper trapezoidal matrix, i.e., the (i,j) element is equal to 0 if i > j. The useful range of θ is 0 < θ < π. The diagonal is perturbed by pert*eps()*diagm([n:-1:1;]).

Input Options

  • rowdim, coldim, θ, pert: rowdim and coldim are the row and column dimensions of the matrix. θ and pert are scalars.
  • dim, θ, pert: dim is the dimension of the matrix.
  • dim: θ = 1.2, pert = 25.

References

W. Kahan, Numerical linear algebra, Canadian Math. Bulletin, 9 (1966), pp. 757-801.

source
TypedMatrices.KMSType

Kac-Murdock-Szego Toeplitz matrix

Input Options

  • dim, rho: dim is the dimension of the matrix, rho is a scalar such that A[i,j] = rho^(abs(i-j)).
  • dim: rho = 0.5.

References

W. F. Trench, Numerical solution of the eigenvalue problem for Hermitian Toeplitz matrices, SIAM J. Matrix Analysis and Appl., 10 (1989), pp. 135-146 (and see the references therein).

source
TypedMatrices.KrylovType

Krylov Matrix

Krylow matrix equal to [x, Bx, B^2x, ..., B^(k-1)*x].

Input Options

  • dim: dimension of the matrix. A = randn(dim, dim). x = ones(dim). k = dim.
  • dim, x: dimension of the matrix and x.
  • dim, x, k: dimension of the matrix, x and k.
  • A: matrix. x = ones(size(A, 1)). k = size(A, 1).
  • A, x: matrix and x. k = size(A, 1).
  • A, x, k: matrix, x and k.
source
TypedMatrices.LauchliType

Lauchli Matrix

A matrix with ones on the first row, mu on the subdiagonal, and zeros elsewhere.

Input Options

  • dim: the dimension of the matrix. mu = sqrt(eps()) by default.
  • dim, mu: the dimension and subdiagonal value of the matrix.
source
TypedMatrices.LehmerType

Lehmer Matrix

The Lehmer matrix is a symmetric positive definite matrix. It is totally nonnegative. The inverse is tridiagonal and explicitly known

Input Options

  • dim: the dimension of the matrix.

References

M. Newman and J. Todd, The evaluation of matrix inversion programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476. Solutions to problem E710 (proposed by D.H. Lehmer): The inverse of a matrix, Amer. Math. Monthly, 53 (1946), pp. 534-535.

source
TypedMatrices.LeslieType

Leslie Matrix

Matrix for birth numbers and survival rates in the Leslie population model.

Input Options

  • dim: the dimension of the matrix. x = ones(n) and y = ones(n - 1) by default.
  • x, y: x and y.
source
TypedMatrices.LespType

Lesp Matrix

A matrix with eigenvalues smoothly distributed in the interval [-2*n-3.5,-4.5].

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.LotkinType

Lotkin Matrix

The Lotkin matrix is the Hilbert matrix with its first row altered to all ones. It is unsymmetric, illcond and has many negative eigenvalues of small magnitude.

Input Options

  • dim: dim is the dimension of the matrix.

References

M. Lotkin, A set of test matrices, MTAC, 9 (1955), pp. 153-161.

source
TypedMatrices.MagicType

Magic Square Matrix

The magic matrix is a matrix with integer entries such that the row elements, column elements, diagonal elements and anti-diagonal elements all add up to the same number.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.MinijType

MIN[I,J] Matrix

A matrix with (i,j) entry min(i,j). It is a symmetric positive definite matrix. The eigenvalues and eigenvectors are known explicitly. Its inverse is tridiagonal.

Input Options

  • dim: the dimension of the matrix.

References

J. Fortiana and C. M. Cuadras, A family of matrices, the discretized Brownian bridge, and distance-based regression, Linear Algebra Appl., 264 (1997), 173-188. (For the eigensystem of A.)

source
TypedMatrices.MolerType

Moler Matrix

The Moler matrix is a symmetric positive definite matrix. It has one small eigenvalue.

Input Options

  • dim, alpha: dim is the dimension of the matrix, alpha is a scalar.
  • dim: alpha = -1.

References

J.C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).

source
TypedMatrices.NeumannType

Neumann Matrix

A singular matrix from the discrete Neumann problem. The matrix is sparse and the null space is formed by a vector of ones

Input Options

  • dim: the dimension of the matrix, must be a perfect square integer.

References

R. J. Plemmons, Regular splittings and the discrete Neumann problem, Numer. Math., 25 (1976), pp. 153-161.

source
TypedMatrices.OrthogType

Orthogonal Matrix

Orthogonal and nearly orthogonal matrices.

Input Options

  • dim: the dimension of the matrix. k = 1 by default.
  • dim, k: the dimension and type of the matrix.
source
TypedMatrices.OscillateType

Oscillating Matrix

A matrix A is called oscillating if A is totally nonnegative and if there exists an integer q > 0 such that A^q is totally positive.

Input Options

  • Σ: the singular value spectrum of the matrix.
  • dim, mode: dim is the dimension of the matrix. mode = 1: geometrically distributed singular values. mode = 2: arithmetrically distributed singular values.
  • dim: mode = 1.

References

Per Christian Hansen, Test matrices for regularization methods. SIAM J. SCI. COMPUT Vol 16, No2, pp 506-512 (1995).

source
TypedMatrices.ParterType

Parter Matrix

The Parter matrix is a Toeplitz and Cauchy matrix with singular values near π.

Input Options

  • dim: the dimension of the matrix.

References

The MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2. S. V. Parter, On the distribution of the singular values of Toeplitz matrices, Linear Algebra and Appl., 80 (1986), pp. 115-130.

source
TypedMatrices.PascalType

Pascal Matrix

The Pascal matrix’s anti-diagonals form the Pascal’s triangle.

Input Options

  • dim: the dimension of the matrix.

References

R. Brawer and M. Pirovino, The linear algebra of the Pascal matrix, Linear Algebra and Appl., 174 (1992), pp. 13-23 (this paper gives a factorization of L = PASCAL(N,1) and a formula for the elements of L^k).

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.4.

source
TypedMatrices.PeiType

Pei Matrix

The Pei matrix is a symmetric matrix with known inversion.

Input Options

  • dim, alpha: dim is the dimension of the matrix. alpha is a scalar.
  • dim: the dimension of the matrix.

References

M. L. Pei, A test matrix for inversion procedures, Comm. ACM, 5 (1962), p. 508.

source
TypedMatrices.PoissonType

Poisson Matrix

A block tridiagonal matrix from Poisson’s equation. This matrix is sparse, symmetric positive definite and has known eigenvalues.

Input Options

  • dim: the dimension of the matrix.

References

G. H. Golub and C. F. Van Loan, Matrix Computations, second edition, Johns Hopkins University Press, Baltimore, Maryland, 1989 (Section 4.5.4).

source
TypedMatrices.ProlateType

Prolate Matrix

A prolate matrix is a symmetirc, ill-conditioned Toeplitz matrix.

Input Options

  • dim, alpha: dim is the dimension of the matrix. w is a real scalar.
  • dim: the case when w = 0.25.

References

J. M. Varah. The Prolate Matrix. Linear Algebra and Appl. 187:267–278, 1993.

source
TypedMatrices.RandcoluType

Randcolu Matrix

Random matrix with normalized columns and given singular values.

Input Options

  • dim: the dimension of the matrix, x will be generated randomly.
  • n, m: the size of the matrix.
  • n, m, k: size and k flag. Enable initial transformation if k = 0.
  • x: the x vector.
  • x, m: the x vector and m.
  • x, m, k: the x vector, m, and k flag.
source
TypedMatrices.RandcorrType

Random Correlation Matrix

A random correlation matrix is a symmetric positive semidefinite matrix with 1s on the diagonal.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.RandoType

Random Matrix with Element -1, 0, 1

Input Options

  • rowdim, coldim, k: row_dim and col_dim are row and column dimensions, k = 1: entries are 0 or 1. k = 2: entries are -1 or 1. k = 3: entries are -1, 0 or 1.
  • dim, k: row_dim = col_dim = dim.
  • dim: k = 1.
source
TypedMatrices.RandSVDType

Random Matrix with Pre-assigned Singular Values

Input Options

  • rowdim, coldim, kappa, mode: row_dim and col_dim are the row and column dimensions. kappa is the condition number of the matrix. mode = 1: one large singular value. mode = 2: one small singular value. mode = 3: geometrically distributed singular values. mode = 4: arithmetrically distributed singular values. mode = 5: random singular values with unif. dist. logarithm.
  • dim, kappa, mode: row_dim = col_dim = dim.
  • dim, kappa: mode = 3.
  • dim: kappa = sqrt(1/eps()), mode = 3.

References

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.3.

source
TypedMatrices.RiemannType

Riemann Matrix

A matrix associated with the Riemann hypothesis.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.RISType

RIS Matrix

The RIS matrix has (i,j) element 0.5/(n-i-j+1.5). It is symmetric.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.RohessType

Random Orthogonal Upper Hessenberg Matrix

The matrix is constructed via a product of Givens rotations.

Input Options

  • dim: the dimension of the matrix.

References

W. B. Gragg, The QR algorithm for unitary Hessenberg matrices, J. Comp. Appl. Math., 16 (1986), pp. 1-8.

source
TypedMatrices.RosserType

Rosser Matrix

The Rosser matrix’s eigenvalues are very close together so it is a challenging matrix for many eigenvalue algorithms.

Input Options

  • dim, a, b: dim is the dimension of the matrix. dim must be a power of 2. a and b are scalars. For dim = 8, a = 2 and b = 1, the generated matrix is the test matrix used by Rosser.
  • dim: a = rand(1:5), b = rand(1:5).

References

J. B. Rosser, C. Lanczos, M. R. Hestenes, W. Karush, Separation of close eigenvalues of a real symmetric matrix, Journal of Research of the National Bureau of Standards, v(47) (1951)

source
TypedMatrices.SamplingType

Matrix with Application in Sampling Theory

A nonsymmetric matrix with eigenvalues 0, 1, 2, ... n-1.

Input Options

  • vec: vec is a vector with no repeated elements.
  • dim: dim is the dimension of the matrix. vec = [1:dim;]/dim.

References

L. Bondesson and I. Traat, A nonsymmetric matrix with integer eigenvalues, linear and multilinear algebra, 55(3) (2007), pp. 239-247

source
TypedMatrices.SmokeType

Smoke Matrix

Complex matrix with a "smoke ring" pseudospectrum. 1's on the superdiagonal, cos(w) + sin(w) * im on the diagonal. The A(n, 1)` entry is 1 if k = 0, 0 if k = 1.

Input Options

  • dim: dimension of the matrix. k = 0.
  • dim, k: dimension of the matrix and the k.
source
TypedMatrices.ToeplitzType

Toeplitz Matrix

A Toeplitz matrix is a matrix in which each descending diagonal from left to right is constant.

Input Options

  • vc, vr: vc and vr are the first column and row of the matrix.
  • v: symmatric case, i.e., vc = vr = v.
  • dim: dim is the dimension of the matrix. v = [1:dim;] is the first row and column vector.
source
TypedMatrices.TriwType

Triw Matrix

Upper triangular matrices discussed by Wilkinson and others.

Input Options

  • rowdim, coldim, α, k: row_dim and col_dim are row and column dimension of the matrix. α is a scalar representing the entries on the superdiagonals. k is the number of superdiagonals.
  • dim: the dimension of the matrix.

References

G. H. Golub and J. H. Wilkinson, Ill-conditioned eigensystems and the computation of the Jordan canonical form, SIAM Review, 18(4), 1976, pp. 578-6

source
TypedMatrices.WathenType

Wathen Matrix

Wathen Matrix is a sparse, symmetric positive, random matrix arose from the finite element method. The generated matrix is the consistent mass matrix for a regular nx-by-ny grid of 8-nodes.

Input Options

  • [type,] nx, ny: the dimension of the matrix is equal to 3 * nx * ny + 2 * nx * ny + 1.
  • [type,] n: nx = ny = n.

Groups: ["symmetric", "posdef", "eigen", "random", "sparse"]

References

A. J. Wathen, Realistic eigenvalue bounds for the Galerkin mass matrix, IMA J. Numer. Anal., 7 (1987), pp. 449-457.

source
TypedMatrices.WilkinsonType

Wilkinson Matrix

The Wilkinson matrix is a symmetric tridiagonal matrix with pairs of nearly equal eigenvalues. The most frequently used case is matrixdepot("wilkinson", 21). The result is of type Tridiagonal.

Input Options

  • dim: the dimension of the matrix.

References

J. H. Wilkinson, Error analysis of direct methods of matrix inversion, J. Assoc. Comput. Mach., 8 (1961), pp. 281-330.

source
+Builtin Matrices · TypedMatrices.jl

Builtin Matrices

TypedMatrices.BinomialType

Binomial Matrix

The matrix is a multiple of an involutory matrix.

Input Options

  • dim: the dimension of the matrix.

References

G. Boyd, C.A. Micchelli, G. Strang and D.X. Zhou, Binomial matrices, Adv. in Comput. Math., 14 (2001), pp 379-391.

source
TypedMatrices.CauchyType

Cauchy Matrix

Given two vectors x and y, the (i,j) entry of the Cauchy matrix is 1/(x[i]+y[j]).

Input Options

  • x: an integer, as vectors 1:x and 1:x.
  • x, y: two integers, as vectors 1:x and 1:y.
  • x: a vector. y defaults to x.
  • x, y: two vectors.

References

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1

source
TypedMatrices.ChebSpecType

Chebyshev Spectral Differentiation Matrix

If k = 0,the generated matrix is nilpotent and a vector with all one entries is a null vector. If k = 1, the generated matrix is nonsingular and well-conditioned. Its eigenvalues have negative real parts.

Input Options

  • dim, k: dim is the dimension of the matrix and k = 0 or 1.
  • dim: k=0.

References

L. N. Trefethen and M. R. Trummer, An instability phenomenon in spectral methods, SIAM J. Numer. Anal., 24 (1987), pp. 1008-1023.

source
TypedMatrices.ChowType

Chow Matrix

The Chow matrix is a singular Toeplitz lower Hessenberg matrix.

Input Options

  • dim, alpha, delta: dim is dimension of the matrix. alpha, delta are scalars such that A[i,i] = alpha + delta and A[i,j] = alpha^(i + 1 -j) for j + 1 <= i.
  • dim: alpha = 1, delta = 0.

References

T. S. Chow, A class of Hessenberg matrices with known eigenvalues and inverses, SIAM Review, 11 (1969), pp. 391-395.

source
TypedMatrices.CirculantType

Circulant Matrix

A circulant matrix has the property that each row is obtained by cyclically permuting the entries of the previous row one step forward.

Input Options

  • vec: a vector.
  • dim: an integer, as vector 1:dim.

References

P. J. Davis, Circulant Matrices, John Wiley, 1977.

source
TypedMatrices.ClementType

Clement Matrix

The Clement matrix is a tridiagonal matrix with zero diagonal entries. If k = 1, the matrix is symmetric.

Input Options

  • dim, k: dim is the dimension of the matrix. If k = 0, the matrix is of type Tridiagonal. If k = 1, the matrix is of type SymTridiagonal.
  • dim: k = 0.

References

P. A. Clement, A class of triple-diagonal matrices for test purposes, SIAM Review, 1 (1959), pp. 50-52.

source
TypedMatrices.CompanionType

Companion Matrix

The companion matrix to a monic polynomial a(x) = a_0 + a_1x + ... + a_{n-1}x^{n-1} + x^n is the n-by-n matrix with ones on the subdiagonal and the last column given by the coefficients of a(x).

Input Options

  • vec: vec is a vector of coefficients.
  • dim: vec = [1:dim;]. dim is the dimension of the matrix.
  • polynomial: polynomial is a polynomial. vector will be appropriate values from coefficients.
source
TypedMatrices.ComparisonType

Comparison Matrix

The comparison matrix for another matrix.

Input Options

  • B, k: B is a matrix. k = 0: each element is absolute value of B, except each diagonal element is negative absolute value. k = 1: each diagonal element is absolute value of B, except each off-diagonal element is negative largest absolute value in the same row.
  • B: B is a matrix and k = 1.
source
TypedMatrices.CycolType

Cycol Matrix

The cycol matrix repeats columns.

Input Options

  • m, n, k: m and n are size of the matrix. The repetition is randn(m, k).
  • n, k: n is size of the matrix. The repetition is randn(n, k).
  • n: n is size of the matrix. k = round(n/4)
source
TypedMatrices.DingDongType

Dingdong Matrix

The Dingdong matrix is a symmetric Hankel matrix invented by DR. F. N. Ris of IBM, Thomas J Watson Research Centre. The eigenvalues cluster around π/2 and -π/2.

Input Options

  • dim: the dimension of the matrix.

References

J. C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).

source
TypedMatrices.DorrType

Dorr Matrix

Dorr Matrix is a diagonally dominant, illcond, tridiagonal sparse matrix.

Input Options

  • dim, theta: dim is the dimension of the matrix and theta is the parameter of the matrix.
  • dim: theta = 0.01.
source
TypedMatrices.DramadahType

Dramadah Matrix

Dramadah matrix is a matrix with 0s and 1s.

Input Options

  • dim, k: the dimension of the matrix and k. k = 1 abs(det(A)) = 1, the inverse has integer entries. k = 2 the inverse has integer entries. k = 3 det(A) is equal to nth Fibonacci number.
  • dim: k = 1.
source
TypedMatrices.FiedlerType

Fiedler Matrix

The Fiedler matrix is symmetric matrix with a dominant positive eigenvalue and all the other eigenvalues are negative.

Input Options

  • vec: a vector.
  • dim: dim is the dimension of the matrix. vec=[1:dim;].

References

G. Szego, Solution to problem 3705, Amer. Math. Monthly, 43 (1936), pp. 246-259.

J. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra, Birkhauser, Basel, and Academic Press, New York, 1977, p. 159.

source
TypedMatrices.ForsytheType

Forsythe Matrix

The Forsythe matrix is a n-by-n perturbed Jordan block. This generator is adapted from N. J. Higham's Test Matrix Toolbox.

Input Options

  • dim, alpha, lambda: dim is the dimension of the matrix. alpha and lambda are scalars.
  • dim: alpha = sqrt(eps(type)) and lambda = 0.
source
TypedMatrices.FrankType

Frank Matrix

The Frank matrix is an upper Hessenberg matrix with determinant 1. The eigenvalues are real, positive and very ill conditioned.

Input Options

  • dim, k: dim is the dimension of the matrix, k = 0 or 1. If k = 1 the matrix reflect about the anti-diagonal.
  • dim: the dimension of the matrix.

References

W. L. Frank, Computing eigenvalues of complex matrices by determinant evaluation and by methods of Danilewski and Wielandt, J. Soc. Indust. Appl. Math., 6 (1958), pp. 378-392 (see pp. 385, 388).

source
TypedMatrices.GCDMatType

GCDMat Matrix

A matrix with (i,j) entry gcd(i,j). It is a symmetric positive definite matrix.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.GearMatType

Gear Matrix

A gear matrix. 1's on the sub and super diagonal, sign(i) on the (1,abs(i)) and sign(j) on the (n,n+1-abs(j)) position, other elements are 0.

Input Options

  • dim: the dimension of the matrix. i = n and j = -n by default.
  • dim, i, j: the dimension of the matrix and the position of the 1's.
source
TypedMatrices.GolubType

Golub Matrix

Golub matrix is the product of two random unit lower and upper triangular matrices respectively. LU factorization without pivoting fails to reveal that such matrices are badly conditioned.

Input Options

  • dim: the dimension of the matrix.

References

D. Viswanath and N. Trefethen. Condition Numbers of Random Triangular Matrices, SIAM J. Matrix Anal. Appl. 19, 564-581, 1998.

source
TypedMatrices.GrcarType

Grcar Matrix

The Grcar matrix is a Toeplitz matrix with sensitive eigenvalues.

Input Options

  • dim, k: dim is the dimension of the matrix and k is the number of superdiagonals.
  • dim: the dimension of the matrix.

References

J. F. Grcar, Operator coefficient methods for linear equations, Report SAND89-8691, Sandia National Laboratories, Albuquerque, New Mexico, 1989 (Appendix 2).

source
TypedMatrices.HadamardType

Hadamard Matrix

The Hadamard matrix is a square matrix whose entries are 1 or -1. It was named after Jacques Hadamard. The rows of a Hadamard matrix are orthogonal.

Input Options

  • dim: the dimension of the matrix, dim is a power of 2.

References

S. W. Golomb and L. D. Baumert, The search for Hadamard matrices, Amer. Math. Monthly, 70 (1963) pp. 12-17

source
TypedMatrices.HankelType

Hankel Matrix

A Hankel matrix is a matrix that is symmetric and constant across the anti-diagonals.

Input Options

  • vc, vr: vc and vc are the first column and last row of the matrix. If the last element of vc differs from the first element of vr, the last element of rc prevails.
  • v: a vector, as vc = v and vr will be zeros.
  • dim: dim is the dimension of the matrix. v = [1:dim;].
source
TypedMatrices.HanowaType

Hanowa Matrix

The Hanowa matrix is a matrix which eigenvalues lie on a vertical line in the complex plane.

Input Options

  • dim: the dimension of the matrix and alpha = -1.
  • dim, alpha: the dimension and alpha.
source
TypedMatrices.HilbertType

Hilbert Matrix

The Hilbert matrix has (i,j) element 1/(i+j-1). It is notorious for being ill conditioned. It is symmetric positive definite and totally positive.

See also InverseHilbert.

Input Options

  • dim: the dimension of the matrix.
  • row_dim, col_dim: the row and column dimensions.

References

M. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.

source
TypedMatrices.InverseHilbertType

Inverse of the Hilbert Matrix

See also Hilbert.

Input Options

  • dim: the dimension of the matrix.

References

M. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.

source
TypedMatrices.InvhessType

Invhess Matrix

Inverse of upper Hessenberg matrix.

Input Options

  • dim: the dimension of the matrix. x = [1:dim;].
  • x: x vector. y = -x[1:end-1].
  • x, y: x and y vectors.
source
TypedMatrices.InvolutoryType

Involutory Matrix

An involutory matrix is a matrix that is its own inverse.

Input Options

  • dim: dim is the dimension of the matrix.

References

A. S. Householder and J. A. Carpenter, The singular values of involutory and of idempotent matrices, Numer. Math. 5 (1963), pp. 234-237.

source
TypedMatrices.IpjfactType

Ipjfact Matrix

Hankel matrix with factorial elements.

Input Options

  • dim: the dimension of the matrix.
  • dim, k: k = 0 element (i, j) is factorial(i + j). k = 1 element (i, j) is 1 / factorial(i + j).
source
TypedMatrices.JordBlocType

Jordan Block Matrix

Jordan block matrix with lambda on the diagonal and 1 on the superdiagonal. It's eigenvalues are lambda.

Input Options

  • dim: dimension of the matrix. lambda = 1.
  • dim, lambda: dimension of the matrix and the lambda.
source
TypedMatrices.KahanType

Kahan Matrix

The Kahan matrix is an upper trapezoidal matrix, i.e., the (i,j) element is equal to 0 if i > j. The useful range of θ is 0 < θ < π. The diagonal is perturbed by pert*eps()*diagm([n:-1:1;]).

Input Options

  • rowdim, coldim, θ, pert: rowdim and coldim are the row and column dimensions of the matrix. θ and pert are scalars.
  • dim, θ, pert: dim is the dimension of the matrix.
  • dim: θ = 1.2, pert = 25.

References

W. Kahan, Numerical linear algebra, Canadian Math. Bulletin, 9 (1966), pp. 757-801.

source
TypedMatrices.KMSType

Kac-Murdock-Szego Toeplitz matrix

Input Options

  • dim, rho: dim is the dimension of the matrix, rho is a scalar such that A[i,j] = rho^(abs(i-j)).
  • dim: rho = 0.5.

References

W. F. Trench, Numerical solution of the eigenvalue problem for Hermitian Toeplitz matrices, SIAM J. Matrix Analysis and Appl., 10 (1989), pp. 135-146 (and see the references therein).

source
TypedMatrices.KrylovType

Krylov Matrix

Krylow matrix equal to [x, Bx, B^2x, ..., B^(k-1)*x].

Input Options

  • dim: dimension of the matrix. A = randn(dim, dim). x = ones(dim). k = dim.
  • dim, x: dimension of the matrix and x.
  • dim, x, k: dimension of the matrix, x and k.
  • A: matrix. x = ones(size(A, 1)). k = size(A, 1).
  • A, x: matrix and x. k = size(A, 1).
  • A, x, k: matrix, x and k.
source
TypedMatrices.LauchliType

Lauchli Matrix

A matrix with ones on the first row, mu on the subdiagonal, and zeros elsewhere.

Input Options

  • dim: the dimension of the matrix. mu = sqrt(eps()) by default.
  • dim, mu: the dimension and subdiagonal value of the matrix.
source
TypedMatrices.LehmerType

Lehmer Matrix

The Lehmer matrix is a symmetric positive definite matrix. It is totally nonnegative. The inverse is tridiagonal and explicitly known

Input Options

  • dim: the dimension of the matrix.

References

M. Newman and J. Todd, The evaluation of matrix inversion programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476. Solutions to problem E710 (proposed by D.H. Lehmer): The inverse of a matrix, Amer. Math. Monthly, 53 (1946), pp. 534-535.

source
TypedMatrices.LeslieType

Leslie Matrix

Matrix for birth numbers and survival rates in the Leslie population model.

Input Options

  • dim: the dimension of the matrix. x = ones(n) and y = ones(n - 1) by default.
  • x, y: x and y.
source
TypedMatrices.LespType

Lesp Matrix

A matrix with eigenvalues smoothly distributed in the interval [-2*n-3.5,-4.5].

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.LotkinType

Lotkin Matrix

The Lotkin matrix is the Hilbert matrix with its first row altered to all ones. It is unsymmetric, illcond and has many negative eigenvalues of small magnitude.

Input Options

  • dim: dim is the dimension of the matrix.

References

M. Lotkin, A set of test matrices, MTAC, 9 (1955), pp. 153-161.

source
TypedMatrices.MagicType

Magic Square Matrix

The magic matrix is a matrix with integer entries such that the row elements, column elements, diagonal elements and anti-diagonal elements all add up to the same number.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.MinijType

MIN[I,J] Matrix

A matrix with (i,j) entry min(i,j). It is a symmetric positive definite matrix. The eigenvalues and eigenvectors are known explicitly. Its inverse is tridiagonal.

Input Options

  • dim: the dimension of the matrix.

References

J. Fortiana and C. M. Cuadras, A family of matrices, the discretized Brownian bridge, and distance-based regression, Linear Algebra Appl., 264 (1997), 173-188. (For the eigensystem of A.)

source
TypedMatrices.MolerType

Moler Matrix

The Moler matrix is a symmetric positive definite matrix. It has one small eigenvalue.

Input Options

  • dim, alpha: dim is the dimension of the matrix, alpha is a scalar.
  • dim: alpha = -1.

References

J.C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).

source
TypedMatrices.NeumannType

Neumann Matrix

A singular matrix from the discrete Neumann problem. The matrix is sparse and the null space is formed by a vector of ones

Input Options

  • dim: the dimension of the matrix, must be a perfect square integer.

References

R. J. Plemmons, Regular splittings and the discrete Neumann problem, Numer. Math., 25 (1976), pp. 153-161.

source
TypedMatrices.OrthogType

Orthogonal Matrix

Orthogonal and nearly orthogonal matrices.

Input Options

  • dim: the dimension of the matrix. k = 1 by default.
  • dim, k: the dimension and type of the matrix.
source
TypedMatrices.OscillateType

Oscillating Matrix

A matrix A is called oscillating if A is totally nonnegative and if there exists an integer q > 0 such that A^q is totally positive.

Input Options

  • Σ: the singular value spectrum of the matrix.
  • dim, mode: dim is the dimension of the matrix. mode = 1: geometrically distributed singular values. mode = 2: arithmetrically distributed singular values.
  • dim: mode = 1.

References

Per Christian Hansen, Test matrices for regularization methods. SIAM J. SCI. COMPUT Vol 16, No2, pp 506-512 (1995).

source
TypedMatrices.ParterType

Parter Matrix

The Parter matrix is a Toeplitz and Cauchy matrix with singular values near π.

Input Options

  • dim: the dimension of the matrix.

References

The MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2. S. V. Parter, On the distribution of the singular values of Toeplitz matrices, Linear Algebra and Appl., 80 (1986), pp. 115-130.

source
TypedMatrices.PascalType

Pascal Matrix

The Pascal matrix’s anti-diagonals form the Pascal’s triangle.

Input Options

  • dim: the dimension of the matrix.

References

R. Brawer and M. Pirovino, The linear algebra of the Pascal matrix, Linear Algebra and Appl., 174 (1992), pp. 13-23 (this paper gives a factorization of L = PASCAL(N,1) and a formula for the elements of L^k).

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.4.

source
TypedMatrices.PeiType

Pei Matrix

The Pei matrix is a symmetric matrix with known inversion.

Input Options

  • dim, alpha: dim is the dimension of the matrix. alpha is a scalar.
  • dim: the dimension of the matrix.

References

M. L. Pei, A test matrix for inversion procedures, Comm. ACM, 5 (1962), p. 508.

source
TypedMatrices.PoissonType

Poisson Matrix

A block tridiagonal matrix from Poisson’s equation. This matrix is sparse, symmetric positive definite and has known eigenvalues.

Input Options

  • dim: the dimension of the matrix.

References

G. H. Golub and C. F. Van Loan, Matrix Computations, second edition, Johns Hopkins University Press, Baltimore, Maryland, 1989 (Section 4.5.4).

source
TypedMatrices.ProlateType

Prolate Matrix

A prolate matrix is a symmetirc, ill-conditioned Toeplitz matrix.

Input Options

  • dim, alpha: dim is the dimension of the matrix. w is a real scalar.
  • dim: the case when w = 0.25.

References

J. M. Varah. The Prolate Matrix. Linear Algebra and Appl. 187:267–278, 1993.

source
TypedMatrices.RandcoluType

Randcolu Matrix

Random matrix with normalized columns and given singular values.

Input Options

  • dim: the dimension of the matrix, x will be generated randomly.
  • n, m: the size of the matrix.
  • n, m, k: size and k flag. Enable initial transformation if k = 0.
  • x: the x vector.
  • x, m: the x vector and m.
  • x, m, k: the x vector, m, and k flag.
source
TypedMatrices.RandcorrType

Random Correlation Matrix

A random correlation matrix is a symmetric positive semidefinite matrix with 1s on the diagonal.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.RandoType

Random Matrix with Element -1, 0, 1

Input Options

  • rowdim, coldim, k: row_dim and col_dim are row and column dimensions, k = 1: entries are 0 or 1. k = 2: entries are -1 or 1. k = 3: entries are -1, 0 or 1.
  • dim, k: row_dim = col_dim = dim.
  • dim: k = 1.
source
TypedMatrices.RandSVDType

Random Matrix with Pre-assigned Singular Values

Input Options

  • rowdim, coldim, kappa, mode: row_dim and col_dim are the row and column dimensions. kappa is the condition number of the matrix. mode = 1: one large singular value. mode = 2: one small singular value. mode = 3: geometrically distributed singular values. mode = 4: arithmetrically distributed singular values. mode = 5: random singular values with unif. dist. logarithm.
  • dim, kappa, mode: row_dim = col_dim = dim.
  • dim, kappa: mode = 3.
  • dim: kappa = sqrt(1/eps()), mode = 3.

References

N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.3.

source
TypedMatrices.RiemannType

Riemann Matrix

A matrix associated with the Riemann hypothesis.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.RISType

RIS Matrix

The RIS matrix has (i,j) element 0.5/(n-i-j+1.5). It is symmetric.

Input Options

  • dim: the dimension of the matrix.
source
TypedMatrices.RohessType

Random Orthogonal Upper Hessenberg Matrix

The matrix is constructed via a product of Givens rotations.

Input Options

  • dim: the dimension of the matrix.

References

W. B. Gragg, The QR algorithm for unitary Hessenberg matrices, J. Comp. Appl. Math., 16 (1986), pp. 1-8.

source
TypedMatrices.RosserType

Rosser Matrix

The Rosser matrix’s eigenvalues are very close together so it is a challenging matrix for many eigenvalue algorithms.

Input Options

  • dim, a, b: dim is the dimension of the matrix. dim must be a power of 2. a and b are scalars. For dim = 8, a = 2 and b = 1, the generated matrix is the test matrix used by Rosser.
  • dim: a = rand(1:5), b = rand(1:5).

References

J. B. Rosser, C. Lanczos, M. R. Hestenes, W. Karush, Separation of close eigenvalues of a real symmetric matrix, Journal of Research of the National Bureau of Standards, v(47) (1951)

source
TypedMatrices.SamplingType

Matrix with Application in Sampling Theory

A nonsymmetric matrix with eigenvalues 0, 1, 2, ... n-1.

Input Options

  • vec: vec is a vector with no repeated elements.
  • dim: dim is the dimension of the matrix. vec = [1:dim;]/dim.

References

L. Bondesson and I. Traat, A nonsymmetric matrix with integer eigenvalues, linear and multilinear algebra, 55(3) (2007), pp. 239-247

source
TypedMatrices.SmokeType

Smoke Matrix

Complex matrix with a "smoke ring" pseudospectrum. 1's on the superdiagonal, cos(w) + sin(w) * im on the diagonal. The A(n, 1)` entry is 1 if k = 0, 0 if k = 1.

Input Options

  • dim: dimension of the matrix. k = 0.
  • dim, k: dimension of the matrix and the k.
source
TypedMatrices.ToeplitzType

Toeplitz Matrix

A Toeplitz matrix is a matrix in which each descending diagonal from left to right is constant.

Input Options

  • vc, vr: vc and vr are the first column and row of the matrix.
  • v: symmatric case, i.e., vc = vr = v.
  • dim: dim is the dimension of the matrix. v = [1:dim;] is the first row and column vector.
source
TypedMatrices.TriwType

Triw Matrix

Upper triangular matrices discussed by Wilkinson and others.

Input Options

  • rowdim, coldim, α, k: row_dim and col_dim are row and column dimension of the matrix. α is a scalar representing the entries on the superdiagonals. k is the number of superdiagonals.
  • dim: the dimension of the matrix.

References

G. H. Golub and J. H. Wilkinson, Ill-conditioned eigensystems and the computation of the Jordan canonical form, SIAM Review, 18(4), 1976, pp. 578-6

source
TypedMatrices.WathenType

Wathen Matrix

Wathen Matrix is a sparse, symmetric positive, random matrix arose from the finite element method. The generated matrix is the consistent mass matrix for a regular nx-by-ny grid of 8-nodes.

Input Options

  • [type,] nx, ny: the dimension of the matrix is equal to 3 * nx * ny + 2 * nx * ny + 1.
  • [type,] n: nx = ny = n.

Groups: ["symmetric", "posdef", "eigen", "random", "sparse"]

References

A. J. Wathen, Realistic eigenvalue bounds for the Galerkin mass matrix, IMA J. Numer. Anal., 7 (1987), pp. 449-457.

source
TypedMatrices.WilkinsonType

Wilkinson Matrix

The Wilkinson matrix is a symmetric tridiagonal matrix with pairs of nearly equal eigenvalues. The most frequently used case is matrixdepot("wilkinson", 21). The result is of type Tridiagonal.

Input Options

  • dim: the dimension of the matrix.

References

J. H. Wilkinson, Error analysis of direct methods of matrix inversion, J. Assoc. Comput. Mach., 8 (1961), pp. 281-330.

source
diff --git a/dev/search_index.js b/dev/search_index.js index d1080b5..cb1fe14 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"manual/2.performance/#Performance","page":"Performance","title":"Performance","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"We will briefly discuss the performance in this page.","category":"page"},{"location":"manual/2.performance/#Linear-Algebra-Properties-on-Typed-Matrices","page":"Performance","title":"Linear Algebra Properties on Typed Matrices","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"Package LinearAlgebra.jl provides several linear algebra operations. By utilizing the Julia type system, we can also improve the performance of these operations. For example, the issymmetric function defaults to call the issymmetric and check each element. The matrix Minij is explicitly known to be symmetric. The following example shows that the issymmetric function on the Minij typed matrix spent 10.310 ns and 873.400 μs on the Matrix typed matrix.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> a = Minij(1000)\n1000×1000 Minij{Int64}:\n...\n\njulia> b = Matrix(Minij(1000))\n1000×1000 Matrix{Int64}:\n...\n\njulia> @benchmark issymmetric(a)\nBenchmarkTools.Trial: 10000 samples with 999 evaluations.\n Range (min … max): 9.810 ns … 89.790 ns ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 10.310 ns ┊ GC (median): 0.00%\n Time (mean ± σ): 10.798 ns ± 2.083 ns ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n █▅▇▅▆▆▃▄▄▂ ▃▂▁▃ ▁▂▁▂▂▂▁▁▂ ▁ ▂\n ███████████████████████████▇▆▇▇▇▆▆▄▆▃▄▆▄▄▅▃▅▅▅▄▆▄▄▅▄▄▅▅▄▅▂▅ █\n 9.81 ns Histogram: log(frequency) by time 17.7 ns <\n\n Memory estimate: 0 bytes, allocs estimate: 0.\n\njulia> @benchmark issymmetric(b)\nBenchmarkTools.Trial: 4883 samples with 1 evaluation.\n Range (min … max): 593.700 μs … 13.507 ms ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 873.400 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 1.009 ms ± 515.315 μs ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n █▂ ▁▁\n ▂▆██▇▆████▇▅▄▃▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂\n 594 μs Histogram: frequency by time 2.69 ms <\n\n Memory estimate: 0 bytes, allocs estimate: 0.","category":"page"},{"location":"manual/2.performance/#Known-Algorithm-Working-on-Hilbert","page":"Performance","title":"Known Algorithm Working on Hilbert","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"The following example shows a known algorithm that works on Hilbert matrices, a is a Hilbert typed matrix, and b is the same matrix with Matrix typed. When doing the det operation, the Hilbert typed matrix only spent 0.3% of the time that the normal matrix spent, although the memory usage is 69.02 KiB and 66.22 MiB respectively.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> a = Hilbert{BigFloat}(100)\n100×100 Hilbert{BigFloat}:\n...\n\njulia> b = Matrix(Hilbert{BigFloat}(100))\n100×100 Matrix{BigFloat}:\n...\n\njulia> t3 = @benchmark det(a)\nBenchmarkTools.Trial: 6985 samples with 1 evaluation.\n Range (min … max): 334.500 μs … 740.291 ms ┊ GC (min … max): 0.00% … 68.80%\n Time (median): 564.100 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 706.671 μs ± 8.853 ms ┊ GC (mean ± σ): 10.32% ± 0.82%\n\n ▅█▅▂▂▅▄▁\n ▃█████████▇▆▆▄▄▄▄▅▅▅▅▆▆▇███▇▆▇▅▅▄▅▅▄▃▃▃▃▃▂▂▂▂▂▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁ ▃\n 334 μs Histogram: frequency by time 1.23 ms <\n\n Memory estimate: 69.02 KiB, allocs estimate: 3233.\n\njulia> t4 = @benchmark det(b)\nBenchmarkTools.Trial: 32 samples with 1 evaluation.\n Range (min … max): 127.925 ms … 229.261 ms ┊ GC (min … max): 8.86% … 4.76%\n Time (median): 158.327 ms ┊ GC (median): 9.49%\n Time (mean ± σ): 160.932 ms ± 23.576 ms ┊ GC (mean ± σ): 9.48% ± 3.52%\n\n ▃▃ █ ▃ ▃█\n ▇▁▁▁██▁█▁█▁▇▇▇▁▇▇▇▇██▁▁▁▁▇▇▇▁▁▇▇▁▇▁▁▁▁▇▁▁▁▁▁▁▇▁▁▇▁▁▁▁▁▁▁▁▁▁▁▇ ▁\n 128 ms Histogram: frequency by time 229 ms <\n\n Memory estimate: 66.22 MiB, allocs estimate: 1333851.","category":"page"},{"location":"manual/2.performance/#Trade-between-Performance-and-Memory","page":"Performance","title":"Trade between Performance and Memory","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"This fresh approach saves substantial memory by trading off the performance. The following example shows that the Cauchy typed matrix a only spent 63.229 μs and 114.16 KiB memory to generate, while the Matrix typed matrix b spent 3.862 ms and 7.74 MiB memory to generate. Also, the memory usage of a is 16 bytes and 8000040 bytes for b.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> @benchmark a = Cauchy{Float64}(1000)\nBenchmarkTools.Trial: 10000 samples with 1 evaluation.\n Range (min … max): 27.100 μs … 191.819 ms ┊ GC (min … max): 0.00% … 99.94%\n Time (median): 32.100 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 63.229 μs ± 1.919 ms ┊ GC (mean ± σ): 35.05% ± 4.29%\n\n ▅█▇▅▄▃▃▂▂▃▂▃▃▅▅▃▁▁ ▁▁ ▂\n ███████████████████▇▇███▇▇▆▇▇▇▇▆▆▇████▇▇▆▆▄▄▃▂▂▄▅▅▅▆▆▇▇▆▆▇▅▅ █\n 27.1 μs Histogram: log(frequency) by time 125 μs <\n\n Memory estimate: 114.16 KiB, allocs estimate: 36.\n\njulia> @benchmark b = Matrix(Cauchy{Float64}(1000))\nBenchmarkTools.Trial: 1288 samples with 1 evaluation.\n Range (min … max): 2.413 ms … 18.386 ms ┊ GC (min … max): 0.00% … 48.63%\n Time (median): 3.271 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 3.862 ms ± 1.674 ms ┊ GC (mean ± σ): 15.96% ± 19.84%\n\n ▂█▄ ▁▂\n ████▄▆██▆▅▅▅▃▃▃▃▄▄▄▃▃▃▃▃▃▃▃▃▃▃▃▂▂▂▂▃▃▃▃▃▂▂▂▂▂▃▂▁▂▂▁▂▂▂▂▂▂▂ ▃\n 2.41 ms Histogram: frequency by time 9.53 ms <\n\n Memory estimate: 7.74 MiB, allocs estimate: 38.\n\njulia> Base.summarysize(a)\n16\n\njulia> Base.summarysize(b)\n8000040","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"This improvement is trade off the performance for memory. When accessing each element of the Cauchy typed matrix, more time is needed than the Matrix typed matrix, which is expected. This can allow machines with insufficient memory to take longer time to run computations that would have been impossible to run before.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> @benchmark det(a)\nBenchmarkTools.Trial: 111 samples with 1 evaluation.\n Range (min … max): 20.537 ms … 353.410 ms ┊ GC (min … max): 0.00% … 90.93%\n Time (median): 34.151 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 45.104 ms ± 42.894 ms ┊ GC (mean ± σ): 7.81% ± 9.53%\n\n ▄█▅▃ ▁\n ▅████▇█▁▆▅▁▁▁▅▅▁▁▅▁▁▅▁▁▁▆▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▅ ▅\n 20.5 ms Histogram: log(frequency) by time 301 ms <\n\n Memory estimate: 7.64 MiB, allocs estimate: 4.\n\njulia> @benchmark det(b)\nBenchmarkTools.Trial: 175 samples with 1 evaluation.\n Range (min … max): 18.639 ms … 314.529 ms ┊ GC (min … max): 0.00% … 91.89%\n Time (median): 26.317 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 28.670 ms ± 22.610 ms ┊ GC (mean ± σ): 7.81% ± 8.48%\n\n ▂ ▂▂ ██ ▂▂ ▃ ▅ ▅▂ ▃▂\n ▅▁▃▇█▇██████▆██▅█▅█▅███████▇▆▁▁▆▆▃▁▆▅▅▅▁▁▁▁▁▁▁▃▅▃▁▁▅▁▁▁▁▃▃▁▃ ▃\n 18.6 ms Histogram: frequency by time 44.1 ms <\n\n Memory estimate: 7.64 MiB, allocs estimate: 4.\n\njulia> @benchmark sum(a)\nBenchmarkTools.Trial: 3104 samples with 1 evaluation.\n Range (min … max): 1.124 ms … 7.772 ms ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 1.400 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 1.604 ms ± 579.750 μs ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n █▃▁█▄ ▂ \n █████▇██▇█▆▃▄▄▃▄▃▄▃▄▃▃▃▃▃▃▃▂▃▃▂▂▂▂▂▂▃▃▂▃▂▂▃▃▃▂▃▂▂▂▂▂▂▂▂▂▂▁▂ ▃\n 1.12 ms Histogram: frequency by time 3.56 ms <\n\n Memory estimate: 16 bytes, allocs estimate: 1.\n\njulia> @benchmark sum(b)\nBenchmarkTools.Trial: 10000 samples with 1 evaluation.\n Range (min … max): 243.900 μs … 2.106 ms ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 329.800 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 355.504 μs ± 91.684 μs ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n ▂▅█▇▅▃▃▂▁▁▁▁\n ▁▄██████████████▇▆▆▆▆▆▆▆▄▄▄▄▄▄▃▃▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁ ▃\n 244 μs Histogram: frequency by time 647 μs <\n\n Memory estimate: 16 bytes, allocs estimate: 1.","category":"page"},{"location":"references/3.properties/#Properties","page":"Properties","title":"Properties","text":"","category":"section"},{"location":"references/3.properties/","page":"Properties","title":"Properties","text":"Some documentation of the following properties are adapted from MatrixDepot.jl.","category":"page"},{"location":"references/3.properties/","page":"Properties","title":"Properties","text":"TypedMatrices.PropertyTypes.AbstractProperty\nTypedMatrices.PropertyTypes.Symmetric\nTypedMatrices.PropertyTypes.Inverse\nTypedMatrices.PropertyTypes.Involutory\nTypedMatrices.PropertyTypes.Integer\nTypedMatrices.PropertyTypes.IllCond\nTypedMatrices.PropertyTypes.PosDef\nTypedMatrices.PropertyTypes.Correlation\nTypedMatrices.PropertyTypes.Eigen\nTypedMatrices.PropertyTypes.Sparse\nTypedMatrices.PropertyTypes.Random\nTypedMatrices.PropertyTypes.RegProb\nTypedMatrices.PropertyTypes.Graph\nTypedMatrices.PropertyTypes.TotNonNeg\nTypedMatrices.PropertyTypes.TotPos\nTypedMatrices.PropertyTypes.InfDiv\nTypedMatrices.PropertyTypes.Indefinite\nTypedMatrices.PropertyTypes.Defective\nTypedMatrices.PropertyTypes.Nilpotent\nTypedMatrices.PropertyTypes.Hessenberg\nTypedMatrices.PropertyTypes.Toeplitz\nTypedMatrices.PropertyTypes.Binary\nTypedMatrices.PropertyTypes.RankDef\nTypedMatrices.PropertyTypes.Circulant\nTypedMatrices.PropertyTypes.Normal\nTypedMatrices.PropertyTypes.Orthogonal\nTypedMatrices.PropertyTypes.Bidiagonal\nTypedMatrices.PropertyTypes.Tridiagonal\nTypedMatrices.PropertyTypes.Triangular\nTypedMatrices.PropertyTypes.SingVal\nTypedMatrices.PropertyTypes.Rectangular\nTypedMatrices.PropertyTypes.Hankel\nTypedMatrices.PropertyTypes.DiagDom\nTypedMatrices.PropertyTypes.NonNeg\nTypedMatrices.PropertyTypes.Unimodular\nTypedMatrices.PropertyTypes.Positive\nTypedMatrices.PropertyTypes.FixedSize\nTypedMatrices.PropertyTypes.Complex","category":"page"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.AbstractProperty","page":"Properties","title":"TypedMatrices.PropertyTypes.AbstractProperty","text":"This is an abstract type for properties.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Symmetric","page":"Properties","title":"TypedMatrices.PropertyTypes.Symmetric","text":"The matrix is symmetric for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Inverse","page":"Properties","title":"TypedMatrices.PropertyTypes.Inverse","text":"The inverse of the matrix is known explicitly.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Involutory","page":"Properties","title":"TypedMatrices.PropertyTypes.Involutory","text":"The matrix is a Involutory matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Integer","page":"Properties","title":"TypedMatrices.PropertyTypes.Integer","text":"The matrix has integer entries.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.IllCond","page":"Properties","title":"TypedMatrices.PropertyTypes.IllCond","text":"The matrix is ill-conditioned for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.PosDef","page":"Properties","title":"TypedMatrices.PropertyTypes.PosDef","text":"The matrix is positive definite for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Correlation","page":"Properties","title":"TypedMatrices.PropertyTypes.Correlation","text":"Correlation\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Eigen","page":"Properties","title":"TypedMatrices.PropertyTypes.Eigen","text":"Part of the eigensystem of the matrix is explicitly known.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Sparse","page":"Properties","title":"TypedMatrices.PropertyTypes.Sparse","text":"The matrix is sparse.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Random","page":"Properties","title":"TypedMatrices.PropertyTypes.Random","text":"The matrix has random entries.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.RegProb","page":"Properties","title":"TypedMatrices.PropertyTypes.RegProb","text":"The output is a test problem for Regularization Methods.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Graph","page":"Properties","title":"TypedMatrices.PropertyTypes.Graph","text":"An adjacency matrix of a graph.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.TotNonNeg","page":"Properties","title":"TypedMatrices.PropertyTypes.TotNonNeg","text":"TotNonNeg\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.TotPos","page":"Properties","title":"TypedMatrices.PropertyTypes.TotPos","text":"TotPos\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.InfDiv","page":"Properties","title":"TypedMatrices.PropertyTypes.InfDiv","text":"InfDiv\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Indefinite","page":"Properties","title":"TypedMatrices.PropertyTypes.Indefinite","text":"The matrix is indefinite for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Defective","page":"Properties","title":"TypedMatrices.PropertyTypes.Defective","text":"Defective\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Nilpotent","page":"Properties","title":"TypedMatrices.PropertyTypes.Nilpotent","text":"Nilpotent\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Hessenberg","page":"Properties","title":"TypedMatrices.PropertyTypes.Hessenberg","text":"The matrix is a Hessenberg matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Toeplitz","page":"Properties","title":"TypedMatrices.PropertyTypes.Toeplitz","text":"The matrix is a Toeplitz matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Binary","page":"Properties","title":"TypedMatrices.PropertyTypes.Binary","text":"The matrix has binary entries.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.RankDef","page":"Properties","title":"TypedMatrices.PropertyTypes.RankDef","text":"RankDef\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Circulant","page":"Properties","title":"TypedMatrices.PropertyTypes.Circulant","text":"The matrix is a Circulant matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Normal","page":"Properties","title":"TypedMatrices.PropertyTypes.Normal","text":"Normal\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Orthogonal","page":"Properties","title":"TypedMatrices.PropertyTypes.Orthogonal","text":"The matrix is orthogonal for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Bidiagonal","page":"Properties","title":"TypedMatrices.PropertyTypes.Bidiagonal","text":"The matrix is bidiagonal (eigher upper or lower).\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Tridiagonal","page":"Properties","title":"TypedMatrices.PropertyTypes.Tridiagonal","text":"The matrix is tridiagonal.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Triangular","page":"Properties","title":"TypedMatrices.PropertyTypes.Triangular","text":"The matrix is triangular (eigher upper or lower).\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.SingVal","page":"Properties","title":"TypedMatrices.PropertyTypes.SingVal","text":"SingVal\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Rectangular","page":"Properties","title":"TypedMatrices.PropertyTypes.Rectangular","text":"The matrix is rectangular.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Hankel","page":"Properties","title":"TypedMatrices.PropertyTypes.Hankel","text":"The matrix is a Hankel matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.DiagDom","page":"Properties","title":"TypedMatrices.PropertyTypes.DiagDom","text":"DiagDom\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.NonNeg","page":"Properties","title":"TypedMatrices.PropertyTypes.NonNeg","text":"NonNeg\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Unimodular","page":"Properties","title":"TypedMatrices.PropertyTypes.Unimodular","text":"Unimodular\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Positive","page":"Properties","title":"TypedMatrices.PropertyTypes.Positive","text":"The matrix is positive for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.FixedSize","page":"Properties","title":"TypedMatrices.PropertyTypes.FixedSize","text":"The matrix has a fixed size.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Complex","page":"Properties","title":"TypedMatrices.PropertyTypes.Complex","text":"The matrix has complex entries.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#Builtin-Matrices","page":"Builtin Matrices","title":"Builtin Matrices","text":"","category":"section"},{"location":"references/4.builtin-matrices/","page":"Builtin Matrices","title":"Builtin Matrices","text":"TypedMatrices.Binomial\nTypedMatrices.Cauchy\nTypedMatrices.ChebSpec\nTypedMatrices.Chow\nTypedMatrices.Circulant\nTypedMatrices.Clement\nTypedMatrices.Companion\nTypedMatrices.Comparison\nTypedMatrices.Cycol\nTypedMatrices.DingDong\nTypedMatrices.Dorr\nTypedMatrices.Dramadah\nTypedMatrices.Fiedler\nTypedMatrices.Forsythe\nTypedMatrices.Frank\nTypedMatrices.GCDMat\nTypedMatrices.GearMat\nTypedMatrices.Golub\nTypedMatrices.Grcar\nTypedMatrices.Hadamard\nTypedMatrices.Hankel\nTypedMatrices.Hanowa\nTypedMatrices.Hilbert\nTypedMatrices.InverseHilbert\nTypedMatrices.Invhess\nTypedMatrices.Involutory\nTypedMatrices.Ipjfact\nTypedMatrices.JordBloc\nTypedMatrices.Kahan\nTypedMatrices.KMS\nTypedMatrices.Krylov\nTypedMatrices.Lauchli\nTypedMatrices.Lehmer\nTypedMatrices.Leslie\nTypedMatrices.Lesp\nTypedMatrices.Lotkin\nTypedMatrices.Magic\nTypedMatrices.Minij\nTypedMatrices.Moler\nTypedMatrices.Neumann\nTypedMatrices.Orthog\nTypedMatrices.Oscillate\nTypedMatrices.Parter\nTypedMatrices.Pascal\nTypedMatrices.Pei\nTypedMatrices.Poisson\nTypedMatrices.Prolate\nTypedMatrices.Randcolu\nTypedMatrices.Randcorr\nTypedMatrices.Randjorth\nTypedMatrices.Rando\nTypedMatrices.RandSVD\nTypedMatrices.Redheff\nTypedMatrices.Riemann\nTypedMatrices.RIS\nTypedMatrices.Rohess\nTypedMatrices.Rosser\nTypedMatrices.Sampling\nTypedMatrices.Smoke\nTypedMatrices.Toeplitz\nTypedMatrices.Triw\nTypedMatrices.Wathen\nTypedMatrices.Wilkinson","category":"page"},{"location":"references/4.builtin-matrices/#TypedMatrices.Binomial","page":"Builtin Matrices","title":"TypedMatrices.Binomial","text":"Binomial Matrix\n\nThe matrix is a multiple of an involutory matrix.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nG. Boyd, C.A. Micchelli, G. Strang and D.X. Zhou, Binomial matrices, Adv. in Comput. Math., 14 (2001), pp 379-391.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Cauchy","page":"Builtin Matrices","title":"TypedMatrices.Cauchy","text":"Cauchy Matrix\n\nGiven two vectors x and y, the (i,j) entry of the Cauchy matrix is 1/(x[i]+y[j]).\n\nInput Options\n\nx: an integer, as vectors 1:x and 1:x.\nx, y: two integers, as vectors 1:x and 1:y.\nx: a vector. y defaults to x.\nx, y: two vectors.\n\nReferences\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.ChebSpec","page":"Builtin Matrices","title":"TypedMatrices.ChebSpec","text":"Chebyshev Spectral Differentiation Matrix\n\nIf k = 0,the generated matrix is nilpotent and a vector with all one entries is a null vector. If k = 1, the generated matrix is nonsingular and well-conditioned. Its eigenvalues have negative real parts.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix and k = 0 or 1.\ndim: k=0.\n\nReferences\n\nL. N. Trefethen and M. R. Trummer, An instability phenomenon in spectral methods, SIAM J. Numer. Anal., 24 (1987), pp. 1008-1023.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Chow","page":"Builtin Matrices","title":"TypedMatrices.Chow","text":"Chow Matrix\n\nThe Chow matrix is a singular Toeplitz lower Hessenberg matrix.\n\nInput Options\n\ndim, alpha, delta: dim is dimension of the matrix. alpha, delta are scalars such that A[i,i] = alpha + delta and A[i,j] = alpha^(i + 1 -j) for j + 1 <= i.\ndim: alpha = 1, delta = 0.\n\nReferences\n\nT. S. Chow, A class of Hessenberg matrices with known eigenvalues and inverses, SIAM Review, 11 (1969), pp. 391-395.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Circulant","page":"Builtin Matrices","title":"TypedMatrices.Circulant","text":"Circulant Matrix\n\nA circulant matrix has the property that each row is obtained by cyclically permuting the entries of the previous row one step forward.\n\nInput Options\n\nvec: a vector.\ndim: an integer, as vector 1:dim.\n\nReferences\n\nP. J. Davis, Circulant Matrices, John Wiley, 1977.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Clement","page":"Builtin Matrices","title":"TypedMatrices.Clement","text":"Clement Matrix\n\nThe Clement matrix is a tridiagonal matrix with zero diagonal entries. If k = 1, the matrix is symmetric.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix. If k = 0, the matrix is of type Tridiagonal. If k = 1, the matrix is of type SymTridiagonal.\ndim: k = 0.\n\nReferences\n\nP. A. Clement, A class of triple-diagonal matrices for test purposes, SIAM Review, 1 (1959), pp. 50-52.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Companion","page":"Builtin Matrices","title":"TypedMatrices.Companion","text":"Companion Matrix\n\nThe companion matrix to a monic polynomial a(x) = a_0 + a_1x + ... + a_{n-1}x^{n-1} + x^n is the n-by-n matrix with ones on the subdiagonal and the last column given by the coefficients of a(x).\n\nInput Options\n\nvec: vec is a vector of coefficients.\ndim: vec = [1:dim;]. dim is the dimension of the matrix.\npolynomial: polynomial is a polynomial. vector will be appropriate values from coefficients.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Comparison","page":"Builtin Matrices","title":"TypedMatrices.Comparison","text":"Comparison Matrix\n\nThe comparison matrix for another matrix.\n\nInput Options\n\nB, k: B is a matrix. k = 0: each element is absolute value of B, except each diagonal element is negative absolute value. k = 1: each diagonal element is absolute value of B, except each off-diagonal element is negative largest absolute value in the same row.\nB: B is a matrix and k = 1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Cycol","page":"Builtin Matrices","title":"TypedMatrices.Cycol","text":"Cycol Matrix\n\nThe cycol matrix repeats columns.\n\nInput Options\n\nm, n, k: m and n are size of the matrix. The repetition is randn(m, k).\nn, k: n is size of the matrix. The repetition is randn(n, k).\nn: n is size of the matrix. k = round(n/4)\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.DingDong","page":"Builtin Matrices","title":"TypedMatrices.DingDong","text":"Dingdong Matrix\n\nThe Dingdong matrix is a symmetric Hankel matrix invented by DR. F. N. Ris of IBM, Thomas J Watson Research Centre. The eigenvalues cluster around π/2 and -π/2.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nJ. C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Dorr","page":"Builtin Matrices","title":"TypedMatrices.Dorr","text":"Dorr Matrix\n\nDorr Matrix is a diagonally dominant, illcond, tridiagonal sparse matrix.\n\nInput Options\n\ndim, theta: dim is the dimension of the matrix and theta is the parameter of the matrix.\ndim: theta = 0.01.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Dramadah","page":"Builtin Matrices","title":"TypedMatrices.Dramadah","text":"Dramadah Matrix\n\nDramadah matrix is a matrix with 0s and 1s.\n\nInput Options\n\ndim, k: the dimension of the matrix and k. k = 1 abs(det(A)) = 1, the inverse has integer entries. k = 2 the inverse has integer entries. k = 3 det(A) is equal to nth Fibonacci number.\ndim: k = 1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Fiedler","page":"Builtin Matrices","title":"TypedMatrices.Fiedler","text":"Fiedler Matrix\n\nThe Fiedler matrix is symmetric matrix with a dominant positive eigenvalue and all the other eigenvalues are negative.\n\nInput Options\n\nvec: a vector.\ndim: dim is the dimension of the matrix. vec=[1:dim;].\n\nReferences\n\nG. Szego, Solution to problem 3705, Amer. Math. Monthly, 43 (1936), pp. 246-259.\n\nJ. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra, Birkhauser, Basel, and Academic Press, New York, 1977, p. 159.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Forsythe","page":"Builtin Matrices","title":"TypedMatrices.Forsythe","text":"Forsythe Matrix\n\nThe Forsythe matrix is a n-by-n perturbed Jordan block. This generator is adapted from N. J. Higham's Test Matrix Toolbox.\n\nInput Options\n\ndim, alpha, lambda: dim is the dimension of the matrix. alpha and lambda are scalars.\ndim: alpha = sqrt(eps(type)) and lambda = 0.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Frank","page":"Builtin Matrices","title":"TypedMatrices.Frank","text":"Frank Matrix\n\nThe Frank matrix is an upper Hessenberg matrix with determinant 1. The eigenvalues are real, positive and very ill conditioned.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix, k = 0 or 1. If k = 1 the matrix reflect about the anti-diagonal.\ndim: the dimension of the matrix.\n\nReferences\n\nW. L. Frank, Computing eigenvalues of complex matrices by determinant evaluation and by methods of Danilewski and Wielandt, J. Soc. Indust. Appl. Math., 6 (1958), pp. 378-392 (see pp. 385, 388).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.GCDMat","page":"Builtin Matrices","title":"TypedMatrices.GCDMat","text":"GCDMat Matrix\n\nA matrix with (i,j) entry gcd(i,j). It is a symmetric positive definite matrix.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.GearMat","page":"Builtin Matrices","title":"TypedMatrices.GearMat","text":"Gear Matrix\n\nA gear matrix. 1's on the sub and super diagonal, sign(i) on the (1,abs(i)) and sign(j) on the (n,n+1-abs(j)) position, other elements are 0.\n\nInput Options\n\ndim: the dimension of the matrix. i = n and j = -n by default.\ndim, i, j: the dimension of the matrix and the position of the 1's.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Golub","page":"Builtin Matrices","title":"TypedMatrices.Golub","text":"Golub Matrix\n\nGolub matrix is the product of two random unit lower and upper triangular matrices respectively. LU factorization without pivoting fails to reveal that such matrices are badly conditioned.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nD. Viswanath and N. Trefethen. Condition Numbers of Random Triangular Matrices, SIAM J. Matrix Anal. Appl. 19, 564-581, 1998.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Grcar","page":"Builtin Matrices","title":"TypedMatrices.Grcar","text":"Grcar Matrix\n\nThe Grcar matrix is a Toeplitz matrix with sensitive eigenvalues.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix and k is the number of superdiagonals.\ndim: the dimension of the matrix.\n\nReferences\n\nJ. F. Grcar, Operator coefficient methods for linear equations, Report SAND89-8691, Sandia National Laboratories, Albuquerque, New Mexico, 1989 (Appendix 2).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hadamard","page":"Builtin Matrices","title":"TypedMatrices.Hadamard","text":"Hadamard Matrix\n\nThe Hadamard matrix is a square matrix whose entries are 1 or -1. It was named after Jacques Hadamard. The rows of a Hadamard matrix are orthogonal.\n\nInput Options\n\ndim: the dimension of the matrix, dim is a power of 2.\n\nReferences\n\nS. W. Golomb and L. D. Baumert, The search for Hadamard matrices, Amer. Math. Monthly, 70 (1963) pp. 12-17\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hankel","page":"Builtin Matrices","title":"TypedMatrices.Hankel","text":"Hankel Matrix\n\nA Hankel matrix is a matrix that is symmetric and constant across the anti-diagonals.\n\nInput Options\n\nvc, vr: vc and vc are the first column and last row of the matrix. If the last element of vc differs from the first element of vr, the last element of rc prevails.\nv: a vector, as vc = v and vr will be zeros.\ndim: dim is the dimension of the matrix. v = [1:dim;].\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hanowa","page":"Builtin Matrices","title":"TypedMatrices.Hanowa","text":"Hanowa Matrix\n\nThe Hanowa matrix is a matrix which eigenvalues lie on a vertical line in the complex plane.\n\nInput Options\n\ndim: the dimension of the matrix and alpha = -1.\ndim, alpha: the dimension and alpha.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hilbert","page":"Builtin Matrices","title":"TypedMatrices.Hilbert","text":"Hilbert Matrix\n\nThe Hilbert matrix has (i,j) element 1/(i+j-1). It is notorious for being ill conditioned. It is symmetric positive definite and totally positive.\n\nSee also InverseHilbert.\n\nInput Options\n\ndim: the dimension of the matrix.\nrow_dim, col_dim: the row and column dimensions.\n\nReferences\n\nM. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.InverseHilbert","page":"Builtin Matrices","title":"TypedMatrices.InverseHilbert","text":"Inverse of the Hilbert Matrix\n\nSee also Hilbert.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nM. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Invhess","page":"Builtin Matrices","title":"TypedMatrices.Invhess","text":"Invhess Matrix\n\nInverse of upper Hessenberg matrix.\n\nInput Options\n\ndim: the dimension of the matrix. x = [1:dim;].\nx: x vector. y = -x[1:end-1].\nx, y: x and y vectors.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Involutory","page":"Builtin Matrices","title":"TypedMatrices.Involutory","text":"Involutory Matrix\n\nAn involutory matrix is a matrix that is its own inverse.\n\nInput Options\n\ndim: dim is the dimension of the matrix.\n\nReferences\n\nA. S. Householder and J. A. Carpenter, The singular values of involutory and of idempotent matrices, Numer. Math. 5 (1963), pp. 234-237.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Ipjfact","page":"Builtin Matrices","title":"TypedMatrices.Ipjfact","text":"Ipjfact Matrix\n\nHankel matrix with factorial elements.\n\nInput Options\n\ndim: the dimension of the matrix.\ndim, k: k = 0 element (i, j) is factorial(i + j). k = 1 element (i, j) is 1 / factorial(i + j).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.JordBloc","page":"Builtin Matrices","title":"TypedMatrices.JordBloc","text":"Jordan Block Matrix\n\nJordan block matrix with lambda on the diagonal and 1 on the superdiagonal. It's eigenvalues are lambda.\n\nInput Options\n\ndim: dimension of the matrix. lambda = 1.\ndim, lambda: dimension of the matrix and the lambda.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Kahan","page":"Builtin Matrices","title":"TypedMatrices.Kahan","text":"Kahan Matrix\n\nThe Kahan matrix is an upper trapezoidal matrix, i.e., the (i,j) element is equal to 0 if i > j. The useful range of θ is 0 < θ < π. The diagonal is perturbed by pert*eps()*diagm([n:-1:1;]).\n\nInput Options\n\nrowdim, coldim, θ, pert: rowdim and coldim are the row and column dimensions of the matrix. θ and pert are scalars.\ndim, θ, pert: dim is the dimension of the matrix.\ndim: θ = 1.2, pert = 25.\n\nReferences\n\nW. Kahan, Numerical linear algebra, Canadian Math. Bulletin, 9 (1966), pp. 757-801.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.KMS","page":"Builtin Matrices","title":"TypedMatrices.KMS","text":"Kac-Murdock-Szego Toeplitz matrix\n\nInput Options\n\ndim, rho: dim is the dimension of the matrix, rho is a scalar such that A[i,j] = rho^(abs(i-j)).\ndim: rho = 0.5.\n\nReferences\n\nW. F. Trench, Numerical solution of the eigenvalue problem for Hermitian Toeplitz matrices, SIAM J. Matrix Analysis and Appl., 10 (1989), pp. 135-146 (and see the references therein).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Krylov","page":"Builtin Matrices","title":"TypedMatrices.Krylov","text":"Krylov Matrix\n\nKrylow matrix equal to [x, Bx, B^2x, ..., B^(k-1)*x].\n\nInput Options\n\ndim: dimension of the matrix. A = randn(dim, dim). x = ones(dim). k = dim.\ndim, x: dimension of the matrix and x.\ndim, x, k: dimension of the matrix, x and k.\nA: matrix. x = ones(size(A, 1)). k = size(A, 1).\nA, x: matrix and x. k = size(A, 1).\nA, x, k: matrix, x and k.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lauchli","page":"Builtin Matrices","title":"TypedMatrices.Lauchli","text":"Lauchli Matrix\n\nA matrix with ones on the first row, mu on the subdiagonal, and zeros elsewhere.\n\nInput Options\n\ndim: the dimension of the matrix. mu = sqrt(eps()) by default.\ndim, mu: the dimension and subdiagonal value of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lehmer","page":"Builtin Matrices","title":"TypedMatrices.Lehmer","text":"Lehmer Matrix\n\nThe Lehmer matrix is a symmetric positive definite matrix. It is totally nonnegative. The inverse is tridiagonal and explicitly known\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nM. Newman and J. Todd, The evaluation of matrix inversion programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476. Solutions to problem E710 (proposed by D.H. Lehmer): The inverse of a matrix, Amer. Math. Monthly, 53 (1946), pp. 534-535.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Leslie","page":"Builtin Matrices","title":"TypedMatrices.Leslie","text":"Leslie Matrix\n\nMatrix for birth numbers and survival rates in the Leslie population model.\n\nInput Options\n\ndim: the dimension of the matrix. x = ones(n) and y = ones(n - 1) by default.\nx, y: x and y.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lesp","page":"Builtin Matrices","title":"TypedMatrices.Lesp","text":"Lesp Matrix\n\nA matrix with eigenvalues smoothly distributed in the interval [-2*n-3.5,-4.5].\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lotkin","page":"Builtin Matrices","title":"TypedMatrices.Lotkin","text":"Lotkin Matrix\n\nThe Lotkin matrix is the Hilbert matrix with its first row altered to all ones. It is unsymmetric, illcond and has many negative eigenvalues of small magnitude.\n\nInput Options\n\ndim: dim is the dimension of the matrix.\n\nReferences\n\nM. Lotkin, A set of test matrices, MTAC, 9 (1955), pp. 153-161.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Magic","page":"Builtin Matrices","title":"TypedMatrices.Magic","text":"Magic Square Matrix\n\nThe magic matrix is a matrix with integer entries such that the row elements, column elements, diagonal elements and anti-diagonal elements all add up to the same number.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Minij","page":"Builtin Matrices","title":"TypedMatrices.Minij","text":"MIN[I,J] Matrix\n\nA matrix with (i,j) entry min(i,j). It is a symmetric positive definite matrix. The eigenvalues and eigenvectors are known explicitly. Its inverse is tridiagonal.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nJ. Fortiana and C. M. Cuadras, A family of matrices, the discretized Brownian bridge, and distance-based regression, Linear Algebra Appl., 264 (1997), 173-188. (For the eigensystem of A.)\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Moler","page":"Builtin Matrices","title":"TypedMatrices.Moler","text":"Moler Matrix\n\nThe Moler matrix is a symmetric positive definite matrix. It has one small eigenvalue.\n\nInput Options\n\ndim, alpha: dim is the dimension of the matrix, alpha is a scalar.\ndim: alpha = -1.\n\nReferences\n\nJ.C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Neumann","page":"Builtin Matrices","title":"TypedMatrices.Neumann","text":"Neumann Matrix\n\nA singular matrix from the discrete Neumann problem. The matrix is sparse and the null space is formed by a vector of ones\n\nInput Options\n\ndim: the dimension of the matrix, must be a perfect square integer.\n\nReferences\n\nR. J. Plemmons, Regular splittings and the discrete Neumann problem, Numer. Math., 25 (1976), pp. 153-161.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Orthog","page":"Builtin Matrices","title":"TypedMatrices.Orthog","text":"Orthogonal Matrix\n\nOrthogonal and nearly orthogonal matrices.\n\nInput Options\n\ndim: the dimension of the matrix. k = 1 by default.\ndim, k: the dimension and type of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Oscillate","page":"Builtin Matrices","title":"TypedMatrices.Oscillate","text":"Oscillating Matrix\n\nA matrix A is called oscillating if A is totally nonnegative and if there exists an integer q > 0 such that A^q is totally positive.\n\nInput Options\n\nΣ: the singular value spectrum of the matrix.\ndim, mode: dim is the dimension of the matrix. mode = 1: geometrically distributed singular values. mode = 2: arithmetrically distributed singular values.\ndim: mode = 1.\n\nReferences\n\nPer Christian Hansen, Test matrices for regularization methods. SIAM J. SCI. COMPUT Vol 16, No2, pp 506-512 (1995).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Parter","page":"Builtin Matrices","title":"TypedMatrices.Parter","text":"Parter Matrix\n\nThe Parter matrix is a Toeplitz and Cauchy matrix with singular values near π.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nThe MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2. S. V. Parter, On the distribution of the singular values of Toeplitz matrices, Linear Algebra and Appl., 80 (1986), pp. 115-130.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Pascal","page":"Builtin Matrices","title":"TypedMatrices.Pascal","text":"Pascal Matrix\n\nThe Pascal matrix’s anti-diagonals form the Pascal’s triangle.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nR. Brawer and M. Pirovino, The linear algebra of the Pascal matrix, Linear Algebra and Appl., 174 (1992), pp. 13-23 (this paper gives a factorization of L = PASCAL(N,1) and a formula for the elements of L^k).\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.4.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Pei","page":"Builtin Matrices","title":"TypedMatrices.Pei","text":"Pei Matrix\n\nThe Pei matrix is a symmetric matrix with known inversion.\n\nInput Options\n\ndim, alpha: dim is the dimension of the matrix. alpha is a scalar.\ndim: the dimension of the matrix.\n\nReferences\n\nM. L. Pei, A test matrix for inversion procedures, Comm. ACM, 5 (1962), p. 508.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Poisson","page":"Builtin Matrices","title":"TypedMatrices.Poisson","text":"Poisson Matrix\n\nA block tridiagonal matrix from Poisson’s equation. This matrix is sparse, symmetric positive definite and has known eigenvalues.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nG. H. Golub and C. F. Van Loan, Matrix Computations, second edition, Johns Hopkins University Press, Baltimore, Maryland, 1989 (Section 4.5.4).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Prolate","page":"Builtin Matrices","title":"TypedMatrices.Prolate","text":"Prolate Matrix\n\nA prolate matrix is a symmetirc, ill-conditioned Toeplitz matrix.\n\nInput Options\n\ndim, alpha: dim is the dimension of the matrix. w is a real scalar.\ndim: the case when w = 0.25.\n\nReferences\n\nJ. M. Varah. The Prolate Matrix. Linear Algebra and Appl. 187:267–278, 1993.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Randcolu","page":"Builtin Matrices","title":"TypedMatrices.Randcolu","text":"Randcolu Matrix\n\nRandom matrix with normalized columns and given singular values.\n\nInput Options\n\ndim: the dimension of the matrix, x will be generated randomly.\nn, m: the size of the matrix.\nn, m, k: size and k flag. Enable initial transformation if k = 0.\nx: the x vector.\nx, m: the x vector and m.\nx, m, k: the x vector, m, and k flag.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Randcorr","page":"Builtin Matrices","title":"TypedMatrices.Randcorr","text":"Random Correlation Matrix\n\nA random correlation matrix is a symmetric positive semidefinite matrix with 1s on the diagonal.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Randjorth","page":"Builtin Matrices","title":"TypedMatrices.Randjorth","text":"Randjorth Matrix\n\nThis matrix is currently not implemented.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Rando","page":"Builtin Matrices","title":"TypedMatrices.Rando","text":"Random Matrix with Element -1, 0, 1\n\nInput Options\n\nrowdim, coldim, k: row_dim and col_dim are row and column dimensions, k = 1: entries are 0 or 1. k = 2: entries are -1 or 1. k = 3: entries are -1, 0 or 1.\ndim, k: row_dim = col_dim = dim.\ndim: k = 1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.RandSVD","page":"Builtin Matrices","title":"TypedMatrices.RandSVD","text":"Random Matrix with Pre-assigned Singular Values\n\nInput Options\n\nrowdim, coldim, kappa, mode: row_dim and col_dim are the row and column dimensions. kappa is the condition number of the matrix. mode = 1: one large singular value. mode = 2: one small singular value. mode = 3: geometrically distributed singular values. mode = 4: arithmetrically distributed singular values. mode = 5: random singular values with unif. dist. logarithm.\ndim, kappa, mode: row_dim = col_dim = dim.\ndim, kappa: mode = 3.\ndim: kappa = sqrt(1/eps()), mode = 3.\n\nReferences\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.3.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Redheff","page":"Builtin Matrices","title":"TypedMatrices.Redheff","text":"Redheffer Matrix\n\nRedheffer matrix of 1s and 0s.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Riemann","page":"Builtin Matrices","title":"TypedMatrices.Riemann","text":"Riemann Matrix\n\nA matrix associated with the Riemann hypothesis.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.RIS","page":"Builtin Matrices","title":"TypedMatrices.RIS","text":"RIS Matrix\n\nThe RIS matrix has (i,j) element 0.5/(n-i-j+1.5). It is symmetric.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Rohess","page":"Builtin Matrices","title":"TypedMatrices.Rohess","text":"Random Orthogonal Upper Hessenberg Matrix\n\nThe matrix is constructed via a product of Givens rotations.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nW. B. Gragg, The QR algorithm for unitary Hessenberg matrices, J. Comp. Appl. Math., 16 (1986), pp. 1-8.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Rosser","page":"Builtin Matrices","title":"TypedMatrices.Rosser","text":"Rosser Matrix\n\nThe Rosser matrix’s eigenvalues are very close together so it is a challenging matrix for many eigenvalue algorithms.\n\nInput Options\n\ndim, a, b: dim is the dimension of the matrix. dim must be a power of 2. a and b are scalars. For dim = 8, a = 2 and b = 1, the generated matrix is the test matrix used by Rosser.\ndim: a = rand(1:5), b = rand(1:5).\n\nReferences\n\nJ. B. Rosser, C. Lanczos, M. R. Hestenes, W. Karush, Separation of close eigenvalues of a real symmetric matrix, Journal of Research of the National Bureau of Standards, v(47) (1951)\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Sampling","page":"Builtin Matrices","title":"TypedMatrices.Sampling","text":"Matrix with Application in Sampling Theory\n\nA nonsymmetric matrix with eigenvalues 0, 1, 2, ... n-1.\n\nInput Options\n\nvec: vec is a vector with no repeated elements.\ndim: dim is the dimension of the matrix. vec = [1:dim;]/dim.\n\nReferences\n\nL. Bondesson and I. Traat, A nonsymmetric matrix with integer eigenvalues, linear and multilinear algebra, 55(3) (2007), pp. 239-247\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Smoke","page":"Builtin Matrices","title":"TypedMatrices.Smoke","text":"Smoke Matrix\n\nComplex matrix with a \"smoke ring\" pseudospectrum. 1's on the superdiagonal, cos(w) + sin(w) * im on the diagonal. The A(n, 1)` entry is 1 if k = 0, 0 if k = 1.\n\nInput Options\n\ndim: dimension of the matrix. k = 0.\ndim, k: dimension of the matrix and the k.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Toeplitz","page":"Builtin Matrices","title":"TypedMatrices.Toeplitz","text":"Toeplitz Matrix\n\nA Toeplitz matrix is a matrix in which each descending diagonal from left to right is constant.\n\nInput Options\n\nvc, vr: vc and vr are the first column and row of the matrix.\nv: symmatric case, i.e., vc = vr = v.\ndim: dim is the dimension of the matrix. v = [1:dim;] is the first row and column vector.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Triw","page":"Builtin Matrices","title":"TypedMatrices.Triw","text":"Triw Matrix\n\nUpper triangular matrices discussed by Wilkinson and others.\n\nInput Options\n\nrowdim, coldim, α, k: row_dim and col_dim are row and column dimension of the matrix. α is a scalar representing the entries on the superdiagonals. k is the number of superdiagonals.\ndim: the dimension of the matrix.\n\nReferences\n\nG. H. Golub and J. H. Wilkinson, Ill-conditioned eigensystems and the computation of the Jordan canonical form, SIAM Review, 18(4), 1976, pp. 578-6\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Wathen","page":"Builtin Matrices","title":"TypedMatrices.Wathen","text":"Wathen Matrix\n\nWathen Matrix is a sparse, symmetric positive, random matrix arose from the finite element method. The generated matrix is the consistent mass matrix for a regular nx-by-ny grid of 8-nodes.\n\nInput Options\n\n[type,] nx, ny: the dimension of the matrix is equal to 3 * nx * ny + 2 * nx * ny + 1.\n[type,] n: nx = ny = n.\n\nGroups: [\"symmetric\", \"posdef\", \"eigen\", \"random\", \"sparse\"]\n\nReferences\n\nA. J. Wathen, Realistic eigenvalue bounds for the Galerkin mass matrix, IMA J. Numer. Anal., 7 (1987), pp. 449-457.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Wilkinson","page":"Builtin Matrices","title":"TypedMatrices.Wilkinson","text":"Wilkinson Matrix\n\nThe Wilkinson matrix is a symmetric tridiagonal matrix with pairs of nearly equal eigenvalues. The most frequently used case is matrixdepot(\"wilkinson\", 21). The result is of type Tridiagonal.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nJ. H. Wilkinson, Error analysis of direct methods of matrix inversion, J. Assoc. Comput. Mach., 8 (1961), pp. 281-330.\n\n\n\n\n\n","category":"type"},{"location":"manual/1.getting-started/#Getting-Started","page":"Getting Started","title":"Getting Started","text":"","category":"section"},{"location":"manual/1.getting-started/#Installation","page":"Getting Started","title":"Installation","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"TypedMatrices.jl is a registered package in the Julia package registry. Use Julia's package manager to install it:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"pkg> add TypedMatrices","category":"page"},{"location":"manual/1.getting-started/#Setup","page":"Getting Started","title":"Setup","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Use the package:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"using TypedMatrices","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"You can list all matrices available with list_matrices:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices()","category":"page"},{"location":"manual/1.getting-started/#Creating-Matrices","page":"Getting Started","title":"Creating Matrices","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Each type of matrix has its own type and constructors. For example, to create a 5x5 Hilbert matrix:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"h = Hilbert(5)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Most matrices can accept a type parameter to specify the element type. For example, to create a 5x5 Hilbert matrix with Float64 elements:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Hilbert{Float64}(5)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Please check Builtin Matrices for all available builtin matrices.","category":"page"},{"location":"manual/1.getting-started/#Properties","page":"Getting Started","title":"Properties","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Matrix has properties like symmetric, illcond, and posdef. Function properties can be used to get the properties of a matrix:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"properties(Hilbert)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"You can also check properties of a matrix instance for convinience:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"properties(h)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To view all available properties, use list_properties:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_properties()","category":"page"},{"location":"manual/1.getting-started/#Grouping","page":"Getting Started","title":"Grouping","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"This package has a grouping feature to group matrices. All builtin matrices are in the builtin group, we also create a user group for user-defined matrices. You can list all groups with:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_groups()","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To add a matrix to groups and enable it to be listed by list_matrices, use add_to_groups:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"add_to_groups(Matrix, :user, :test)\nlist_matrices(Group(:user))","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"We can also add builtin matrices to our own groups:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"add_to_groups(Hilbert, :test)\nlist_matrices(Group(:test))","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To remove a matrix from a group or all groups, use remove_from_group or remove_from_all_groups. The empty group will automatically be removed:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"remove_from_group(Hilbert, :test)\nremove_from_all_groups(Matrix)\nlist_groups()","category":"page"},{"location":"manual/1.getting-started/#Finding-Matrices","page":"Getting Started","title":"Finding Matrices","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices is very powerful to list matrices, and filter by groups and properties. All arguments are \"and\" relationship, i.e. listed matrices must satisfy all conditions.","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"For example, to list all matrices in the builtin group, and all matrices with symmetric property:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices(Group(:builtin))\nlist_matrices(Property(:symmetric))","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To list all matrices in the builtin group with inverse, illcond, and eigen properties:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices(\n [\n Group(:builtin),\n ],\n [\n Property(:inverse),\n Property(:illcond),\n Property(:eigen),\n ]\n)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To list all matrices with symmetric, eigen, and posdef properties:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices(:symmetric, :eigen, :posdef)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"There are many alternative interfaces using list_matrices, please check the list_matrices or use Julia help system for more information.","category":"page"},{"location":"references/1.types/#Types","page":"Types","title":"Types","text":"","category":"section"},{"location":"references/1.types/","page":"Types","title":"Types","text":"TypedMatrices.PropertyTypes\nTypedMatrices.Property\nTypedMatrices.Group","category":"page"},{"location":"references/1.types/#TypedMatrices.PropertyTypes","page":"Types","title":"TypedMatrices.PropertyTypes","text":"PropertyTypes\n\nTypes of properties.\n\nSee also TypedMatrices.Property, TypedMatrices.list_properties.\n\nExamples\n\njulia> PropertyTypes.Symmetric\nTypedMatrices.PropertyTypes.Symmetric\n\n\n\n\n\n","category":"module"},{"location":"references/1.types/#TypedMatrices.Property","page":"Types","title":"TypedMatrices.Property","text":"Property\n\nProperty type. Similar to symbol, just to distinguish it from group.\n\nSee also list_properties, @properties, properties.\n\n\n\n\n\n","category":"type"},{"location":"references/1.types/#TypedMatrices.Group","page":"Types","title":"TypedMatrices.Group","text":"Group\n\nGroup type. Similar to symbol, just to distinguish it from property.\n\nSee also list_matrices, list_groups, add_to_groups, remove_from_group, remove_from_all_groups.\n\n\n\n\n\n","category":"type"},{"location":"references/2.interfaces/#Interfaces","page":"Interfaces","title":"Interfaces","text":"","category":"section"},{"location":"references/2.interfaces/","page":"Interfaces","title":"Interfaces","text":"TypedMatrices.list_properties\nTypedMatrices.@properties\nTypedMatrices.properties\nTypedMatrices.list_groups\nTypedMatrices.add_to_groups\nTypedMatrices.remove_from_group\nTypedMatrices.remove_from_all_groups\nTypedMatrices.list_matrices","category":"page"},{"location":"references/2.interfaces/#TypedMatrices.list_properties","page":"Interfaces","title":"TypedMatrices.list_properties","text":"list_properties()\n\nList all properties. ```\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.@properties","page":"Interfaces","title":"TypedMatrices.@properties","text":"@properties Type [propa, propb, ...]\n\nRegister properties for a type. The properties are a vector of symbols.\n\nSee also: properties.\n\nExamples\n\njulia> @properties Matrix [:symmetric, :inverse, :illcond, :posdef, :eigen]\n\n\n\n\n\n","category":"macro"},{"location":"references/2.interfaces/#TypedMatrices.properties","page":"Interfaces","title":"TypedMatrices.properties","text":"properties(type)\nproperties(matrix)\n\nGet the properties of a type or matrix.\n\nSee also: @properties.\n\nExamples\n\njulia> @properties Matrix [:symmetric, :posdef]\n\njulia> properties(Matrix)\n2-element Vector{Property}:\n Property(:symmetric)\n Property(:posdef)\n\njulia> properties(Matrix(ones(1, 1)))\n2-element Vector{Property}:\n Property(:symmetric)\n Property(:posdef)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.list_groups","page":"Interfaces","title":"TypedMatrices.list_groups","text":"list_groups()\n\nList all matrix groups.\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.add_to_groups","page":"Interfaces","title":"TypedMatrices.add_to_groups","text":"add_to_groups(type, groups)\n\nAdd a matrix type to groups. If a group is not exists, it will be created.\n\nGroups :builtin and :user are special groups. It is suggested always to add matrices to the :user group.\n\ngroups can be vector/varargs of Group or symbol.\n\nSee also remove_from_group, remove_from_all_groups.\n\nExamples\n\njulia> add_to_groups(Matrix, [Group(:user), Group(:test)])\n\njulia> add_to_groups(Matrix, Group(:user), Group(:test))\n\njulia> add_to_groups(Matrix, [:user, :test])\n\njulia> add_to_groups(Matrix, :user, :test)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.remove_from_group","page":"Interfaces","title":"TypedMatrices.remove_from_group","text":"remove_from_group(type, group)\n\nRemove a matrix type from a group. If the group is empty, it will be deleted.\n\nSee also add_to_groups, remove_from_all_groups.\n\nExamples\n\njulia> add_to_groups(Matrix, Group(:user))\n\njulia> remove_from_group(Matrix, Group(:user))\n\njulia> add_to_groups(Matrix, :user)\n\njulia> remove_from_group(Matrix, :user)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.remove_from_all_groups","page":"Interfaces","title":"TypedMatrices.remove_from_all_groups","text":"remove_from_all_groups(type)\n\nRemove a matrix type from all groups. If a group is empty, it will be deleted.\n\nSee also add_to_groups, remove_from_group.\n\nExamples\n\njulia> remove_from_all_groups(Matrix)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.list_matrices","page":"Interfaces","title":"TypedMatrices.list_matrices","text":"list_matrices(groups, props)\n\nList all matrices that are in groups and have properties.\n\ngroups can be vector/varargs of Group or symbol.\n\nprops can be vector/varargs of Property, symbol, subtype of PropertyTypes.AbstractProperty or instance of AbstractProperty.\n\nExamples\n\njulia> list_matrices()\n\njulia> list_matrices([Group(:builtin), Group(:user)], [Property(:symmetric), Property(:inverse)])\n\njulia> list_matrices(Property(:symmetric), Property(:inverse))\n\njulia> list_matrices([Property(:symmetric), Property(:inverse)])\n\njulia> list_matrices(:symmetric, :inverse)\n\njulia> list_matrices([:symmetric, :inverse])\n\njulia> list_matrices(PropertyTypes.Symmetric, PropertyTypes.Inverse)\n\njulia> list_matrices([PropertyTypes.Symmetric, PropertyTypes.Inverse])\n\njulia> list_matrices(PropertyTypes.Symmetric(), PropertyTypes.Inverse())\n\njulia> list_matrices([PropertyTypes.Symmetric(), PropertyTypes.Inverse()])\n\njulia> list_matrices(Group(:builtin), Group(:user))\n\njulia> list_matrices([Group(:builtin), Group(:user)])\n\n\n\n\n\n","category":"function"},{"location":"#TypedMatrices.jl-Documentation","page":"Home","title":"TypedMatrices.jl Documentation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Welcome to the documentation for TypedMatrices.jl.","category":"page"},{"location":"","page":"Home","title":"Home","text":"An extensible Julia matrix collection utilizing type system to enhance performance.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Check Getting Started for a quick start.","category":"page"},{"location":"#Features","page":"Home","title":"Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Types of matercies, can be used in algorithm tests or other.\nOptimized matrix operations for these types\nProperties (tags) for matrices.\nGrouping matercies and allow user to define their own types.\nFiltering matrices by properties or groups.","category":"page"}] +[{"location":"manual/2.performance/#Performance","page":"Performance","title":"Performance","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"We will briefly discuss the performance in this page.","category":"page"},{"location":"manual/2.performance/#Linear-Algebra-Properties-on-Typed-Matrices","page":"Performance","title":"Linear Algebra Properties on Typed Matrices","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"Package LinearAlgebra.jl provides several linear algebra operations. By utilizing the Julia type system, we can also improve the performance of these operations. For example, the issymmetric function defaults to call the issymmetric and check each element. The matrix Minij is explicitly known to be symmetric. The following example shows that the issymmetric function on the Minij typed matrix spent 10.310 ns and 873.400 μs on the Matrix typed matrix.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> a = Minij(1000)\n1000×1000 Minij{Int64}:\n...\n\njulia> b = Matrix(Minij(1000))\n1000×1000 Matrix{Int64}:\n...\n\njulia> @benchmark issymmetric(a)\nBenchmarkTools.Trial: 10000 samples with 999 evaluations.\n Range (min … max): 9.810 ns … 89.790 ns ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 10.310 ns ┊ GC (median): 0.00%\n Time (mean ± σ): 10.798 ns ± 2.083 ns ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n █▅▇▅▆▆▃▄▄▂ ▃▂▁▃ ▁▂▁▂▂▂▁▁▂ ▁ ▂\n ███████████████████████████▇▆▇▇▇▆▆▄▆▃▄▆▄▄▅▃▅▅▅▄▆▄▄▅▄▄▅▅▄▅▂▅ █\n 9.81 ns Histogram: log(frequency) by time 17.7 ns <\n\n Memory estimate: 0 bytes, allocs estimate: 0.\n\njulia> @benchmark issymmetric(b)\nBenchmarkTools.Trial: 4883 samples with 1 evaluation.\n Range (min … max): 593.700 μs … 13.507 ms ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 873.400 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 1.009 ms ± 515.315 μs ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n █▂ ▁▁\n ▂▆██▇▆████▇▅▄▃▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂\n 594 μs Histogram: frequency by time 2.69 ms <\n\n Memory estimate: 0 bytes, allocs estimate: 0.","category":"page"},{"location":"manual/2.performance/#Known-Algorithm-Working-on-Hilbert","page":"Performance","title":"Known Algorithm Working on Hilbert","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"The following example shows a known algorithm that works on Hilbert matrices, a is a Hilbert typed matrix, and b is the same matrix with Matrix typed. When doing the det operation, the Hilbert typed matrix only spent 0.3% of the time that the normal matrix spent, although the memory usage is 69.02 KiB and 66.22 MiB respectively.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> a = Hilbert{BigFloat}(100)\n100×100 Hilbert{BigFloat}:\n...\n\njulia> b = Matrix(Hilbert{BigFloat}(100))\n100×100 Matrix{BigFloat}:\n...\n\njulia> t3 = @benchmark det(a)\nBenchmarkTools.Trial: 6985 samples with 1 evaluation.\n Range (min … max): 334.500 μs … 740.291 ms ┊ GC (min … max): 0.00% … 68.80%\n Time (median): 564.100 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 706.671 μs ± 8.853 ms ┊ GC (mean ± σ): 10.32% ± 0.82%\n\n ▅█▅▂▂▅▄▁\n ▃█████████▇▆▆▄▄▄▄▅▅▅▅▆▆▇███▇▆▇▅▅▄▅▅▄▃▃▃▃▃▂▂▂▂▂▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁ ▃\n 334 μs Histogram: frequency by time 1.23 ms <\n\n Memory estimate: 69.02 KiB, allocs estimate: 3233.\n\njulia> t4 = @benchmark det(b)\nBenchmarkTools.Trial: 32 samples with 1 evaluation.\n Range (min … max): 127.925 ms … 229.261 ms ┊ GC (min … max): 8.86% … 4.76%\n Time (median): 158.327 ms ┊ GC (median): 9.49%\n Time (mean ± σ): 160.932 ms ± 23.576 ms ┊ GC (mean ± σ): 9.48% ± 3.52%\n\n ▃▃ █ ▃ ▃█\n ▇▁▁▁██▁█▁█▁▇▇▇▁▇▇▇▇██▁▁▁▁▇▇▇▁▁▇▇▁▇▁▁▁▁▇▁▁▁▁▁▁▇▁▁▇▁▁▁▁▁▁▁▁▁▁▁▇ ▁\n 128 ms Histogram: frequency by time 229 ms <\n\n Memory estimate: 66.22 MiB, allocs estimate: 1333851.","category":"page"},{"location":"manual/2.performance/#Trade-between-Performance-and-Memory","page":"Performance","title":"Trade between Performance and Memory","text":"","category":"section"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"This fresh approach saves substantial memory by trading off the performance. The following example shows that the Cauchy typed matrix a only spent 63.229 μs and 114.16 KiB memory to generate, while the Matrix typed matrix b spent 3.862 ms and 7.74 MiB memory to generate. Also, the memory usage of a is 16 bytes and 8000040 bytes for b.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> @benchmark a = Cauchy{Float64}(1000)\nBenchmarkTools.Trial: 10000 samples with 1 evaluation.\n Range (min … max): 27.100 μs … 191.819 ms ┊ GC (min … max): 0.00% … 99.94%\n Time (median): 32.100 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 63.229 μs ± 1.919 ms ┊ GC (mean ± σ): 35.05% ± 4.29%\n\n ▅█▇▅▄▃▃▂▂▃▂▃▃▅▅▃▁▁ ▁▁ ▂\n ███████████████████▇▇███▇▇▆▇▇▇▇▆▆▇████▇▇▆▆▄▄▃▂▂▄▅▅▅▆▆▇▇▆▆▇▅▅ █\n 27.1 μs Histogram: log(frequency) by time 125 μs <\n\n Memory estimate: 114.16 KiB, allocs estimate: 36.\n\njulia> @benchmark b = Matrix(Cauchy{Float64}(1000))\nBenchmarkTools.Trial: 1288 samples with 1 evaluation.\n Range (min … max): 2.413 ms … 18.386 ms ┊ GC (min … max): 0.00% … 48.63%\n Time (median): 3.271 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 3.862 ms ± 1.674 ms ┊ GC (mean ± σ): 15.96% ± 19.84%\n\n ▂█▄ ▁▂\n ████▄▆██▆▅▅▅▃▃▃▃▄▄▄▃▃▃▃▃▃▃▃▃▃▃▃▂▂▂▂▃▃▃▃▃▂▂▂▂▂▃▂▁▂▂▁▂▂▂▂▂▂▂ ▃\n 2.41 ms Histogram: frequency by time 9.53 ms <\n\n Memory estimate: 7.74 MiB, allocs estimate: 38.\n\njulia> Base.summarysize(a)\n16\n\njulia> Base.summarysize(b)\n8000040","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"This improvement is trade off the performance for memory. When accessing each element of the Cauchy typed matrix, more time is needed than the Matrix typed matrix, which is expected. This can allow machines with insufficient memory to take longer time to run computations that would have been impossible to run before.","category":"page"},{"location":"manual/2.performance/","page":"Performance","title":"Performance","text":"julia> @benchmark det(a)\nBenchmarkTools.Trial: 111 samples with 1 evaluation.\n Range (min … max): 20.537 ms … 353.410 ms ┊ GC (min … max): 0.00% … 90.93%\n Time (median): 34.151 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 45.104 ms ± 42.894 ms ┊ GC (mean ± σ): 7.81% ± 9.53%\n\n ▄█▅▃ ▁\n ▅████▇█▁▆▅▁▁▁▅▅▁▁▅▁▁▅▁▁▁▆▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▅ ▅\n 20.5 ms Histogram: log(frequency) by time 301 ms <\n\n Memory estimate: 7.64 MiB, allocs estimate: 4.\n\njulia> @benchmark det(b)\nBenchmarkTools.Trial: 175 samples with 1 evaluation.\n Range (min … max): 18.639 ms … 314.529 ms ┊ GC (min … max): 0.00% … 91.89%\n Time (median): 26.317 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 28.670 ms ± 22.610 ms ┊ GC (mean ± σ): 7.81% ± 8.48%\n\n ▂ ▂▂ ██ ▂▂ ▃ ▅ ▅▂ ▃▂\n ▅▁▃▇█▇██████▆██▅█▅█▅███████▇▆▁▁▆▆▃▁▆▅▅▅▁▁▁▁▁▁▁▃▅▃▁▁▅▁▁▁▁▃▃▁▃ ▃\n 18.6 ms Histogram: frequency by time 44.1 ms <\n\n Memory estimate: 7.64 MiB, allocs estimate: 4.\n\njulia> @benchmark sum(a)\nBenchmarkTools.Trial: 3104 samples with 1 evaluation.\n Range (min … max): 1.124 ms … 7.772 ms ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 1.400 ms ┊ GC (median): 0.00%\n Time (mean ± σ): 1.604 ms ± 579.750 μs ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n █▃▁█▄ ▂ \n █████▇██▇█▆▃▄▄▃▄▃▄▃▄▃▃▃▃▃▃▃▂▃▃▂▂▂▂▂▂▃▃▂▃▂▂▃▃▃▂▃▂▂▂▂▂▂▂▂▂▂▁▂ ▃\n 1.12 ms Histogram: frequency by time 3.56 ms <\n\n Memory estimate: 16 bytes, allocs estimate: 1.\n\njulia> @benchmark sum(b)\nBenchmarkTools.Trial: 10000 samples with 1 evaluation.\n Range (min … max): 243.900 μs … 2.106 ms ┊ GC (min … max): 0.00% … 0.00%\n Time (median): 329.800 μs ┊ GC (median): 0.00%\n Time (mean ± σ): 355.504 μs ± 91.684 μs ┊ GC (mean ± σ): 0.00% ± 0.00%\n\n ▂▅█▇▅▃▃▂▁▁▁▁\n ▁▄██████████████▇▆▆▆▆▆▆▆▄▄▄▄▄▄▃▃▃▃▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁ ▃\n 244 μs Histogram: frequency by time 647 μs <\n\n Memory estimate: 16 bytes, allocs estimate: 1.","category":"page"},{"location":"references/3.properties/#Properties","page":"Properties","title":"Properties","text":"","category":"section"},{"location":"references/3.properties/","page":"Properties","title":"Properties","text":"Some documentation of the following properties are adapted from MatrixDepot.jl.","category":"page"},{"location":"references/3.properties/","page":"Properties","title":"Properties","text":"TypedMatrices.PropertyTypes.AbstractProperty\nTypedMatrices.PropertyTypes.Symmetric\nTypedMatrices.PropertyTypes.Inverse\nTypedMatrices.PropertyTypes.Involutory\nTypedMatrices.PropertyTypes.Integer\nTypedMatrices.PropertyTypes.IllCond\nTypedMatrices.PropertyTypes.PosDef\nTypedMatrices.PropertyTypes.Correlation\nTypedMatrices.PropertyTypes.Eigen\nTypedMatrices.PropertyTypes.Sparse\nTypedMatrices.PropertyTypes.Random\nTypedMatrices.PropertyTypes.RegProb\nTypedMatrices.PropertyTypes.Graph\nTypedMatrices.PropertyTypes.TotNonNeg\nTypedMatrices.PropertyTypes.TotPos\nTypedMatrices.PropertyTypes.InfDiv\nTypedMatrices.PropertyTypes.Indefinite\nTypedMatrices.PropertyTypes.Defective\nTypedMatrices.PropertyTypes.Nilpotent\nTypedMatrices.PropertyTypes.Hessenberg\nTypedMatrices.PropertyTypes.Toeplitz\nTypedMatrices.PropertyTypes.Binary\nTypedMatrices.PropertyTypes.RankDef\nTypedMatrices.PropertyTypes.Circulant\nTypedMatrices.PropertyTypes.Normal\nTypedMatrices.PropertyTypes.Orthogonal\nTypedMatrices.PropertyTypes.Bidiagonal\nTypedMatrices.PropertyTypes.Tridiagonal\nTypedMatrices.PropertyTypes.Triangular\nTypedMatrices.PropertyTypes.SingVal\nTypedMatrices.PropertyTypes.Rectangular\nTypedMatrices.PropertyTypes.Hankel\nTypedMatrices.PropertyTypes.DiagDom\nTypedMatrices.PropertyTypes.NonNeg\nTypedMatrices.PropertyTypes.Unimodular\nTypedMatrices.PropertyTypes.Positive\nTypedMatrices.PropertyTypes.FixedSize\nTypedMatrices.PropertyTypes.Complex","category":"page"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.AbstractProperty","page":"Properties","title":"TypedMatrices.PropertyTypes.AbstractProperty","text":"This is an abstract type for properties.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Symmetric","page":"Properties","title":"TypedMatrices.PropertyTypes.Symmetric","text":"The matrix is symmetric for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Inverse","page":"Properties","title":"TypedMatrices.PropertyTypes.Inverse","text":"The inverse of the matrix is known explicitly.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Involutory","page":"Properties","title":"TypedMatrices.PropertyTypes.Involutory","text":"The matrix is a Involutory matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Integer","page":"Properties","title":"TypedMatrices.PropertyTypes.Integer","text":"The matrix has integer entries.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.IllCond","page":"Properties","title":"TypedMatrices.PropertyTypes.IllCond","text":"The matrix is ill-conditioned for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.PosDef","page":"Properties","title":"TypedMatrices.PropertyTypes.PosDef","text":"The matrix is positive definite for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Correlation","page":"Properties","title":"TypedMatrices.PropertyTypes.Correlation","text":"Correlation\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Eigen","page":"Properties","title":"TypedMatrices.PropertyTypes.Eigen","text":"Part of the eigensystem of the matrix is explicitly known.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Sparse","page":"Properties","title":"TypedMatrices.PropertyTypes.Sparse","text":"The matrix is sparse.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Random","page":"Properties","title":"TypedMatrices.PropertyTypes.Random","text":"The matrix has random entries.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.RegProb","page":"Properties","title":"TypedMatrices.PropertyTypes.RegProb","text":"The output is a test problem for Regularization Methods.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Graph","page":"Properties","title":"TypedMatrices.PropertyTypes.Graph","text":"An adjacency matrix of a graph.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.TotNonNeg","page":"Properties","title":"TypedMatrices.PropertyTypes.TotNonNeg","text":"TotNonNeg\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.TotPos","page":"Properties","title":"TypedMatrices.PropertyTypes.TotPos","text":"TotPos\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.InfDiv","page":"Properties","title":"TypedMatrices.PropertyTypes.InfDiv","text":"InfDiv\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Indefinite","page":"Properties","title":"TypedMatrices.PropertyTypes.Indefinite","text":"The matrix is indefinite for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Defective","page":"Properties","title":"TypedMatrices.PropertyTypes.Defective","text":"Defective\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Nilpotent","page":"Properties","title":"TypedMatrices.PropertyTypes.Nilpotent","text":"Nilpotent\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Hessenberg","page":"Properties","title":"TypedMatrices.PropertyTypes.Hessenberg","text":"The matrix is a Hessenberg matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Toeplitz","page":"Properties","title":"TypedMatrices.PropertyTypes.Toeplitz","text":"The matrix is a Toeplitz matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Binary","page":"Properties","title":"TypedMatrices.PropertyTypes.Binary","text":"The matrix has binary entries.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.RankDef","page":"Properties","title":"TypedMatrices.PropertyTypes.RankDef","text":"RankDef\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Circulant","page":"Properties","title":"TypedMatrices.PropertyTypes.Circulant","text":"The matrix is a Circulant matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Normal","page":"Properties","title":"TypedMatrices.PropertyTypes.Normal","text":"Normal\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Orthogonal","page":"Properties","title":"TypedMatrices.PropertyTypes.Orthogonal","text":"The matrix is orthogonal for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Bidiagonal","page":"Properties","title":"TypedMatrices.PropertyTypes.Bidiagonal","text":"The matrix is bidiagonal (eigher upper or lower).\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Tridiagonal","page":"Properties","title":"TypedMatrices.PropertyTypes.Tridiagonal","text":"The matrix is tridiagonal.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Triangular","page":"Properties","title":"TypedMatrices.PropertyTypes.Triangular","text":"The matrix is triangular (eigher upper or lower).\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.SingVal","page":"Properties","title":"TypedMatrices.PropertyTypes.SingVal","text":"SingVal\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Rectangular","page":"Properties","title":"TypedMatrices.PropertyTypes.Rectangular","text":"The matrix is rectangular.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Hankel","page":"Properties","title":"TypedMatrices.PropertyTypes.Hankel","text":"The matrix is a Hankel matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.DiagDom","page":"Properties","title":"TypedMatrices.PropertyTypes.DiagDom","text":"DiagDom\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.NonNeg","page":"Properties","title":"TypedMatrices.PropertyTypes.NonNeg","text":"NonNeg\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Unimodular","page":"Properties","title":"TypedMatrices.PropertyTypes.Unimodular","text":"Unimodular\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Positive","page":"Properties","title":"TypedMatrices.PropertyTypes.Positive","text":"The matrix is positive for some parameter values.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.FixedSize","page":"Properties","title":"TypedMatrices.PropertyTypes.FixedSize","text":"The matrix has a fixed size.\n\n\n\n\n\n","category":"type"},{"location":"references/3.properties/#TypedMatrices.PropertyTypes.Complex","page":"Properties","title":"TypedMatrices.PropertyTypes.Complex","text":"The matrix has complex entries.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#Builtin-Matrices","page":"Builtin Matrices","title":"Builtin Matrices","text":"","category":"section"},{"location":"references/4.builtin-matrices/","page":"Builtin Matrices","title":"Builtin Matrices","text":"TypedMatrices.Binomial\nTypedMatrices.Cauchy\nTypedMatrices.ChebSpec\nTypedMatrices.Chow\nTypedMatrices.Circulant\nTypedMatrices.Clement\nTypedMatrices.Companion\nTypedMatrices.Comparison\nTypedMatrices.Cycol\nTypedMatrices.DingDong\nTypedMatrices.Dorr\nTypedMatrices.Dramadah\nTypedMatrices.Fiedler\nTypedMatrices.Forsythe\nTypedMatrices.Frank\nTypedMatrices.GCDMat\nTypedMatrices.GearMat\nTypedMatrices.Golub\nTypedMatrices.Grcar\nTypedMatrices.Hadamard\nTypedMatrices.Hankel\nTypedMatrices.Hanowa\nTypedMatrices.Hilbert\nTypedMatrices.InverseHilbert\nTypedMatrices.Invhess\nTypedMatrices.Involutory\nTypedMatrices.Ipjfact\nTypedMatrices.JordBloc\nTypedMatrices.Kahan\nTypedMatrices.KMS\nTypedMatrices.Krylov\nTypedMatrices.Lauchli\nTypedMatrices.Lehmer\nTypedMatrices.Leslie\nTypedMatrices.Lesp\nTypedMatrices.Lotkin\nTypedMatrices.Magic\nTypedMatrices.Minij\nTypedMatrices.Moler\nTypedMatrices.Neumann\nTypedMatrices.Orthog\nTypedMatrices.Oscillate\nTypedMatrices.Parter\nTypedMatrices.Pascal\nTypedMatrices.Pei\nTypedMatrices.Poisson\nTypedMatrices.Prolate\nTypedMatrices.Randcolu\nTypedMatrices.Randcorr\nTypedMatrices.Randjorth\nTypedMatrices.Rando\nTypedMatrices.RandSVD\nTypedMatrices.Redheff\nTypedMatrices.Riemann\nTypedMatrices.RIS\nTypedMatrices.Rohess\nTypedMatrices.Rosser\nTypedMatrices.Sampling\nTypedMatrices.Smoke\nTypedMatrices.Toeplitz\nTypedMatrices.Triw\nTypedMatrices.Wathen\nTypedMatrices.Wilkinson","category":"page"},{"location":"references/4.builtin-matrices/#TypedMatrices.Binomial","page":"Builtin Matrices","title":"TypedMatrices.Binomial","text":"Binomial Matrix\n\nThe matrix is a multiple of an involutory matrix.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nG. Boyd, C.A. Micchelli, G. Strang and D.X. Zhou, Binomial matrices, Adv. in Comput. Math., 14 (2001), pp 379-391.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Cauchy","page":"Builtin Matrices","title":"TypedMatrices.Cauchy","text":"Cauchy Matrix\n\nGiven two vectors x and y, the (i,j) entry of the Cauchy matrix is 1/(x[i]+y[j]).\n\nInput Options\n\nx: an integer, as vectors 1:x and 1:x.\nx, y: two integers, as vectors 1:x and 1:y.\nx: a vector. y defaults to x.\nx, y: two vectors.\n\nReferences\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.ChebSpec","page":"Builtin Matrices","title":"TypedMatrices.ChebSpec","text":"Chebyshev Spectral Differentiation Matrix\n\nIf k = 0,the generated matrix is nilpotent and a vector with all one entries is a null vector. If k = 1, the generated matrix is nonsingular and well-conditioned. Its eigenvalues have negative real parts.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix and k = 0 or 1.\ndim: k=0.\n\nReferences\n\nL. N. Trefethen and M. R. Trummer, An instability phenomenon in spectral methods, SIAM J. Numer. Anal., 24 (1987), pp. 1008-1023.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Chow","page":"Builtin Matrices","title":"TypedMatrices.Chow","text":"Chow Matrix\n\nThe Chow matrix is a singular Toeplitz lower Hessenberg matrix.\n\nInput Options\n\ndim, alpha, delta: dim is dimension of the matrix. alpha, delta are scalars such that A[i,i] = alpha + delta and A[i,j] = alpha^(i + 1 -j) for j + 1 <= i.\ndim: alpha = 1, delta = 0.\n\nReferences\n\nT. S. Chow, A class of Hessenberg matrices with known eigenvalues and inverses, SIAM Review, 11 (1969), pp. 391-395.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Circulant","page":"Builtin Matrices","title":"TypedMatrices.Circulant","text":"Circulant Matrix\n\nA circulant matrix has the property that each row is obtained by cyclically permuting the entries of the previous row one step forward.\n\nInput Options\n\nvec: a vector.\ndim: an integer, as vector 1:dim.\n\nReferences\n\nP. J. Davis, Circulant Matrices, John Wiley, 1977.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Clement","page":"Builtin Matrices","title":"TypedMatrices.Clement","text":"Clement Matrix\n\nThe Clement matrix is a tridiagonal matrix with zero diagonal entries. If k = 1, the matrix is symmetric.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix. If k = 0, the matrix is of type Tridiagonal. If k = 1, the matrix is of type SymTridiagonal.\ndim: k = 0.\n\nReferences\n\nP. A. Clement, A class of triple-diagonal matrices for test purposes, SIAM Review, 1 (1959), pp. 50-52.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Companion","page":"Builtin Matrices","title":"TypedMatrices.Companion","text":"Companion Matrix\n\nThe companion matrix to a monic polynomial a(x) = a_0 + a_1x + ... + a_{n-1}x^{n-1} + x^n is the n-by-n matrix with ones on the subdiagonal and the last column given by the coefficients of a(x).\n\nInput Options\n\nvec: vec is a vector of coefficients.\ndim: vec = [1:dim;]. dim is the dimension of the matrix.\npolynomial: polynomial is a polynomial. vector will be appropriate values from coefficients.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Comparison","page":"Builtin Matrices","title":"TypedMatrices.Comparison","text":"Comparison Matrix\n\nThe comparison matrix for another matrix.\n\nInput Options\n\nB, k: B is a matrix. k = 0: each element is absolute value of B, except each diagonal element is negative absolute value. k = 1: each diagonal element is absolute value of B, except each off-diagonal element is negative largest absolute value in the same row.\nB: B is a matrix and k = 1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Cycol","page":"Builtin Matrices","title":"TypedMatrices.Cycol","text":"Cycol Matrix\n\nThe cycol matrix repeats columns.\n\nInput Options\n\nm, n, k: m and n are size of the matrix. The repetition is randn(m, k).\nn, k: n is size of the matrix. The repetition is randn(n, k).\nn: n is size of the matrix. k = round(n/4)\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.DingDong","page":"Builtin Matrices","title":"TypedMatrices.DingDong","text":"Dingdong Matrix\n\nThe Dingdong matrix is a symmetric Hankel matrix invented by DR. F. N. Ris of IBM, Thomas J Watson Research Centre. The eigenvalues cluster around π/2 and -π/2.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nJ. C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Dorr","page":"Builtin Matrices","title":"TypedMatrices.Dorr","text":"Dorr Matrix\n\nDorr Matrix is a diagonally dominant, illcond, tridiagonal sparse matrix.\n\nInput Options\n\ndim, theta: dim is the dimension of the matrix and theta is the parameter of the matrix.\ndim: theta = 0.01.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Dramadah","page":"Builtin Matrices","title":"TypedMatrices.Dramadah","text":"Dramadah Matrix\n\nDramadah matrix is a matrix with 0s and 1s.\n\nInput Options\n\ndim, k: the dimension of the matrix and k. k = 1 abs(det(A)) = 1, the inverse has integer entries. k = 2 the inverse has integer entries. k = 3 det(A) is equal to nth Fibonacci number.\ndim: k = 1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Fiedler","page":"Builtin Matrices","title":"TypedMatrices.Fiedler","text":"Fiedler Matrix\n\nThe Fiedler matrix is symmetric matrix with a dominant positive eigenvalue and all the other eigenvalues are negative.\n\nInput Options\n\nvec: a vector.\ndim: dim is the dimension of the matrix. vec=[1:dim;].\n\nReferences\n\nG. Szego, Solution to problem 3705, Amer. Math. Monthly, 43 (1936), pp. 246-259.\n\nJ. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra, Birkhauser, Basel, and Academic Press, New York, 1977, p. 159.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Forsythe","page":"Builtin Matrices","title":"TypedMatrices.Forsythe","text":"Forsythe Matrix\n\nThe Forsythe matrix is a n-by-n perturbed Jordan block. This generator is adapted from N. J. Higham's Test Matrix Toolbox.\n\nInput Options\n\ndim, alpha, lambda: dim is the dimension of the matrix. alpha and lambda are scalars.\ndim: alpha = sqrt(eps(type)) and lambda = 0.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Frank","page":"Builtin Matrices","title":"TypedMatrices.Frank","text":"Frank Matrix\n\nThe Frank matrix is an upper Hessenberg matrix with determinant 1. The eigenvalues are real, positive and very ill conditioned.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix, k = 0 or 1. If k = 1 the matrix reflect about the anti-diagonal.\ndim: the dimension of the matrix.\n\nReferences\n\nW. L. Frank, Computing eigenvalues of complex matrices by determinant evaluation and by methods of Danilewski and Wielandt, J. Soc. Indust. Appl. Math., 6 (1958), pp. 378-392 (see pp. 385, 388).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.GCDMat","page":"Builtin Matrices","title":"TypedMatrices.GCDMat","text":"GCDMat Matrix\n\nA matrix with (i,j) entry gcd(i,j). It is a symmetric positive definite matrix.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.GearMat","page":"Builtin Matrices","title":"TypedMatrices.GearMat","text":"Gear Matrix\n\nA gear matrix. 1's on the sub and super diagonal, sign(i) on the (1,abs(i)) and sign(j) on the (n,n+1-abs(j)) position, other elements are 0.\n\nInput Options\n\ndim: the dimension of the matrix. i = n and j = -n by default.\ndim, i, j: the dimension of the matrix and the position of the 1's.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Golub","page":"Builtin Matrices","title":"TypedMatrices.Golub","text":"Golub Matrix\n\nGolub matrix is the product of two random unit lower and upper triangular matrices respectively. LU factorization without pivoting fails to reveal that such matrices are badly conditioned.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nD. Viswanath and N. Trefethen. Condition Numbers of Random Triangular Matrices, SIAM J. Matrix Anal. Appl. 19, 564-581, 1998.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Grcar","page":"Builtin Matrices","title":"TypedMatrices.Grcar","text":"Grcar Matrix\n\nThe Grcar matrix is a Toeplitz matrix with sensitive eigenvalues.\n\nInput Options\n\ndim, k: dim is the dimension of the matrix and k is the number of superdiagonals.\ndim: the dimension of the matrix.\n\nReferences\n\nJ. F. Grcar, Operator coefficient methods for linear equations, Report SAND89-8691, Sandia National Laboratories, Albuquerque, New Mexico, 1989 (Appendix 2).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hadamard","page":"Builtin Matrices","title":"TypedMatrices.Hadamard","text":"Hadamard Matrix\n\nThe Hadamard matrix is a square matrix whose entries are 1 or -1. It was named after Jacques Hadamard. The rows of a Hadamard matrix are orthogonal.\n\nInput Options\n\ndim: the dimension of the matrix, dim is a power of 2.\n\nReferences\n\nS. W. Golomb and L. D. Baumert, The search for Hadamard matrices, Amer. Math. Monthly, 70 (1963) pp. 12-17\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hankel","page":"Builtin Matrices","title":"TypedMatrices.Hankel","text":"Hankel Matrix\n\nA Hankel matrix is a matrix that is symmetric and constant across the anti-diagonals.\n\nInput Options\n\nvc, vr: vc and vc are the first column and last row of the matrix. If the last element of vc differs from the first element of vr, the last element of rc prevails.\nv: a vector, as vc = v and vr will be zeros.\ndim: dim is the dimension of the matrix. v = [1:dim;].\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hanowa","page":"Builtin Matrices","title":"TypedMatrices.Hanowa","text":"Hanowa Matrix\n\nThe Hanowa matrix is a matrix which eigenvalues lie on a vertical line in the complex plane.\n\nInput Options\n\ndim: the dimension of the matrix and alpha = -1.\ndim, alpha: the dimension and alpha.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Hilbert","page":"Builtin Matrices","title":"TypedMatrices.Hilbert","text":"Hilbert Matrix\n\nThe Hilbert matrix has (i,j) element 1/(i+j-1). It is notorious for being ill conditioned. It is symmetric positive definite and totally positive.\n\nSee also InverseHilbert.\n\nInput Options\n\ndim: the dimension of the matrix.\nrow_dim, col_dim: the row and column dimensions.\n\nReferences\n\nM. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.InverseHilbert","page":"Builtin Matrices","title":"TypedMatrices.InverseHilbert","text":"Inverse of the Hilbert Matrix\n\nSee also Hilbert.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nM. D. Choi, Tricks or treats with the Hilbert matrix, Amer. Math. Monthly, 90 (1983), pp. 301-312.\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Invhess","page":"Builtin Matrices","title":"TypedMatrices.Invhess","text":"Invhess Matrix\n\nInverse of upper Hessenberg matrix.\n\nInput Options\n\ndim: the dimension of the matrix. x = [1:dim;].\nx: x vector. y = -x[1:end-1].\nx, y: x and y vectors.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Involutory","page":"Builtin Matrices","title":"TypedMatrices.Involutory","text":"Involutory Matrix\n\nAn involutory matrix is a matrix that is its own inverse.\n\nInput Options\n\ndim: dim is the dimension of the matrix.\n\nReferences\n\nA. S. Householder and J. A. Carpenter, The singular values of involutory and of idempotent matrices, Numer. Math. 5 (1963), pp. 234-237.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Ipjfact","page":"Builtin Matrices","title":"TypedMatrices.Ipjfact","text":"Ipjfact Matrix\n\nHankel matrix with factorial elements.\n\nInput Options\n\ndim: the dimension of the matrix.\ndim, k: k = 0 element (i, j) is factorial(i + j). k = 1 element (i, j) is 1 / factorial(i + j).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.JordBloc","page":"Builtin Matrices","title":"TypedMatrices.JordBloc","text":"Jordan Block Matrix\n\nJordan block matrix with lambda on the diagonal and 1 on the superdiagonal. It's eigenvalues are lambda.\n\nInput Options\n\ndim: dimension of the matrix. lambda = 1.\ndim, lambda: dimension of the matrix and the lambda.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Kahan","page":"Builtin Matrices","title":"TypedMatrices.Kahan","text":"Kahan Matrix\n\nThe Kahan matrix is an upper trapezoidal matrix, i.e., the (i,j) element is equal to 0 if i > j. The useful range of θ is 0 < θ < π. The diagonal is perturbed by pert*eps()*diagm([n:-1:1;]).\n\nInput Options\n\nrowdim, coldim, θ, pert: rowdim and coldim are the row and column dimensions of the matrix. θ and pert are scalars.\ndim, θ, pert: dim is the dimension of the matrix.\ndim: θ = 1.2, pert = 25.\n\nReferences\n\nW. Kahan, Numerical linear algebra, Canadian Math. Bulletin, 9 (1966), pp. 757-801.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.KMS","page":"Builtin Matrices","title":"TypedMatrices.KMS","text":"Kac-Murdock-Szego Toeplitz matrix\n\nInput Options\n\ndim, rho: dim is the dimension of the matrix, rho is a scalar such that A[i,j] = rho^(abs(i-j)).\ndim: rho = 0.5.\n\nReferences\n\nW. F. Trench, Numerical solution of the eigenvalue problem for Hermitian Toeplitz matrices, SIAM J. Matrix Analysis and Appl., 10 (1989), pp. 135-146 (and see the references therein).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Krylov","page":"Builtin Matrices","title":"TypedMatrices.Krylov","text":"Krylov Matrix\n\nKrylow matrix equal to [x, Bx, B^2x, ..., B^(k-1)*x].\n\nInput Options\n\ndim: dimension of the matrix. A = randn(dim, dim). x = ones(dim). k = dim.\ndim, x: dimension of the matrix and x.\ndim, x, k: dimension of the matrix, x and k.\nA: matrix. x = ones(size(A, 1)). k = size(A, 1).\nA, x: matrix and x. k = size(A, 1).\nA, x, k: matrix, x and k.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lauchli","page":"Builtin Matrices","title":"TypedMatrices.Lauchli","text":"Lauchli Matrix\n\nA matrix with ones on the first row, mu on the subdiagonal, and zeros elsewhere.\n\nInput Options\n\ndim: the dimension of the matrix. mu = sqrt(eps()) by default.\ndim, mu: the dimension and subdiagonal value of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lehmer","page":"Builtin Matrices","title":"TypedMatrices.Lehmer","text":"Lehmer Matrix\n\nThe Lehmer matrix is a symmetric positive definite matrix. It is totally nonnegative. The inverse is tridiagonal and explicitly known\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nM. Newman and J. Todd, The evaluation of matrix inversion programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476. Solutions to problem E710 (proposed by D.H. Lehmer): The inverse of a matrix, Amer. Math. Monthly, 53 (1946), pp. 534-535.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Leslie","page":"Builtin Matrices","title":"TypedMatrices.Leslie","text":"Leslie Matrix\n\nMatrix for birth numbers and survival rates in the Leslie population model.\n\nInput Options\n\ndim: the dimension of the matrix. x = ones(n) and y = ones(n - 1) by default.\nx, y: x and y.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lesp","page":"Builtin Matrices","title":"TypedMatrices.Lesp","text":"Lesp Matrix\n\nA matrix with eigenvalues smoothly distributed in the interval [-2*n-3.5,-4.5].\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Lotkin","page":"Builtin Matrices","title":"TypedMatrices.Lotkin","text":"Lotkin Matrix\n\nThe Lotkin matrix is the Hilbert matrix with its first row altered to all ones. It is unsymmetric, illcond and has many negative eigenvalues of small magnitude.\n\nInput Options\n\ndim: dim is the dimension of the matrix.\n\nReferences\n\nM. Lotkin, A set of test matrices, MTAC, 9 (1955), pp. 153-161.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Magic","page":"Builtin Matrices","title":"TypedMatrices.Magic","text":"Magic Square Matrix\n\nThe magic matrix is a matrix with integer entries such that the row elements, column elements, diagonal elements and anti-diagonal elements all add up to the same number.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Minij","page":"Builtin Matrices","title":"TypedMatrices.Minij","text":"MIN[I,J] Matrix\n\nA matrix with (i,j) entry min(i,j). It is a symmetric positive definite matrix. The eigenvalues and eigenvectors are known explicitly. Its inverse is tridiagonal.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nJ. Fortiana and C. M. Cuadras, A family of matrices, the discretized Brownian bridge, and distance-based regression, Linear Algebra Appl., 264 (1997), 173-188. (For the eigensystem of A.)\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Moler","page":"Builtin Matrices","title":"TypedMatrices.Moler","text":"Moler Matrix\n\nThe Moler matrix is a symmetric positive definite matrix. It has one small eigenvalue.\n\nInput Options\n\ndim, alpha: dim is the dimension of the matrix, alpha is a scalar.\ndim: alpha = -1.\n\nReferences\n\nJ.C. Nash, Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, second edition, Adam Hilger, Bristol, 1990 (Appendix 1).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Neumann","page":"Builtin Matrices","title":"TypedMatrices.Neumann","text":"Neumann Matrix\n\nA singular matrix from the discrete Neumann problem. The matrix is sparse and the null space is formed by a vector of ones\n\nInput Options\n\ndim: the dimension of the matrix, must be a perfect square integer.\n\nReferences\n\nR. J. Plemmons, Regular splittings and the discrete Neumann problem, Numer. Math., 25 (1976), pp. 153-161.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Orthog","page":"Builtin Matrices","title":"TypedMatrices.Orthog","text":"Orthogonal Matrix\n\nOrthogonal and nearly orthogonal matrices.\n\nInput Options\n\ndim: the dimension of the matrix. k = 1 by default.\ndim, k: the dimension and type of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Oscillate","page":"Builtin Matrices","title":"TypedMatrices.Oscillate","text":"Oscillating Matrix\n\nA matrix A is called oscillating if A is totally nonnegative and if there exists an integer q > 0 such that A^q is totally positive.\n\nInput Options\n\nΣ: the singular value spectrum of the matrix.\ndim, mode: dim is the dimension of the matrix. mode = 1: geometrically distributed singular values. mode = 2: arithmetrically distributed singular values.\ndim: mode = 1.\n\nReferences\n\nPer Christian Hansen, Test matrices for regularization methods. SIAM J. SCI. COMPUT Vol 16, No2, pp 506-512 (1995).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Parter","page":"Builtin Matrices","title":"TypedMatrices.Parter","text":"Parter Matrix\n\nThe Parter matrix is a Toeplitz and Cauchy matrix with singular values near π.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nThe MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2. S. V. Parter, On the distribution of the singular values of Toeplitz matrices, Linear Algebra and Appl., 80 (1986), pp. 115-130.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Pascal","page":"Builtin Matrices","title":"TypedMatrices.Pascal","text":"Pascal Matrix\n\nThe Pascal matrix’s anti-diagonals form the Pascal’s triangle.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nR. Brawer and M. Pirovino, The linear algebra of the Pascal matrix, Linear Algebra and Appl., 174 (1992), pp. 13-23 (this paper gives a factorization of L = PASCAL(N,1) and a formula for the elements of L^k).\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.4.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Pei","page":"Builtin Matrices","title":"TypedMatrices.Pei","text":"Pei Matrix\n\nThe Pei matrix is a symmetric matrix with known inversion.\n\nInput Options\n\ndim, alpha: dim is the dimension of the matrix. alpha is a scalar.\ndim: the dimension of the matrix.\n\nReferences\n\nM. L. Pei, A test matrix for inversion procedures, Comm. ACM, 5 (1962), p. 508.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Poisson","page":"Builtin Matrices","title":"TypedMatrices.Poisson","text":"Poisson Matrix\n\nA block tridiagonal matrix from Poisson’s equation. This matrix is sparse, symmetric positive definite and has known eigenvalues.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nG. H. Golub and C. F. Van Loan, Matrix Computations, second edition, Johns Hopkins University Press, Baltimore, Maryland, 1989 (Section 4.5.4).\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Prolate","page":"Builtin Matrices","title":"TypedMatrices.Prolate","text":"Prolate Matrix\n\nA prolate matrix is a symmetirc, ill-conditioned Toeplitz matrix.\n\nInput Options\n\ndim, alpha: dim is the dimension of the matrix. w is a real scalar.\ndim: the case when w = 0.25.\n\nReferences\n\nJ. M. Varah. The Prolate Matrix. Linear Algebra and Appl. 187:267–278, 1993.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Randcolu","page":"Builtin Matrices","title":"TypedMatrices.Randcolu","text":"Randcolu Matrix\n\nRandom matrix with normalized columns and given singular values.\n\nInput Options\n\ndim: the dimension of the matrix, x will be generated randomly.\nn, m: the size of the matrix.\nn, m, k: size and k flag. Enable initial transformation if k = 0.\nx: the x vector.\nx, m: the x vector and m.\nx, m, k: the x vector, m, and k flag.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Randcorr","page":"Builtin Matrices","title":"TypedMatrices.Randcorr","text":"Random Correlation Matrix\n\nA random correlation matrix is a symmetric positive semidefinite matrix with 1s on the diagonal.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Randjorth","page":"Builtin Matrices","title":"TypedMatrices.Randjorth","text":"Randjorth Matrix\n\nThis matrix is currently not implemented.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Rando","page":"Builtin Matrices","title":"TypedMatrices.Rando","text":"Random Matrix with Element -1, 0, 1\n\nInput Options\n\nrowdim, coldim, k: row_dim and col_dim are row and column dimensions, k = 1: entries are 0 or 1. k = 2: entries are -1 or 1. k = 3: entries are -1, 0 or 1.\ndim, k: row_dim = col_dim = dim.\ndim: k = 1.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.RandSVD","page":"Builtin Matrices","title":"TypedMatrices.RandSVD","text":"Random Matrix with Pre-assigned Singular Values\n\nInput Options\n\nrowdim, coldim, kappa, mode: row_dim and col_dim are the row and column dimensions. kappa is the condition number of the matrix. mode = 1: one large singular value. mode = 2: one small singular value. mode = 3: geometrically distributed singular values. mode = 4: arithmetrically distributed singular values. mode = 5: random singular values with unif. dist. logarithm.\ndim, kappa, mode: row_dim = col_dim = dim.\ndim, kappa: mode = 3.\ndim: kappa = sqrt(1/eps()), mode = 3.\n\nReferences\n\nN. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002; sec. 28.3.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Redheff","page":"Builtin Matrices","title":"TypedMatrices.Redheff","text":"Redheffer Matrix\n\nRedheffer matrix of 1s and 0s.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Riemann","page":"Builtin Matrices","title":"TypedMatrices.Riemann","text":"Riemann Matrix\n\nA matrix associated with the Riemann hypothesis.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.RIS","page":"Builtin Matrices","title":"TypedMatrices.RIS","text":"RIS Matrix\n\nThe RIS matrix has (i,j) element 0.5/(n-i-j+1.5). It is symmetric.\n\nInput Options\n\ndim: the dimension of the matrix.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Rohess","page":"Builtin Matrices","title":"TypedMatrices.Rohess","text":"Random Orthogonal Upper Hessenberg Matrix\n\nThe matrix is constructed via a product of Givens rotations.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nW. B. Gragg, The QR algorithm for unitary Hessenberg matrices, J. Comp. Appl. Math., 16 (1986), pp. 1-8.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Rosser","page":"Builtin Matrices","title":"TypedMatrices.Rosser","text":"Rosser Matrix\n\nThe Rosser matrix’s eigenvalues are very close together so it is a challenging matrix for many eigenvalue algorithms.\n\nInput Options\n\ndim, a, b: dim is the dimension of the matrix. dim must be a power of 2. a and b are scalars. For dim = 8, a = 2 and b = 1, the generated matrix is the test matrix used by Rosser.\ndim: a = rand(1:5), b = rand(1:5).\n\nReferences\n\nJ. B. Rosser, C. Lanczos, M. R. Hestenes, W. Karush, Separation of close eigenvalues of a real symmetric matrix, Journal of Research of the National Bureau of Standards, v(47) (1951)\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Sampling","page":"Builtin Matrices","title":"TypedMatrices.Sampling","text":"Matrix with Application in Sampling Theory\n\nA nonsymmetric matrix with eigenvalues 0, 1, 2, ... n-1.\n\nInput Options\n\nvec: vec is a vector with no repeated elements.\ndim: dim is the dimension of the matrix. vec = [1:dim;]/dim.\n\nReferences\n\nL. Bondesson and I. Traat, A nonsymmetric matrix with integer eigenvalues, linear and multilinear algebra, 55(3) (2007), pp. 239-247\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Smoke","page":"Builtin Matrices","title":"TypedMatrices.Smoke","text":"Smoke Matrix\n\nComplex matrix with a \"smoke ring\" pseudospectrum. 1's on the superdiagonal, cos(w) + sin(w) * im on the diagonal. The A(n, 1)` entry is 1 if k = 0, 0 if k = 1.\n\nInput Options\n\ndim: dimension of the matrix. k = 0.\ndim, k: dimension of the matrix and the k.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Toeplitz","page":"Builtin Matrices","title":"TypedMatrices.Toeplitz","text":"Toeplitz Matrix\n\nA Toeplitz matrix is a matrix in which each descending diagonal from left to right is constant.\n\nInput Options\n\nvc, vr: vc and vr are the first column and row of the matrix.\nv: symmatric case, i.e., vc = vr = v.\ndim: dim is the dimension of the matrix. v = [1:dim;] is the first row and column vector.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Triw","page":"Builtin Matrices","title":"TypedMatrices.Triw","text":"Triw Matrix\n\nUpper triangular matrices discussed by Wilkinson and others.\n\nInput Options\n\nrowdim, coldim, α, k: row_dim and col_dim are row and column dimension of the matrix. α is a scalar representing the entries on the superdiagonals. k is the number of superdiagonals.\ndim: the dimension of the matrix.\n\nReferences\n\nG. H. Golub and J. H. Wilkinson, Ill-conditioned eigensystems and the computation of the Jordan canonical form, SIAM Review, 18(4), 1976, pp. 578-6\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Wathen","page":"Builtin Matrices","title":"TypedMatrices.Wathen","text":"Wathen Matrix\n\nWathen Matrix is a sparse, symmetric positive, random matrix arose from the finite element method. The generated matrix is the consistent mass matrix for a regular nx-by-ny grid of 8-nodes.\n\nInput Options\n\n[type,] nx, ny: the dimension of the matrix is equal to 3 * nx * ny + 2 * nx * ny + 1.\n[type,] n: nx = ny = n.\n\nGroups: [\"symmetric\", \"posdef\", \"eigen\", \"random\", \"sparse\"]\n\nReferences\n\nA. J. Wathen, Realistic eigenvalue bounds for the Galerkin mass matrix, IMA J. Numer. Anal., 7 (1987), pp. 449-457.\n\n\n\n\n\n","category":"type"},{"location":"references/4.builtin-matrices/#TypedMatrices.Wilkinson","page":"Builtin Matrices","title":"TypedMatrices.Wilkinson","text":"Wilkinson Matrix\n\nThe Wilkinson matrix is a symmetric tridiagonal matrix with pairs of nearly equal eigenvalues. The most frequently used case is matrixdepot(\"wilkinson\", 21). The result is of type Tridiagonal.\n\nInput Options\n\ndim: the dimension of the matrix.\n\nReferences\n\nJ. H. Wilkinson, Error analysis of direct methods of matrix inversion, J. Assoc. Comput. Mach., 8 (1961), pp. 281-330.\n\n\n\n\n\n","category":"type"},{"location":"manual/1.getting-started/#Getting-Started","page":"Getting Started","title":"Getting Started","text":"","category":"section"},{"location":"manual/1.getting-started/#Installation","page":"Getting Started","title":"Installation","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"TypedMatrices.jl is a registered package in the Julia package registry. Use Julia's package manager to install it:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"pkg> add TypedMatrices","category":"page"},{"location":"manual/1.getting-started/#Setup","page":"Getting Started","title":"Setup","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Use the package:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"using TypedMatrices","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"You can list all matrices available with list_matrices:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices()","category":"page"},{"location":"manual/1.getting-started/#Creating-Matrices","page":"Getting Started","title":"Creating Matrices","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Each type of matrix has its own type and constructors. For example, to create a 5x5 Hilbert matrix:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"h = Hilbert(5)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Most matrices can accept a type parameter to specify the element type. For example, to create a 5x5 Hilbert matrix with Float64 elements:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Hilbert{Float64}(5)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Please check Builtin Matrices for all available builtin matrices.","category":"page"},{"location":"manual/1.getting-started/#Properties","page":"Getting Started","title":"Properties","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"Matrix has properties like symmetric, illcond, and posdef. Function properties can be used to get the properties of a matrix:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"properties(Hilbert)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"You can also check properties of a matrix instance for convinience:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"properties(h)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To view all available properties, use list_properties:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_properties()","category":"page"},{"location":"manual/1.getting-started/#Grouping","page":"Getting Started","title":"Grouping","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"This package has a grouping feature to group matrices. All builtin matrices are in the builtin group, we also create a user group for user-defined matrices. You can list all groups with:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_groups()","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To add a matrix to groups and enable it to be listed by list_matrices, use add_to_groups:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"add_to_groups(Matrix, :user, :test)\nlist_matrices(Group(:user))","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"We can also add builtin matrices to our own groups:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"add_to_groups(Hilbert, :test)\nlist_matrices(Group(:test))","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To remove a matrix from a group or all groups, use remove_from_group or remove_from_all_groups. The empty group will automatically be removed:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"remove_from_group(Hilbert, :test)\nremove_from_all_groups(Matrix)\nlist_groups()","category":"page"},{"location":"manual/1.getting-started/#Finding-Matrices","page":"Getting Started","title":"Finding Matrices","text":"","category":"section"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices is very powerful to list matrices, and filter by groups and properties. All arguments are \"and\" relationship, i.e. listed matrices must satisfy all conditions.","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"For example, to list all matrices in the builtin group, and all matrices with symmetric property:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices(Group(:builtin))\nlist_matrices(Property(:symmetric))","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To list all matrices in the builtin group with inverse, illcond, and eigen properties:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices(\n [\n Group(:builtin),\n ],\n [\n Property(:inverse),\n Property(:illcond),\n Property(:eigen),\n ]\n)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"To list all matrices with symmetric, eigen, and posdef properties:","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"list_matrices(:symmetric, :eigen, :posdef)","category":"page"},{"location":"manual/1.getting-started/","page":"Getting Started","title":"Getting Started","text":"There are many alternative interfaces using list_matrices, please check the list_matrices or use Julia help system for more information.","category":"page"},{"location":"references/1.types/#Types","page":"Types","title":"Types","text":"","category":"section"},{"location":"references/1.types/","page":"Types","title":"Types","text":"TypedMatrices.PropertyTypes\nTypedMatrices.Property\nTypedMatrices.Group","category":"page"},{"location":"references/1.types/#TypedMatrices.PropertyTypes","page":"Types","title":"TypedMatrices.PropertyTypes","text":"PropertyTypes\n\nTypes of properties.\n\nSee also TypedMatrices.Property, TypedMatrices.list_properties.\n\nExamples\n\njulia> PropertyTypes.Symmetric\nTypedMatrices.PropertyTypes.Symmetric\n\n\n\n\n\n","category":"module"},{"location":"references/1.types/#TypedMatrices.Property","page":"Types","title":"TypedMatrices.Property","text":"Property\n\nProperty type. Similar to symbol, just to distinguish it from group.\n\nSee also list_properties, @properties, properties.\n\n\n\n\n\n","category":"type"},{"location":"references/1.types/#TypedMatrices.Group","page":"Types","title":"TypedMatrices.Group","text":"Group\n\nGroup type. Similar to symbol, just to distinguish it from property.\n\nSee also list_matrices, list_groups, add_to_groups, remove_from_group, remove_from_all_groups.\n\n\n\n\n\n","category":"type"},{"location":"references/2.interfaces/#Interfaces","page":"Interfaces","title":"Interfaces","text":"","category":"section"},{"location":"references/2.interfaces/","page":"Interfaces","title":"Interfaces","text":"TypedMatrices.list_properties\nTypedMatrices.@properties\nTypedMatrices.properties\nTypedMatrices.list_groups\nTypedMatrices.add_to_groups\nTypedMatrices.remove_from_group\nTypedMatrices.remove_from_all_groups\nTypedMatrices.list_matrices","category":"page"},{"location":"references/2.interfaces/#TypedMatrices.list_properties","page":"Interfaces","title":"TypedMatrices.list_properties","text":"list_properties()\n\nList all properties.\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.@properties","page":"Interfaces","title":"TypedMatrices.@properties","text":"@properties Type [propa, propb, ...]\n\nRegister properties for a type. The properties are a vector of symbols.\n\nSee also: properties.\n\nExamples\n\njulia> @properties Matrix [:symmetric, :inverse, :illcond, :posdef, :eigen]\n\n\n\n\n\n","category":"macro"},{"location":"references/2.interfaces/#TypedMatrices.properties","page":"Interfaces","title":"TypedMatrices.properties","text":"properties(type)\nproperties(matrix)\n\nGet the properties of a type or matrix.\n\nSee also: @properties.\n\nExamples\n\njulia> @properties Matrix [:symmetric, :posdef]\n\njulia> properties(Matrix)\n2-element Vector{Property}:\n Property(:symmetric)\n Property(:posdef)\n\njulia> properties(Matrix(ones(1, 1)))\n2-element Vector{Property}:\n Property(:symmetric)\n Property(:posdef)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.list_groups","page":"Interfaces","title":"TypedMatrices.list_groups","text":"list_groups()\n\nList all matrix groups.\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.add_to_groups","page":"Interfaces","title":"TypedMatrices.add_to_groups","text":"add_to_groups(type, groups)\n\nAdd a matrix type to groups. If a group is not exists, it will be created.\n\nGroups :builtin and :user are special groups. It is suggested always to add matrices to the :user group.\n\ngroups can be vector/varargs of Group or symbol.\n\nSee also remove_from_group, remove_from_all_groups.\n\nExamples\n\njulia> add_to_groups(Matrix, [Group(:user), Group(:test)])\n\njulia> add_to_groups(Matrix, Group(:user), Group(:test))\n\njulia> add_to_groups(Matrix, [:user, :test])\n\njulia> add_to_groups(Matrix, :user, :test)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.remove_from_group","page":"Interfaces","title":"TypedMatrices.remove_from_group","text":"remove_from_group(type, group)\n\nRemove a matrix type from a group. If the group is empty, it will be deleted.\n\nSee also add_to_groups, remove_from_all_groups.\n\nExamples\n\njulia> add_to_groups(Matrix, Group(:user))\n\njulia> remove_from_group(Matrix, Group(:user))\n\njulia> add_to_groups(Matrix, :user)\n\njulia> remove_from_group(Matrix, :user)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.remove_from_all_groups","page":"Interfaces","title":"TypedMatrices.remove_from_all_groups","text":"remove_from_all_groups(type)\n\nRemove a matrix type from all groups. If a group is empty, it will be deleted.\n\nSee also add_to_groups, remove_from_group.\n\nExamples\n\njulia> remove_from_all_groups(Matrix)\n\n\n\n\n\n","category":"function"},{"location":"references/2.interfaces/#TypedMatrices.list_matrices","page":"Interfaces","title":"TypedMatrices.list_matrices","text":"list_matrices(groups, props)\n\nList all matrices that are in groups and have properties.\n\ngroups can be vector/varargs of Group or symbol.\n\nprops can be vector/varargs of Property, symbol, subtype of PropertyTypes.AbstractProperty or instance of AbstractProperty.\n\nExamples\n\njulia> list_matrices()\n\njulia> list_matrices([Group(:builtin), Group(:user)], [Property(:symmetric), Property(:inverse)])\n\njulia> list_matrices(Property(:symmetric), Property(:inverse))\n\njulia> list_matrices([Property(:symmetric), Property(:inverse)])\n\njulia> list_matrices(:symmetric, :inverse)\n\njulia> list_matrices([:symmetric, :inverse])\n\njulia> list_matrices(PropertyTypes.Symmetric, PropertyTypes.Inverse)\n\njulia> list_matrices([PropertyTypes.Symmetric, PropertyTypes.Inverse])\n\njulia> list_matrices(PropertyTypes.Symmetric(), PropertyTypes.Inverse())\n\njulia> list_matrices([PropertyTypes.Symmetric(), PropertyTypes.Inverse()])\n\njulia> list_matrices(Group(:builtin), Group(:user))\n\njulia> list_matrices([Group(:builtin), Group(:user)])\n\n\n\n\n\n","category":"function"},{"location":"#TypedMatrices.jl-Documentation","page":"Home","title":"TypedMatrices.jl Documentation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Welcome to the documentation for TypedMatrices.jl.","category":"page"},{"location":"","page":"Home","title":"Home","text":"An extensible Julia matrix collection utilizing type system to enhance performance.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Check Getting Started for a quick start.","category":"page"},{"location":"#Features","page":"Home","title":"Features","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Types of matercies, can be used in algorithm tests or other.\nOptimized matrix operations for these types\nProperties (tags) for matrices.\nGrouping matercies and allow user to define their own types.\nFiltering matrices by properties or groups.","category":"page"}] }