在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:JuliaMatrices/MatrixDepot.jl开源软件地址:https://github.com/JuliaMatrices/MatrixDepot.jl开源编程语言:Julia 84.3%开源软件介绍:Matrix DepotAn extensible test matrix collection for Julia.
Give access to a wealth of sample and test matrices and accompanying data.
A set of matrices is generated locally (with arguments controlling the special case).
Another set is loaded from one of the publicly accessible matrix collections
Access is like using MatrixDepot
?MatrixDepot # display package help info
A = matrixdepot("hilb", 10) # locally generated hilbert matrix dimensions (10,10)
A = matrixdepot("HB/1138_bus") # named matrix of the SuiteSparse Collection or md = mdopen("*/bfly") # named matrix with some extra data
A = md.A
co = md.coord
tx = md("Gname_10.txt")
md.<tab><tab> # overview of the "fields" of md returning like
# A m n dnz nnz coord Gname_10.txt G_10 Gcoord_10 or also mdinfo("gravity") # text info about the selected matrix
md = mdopen("gravity", 10, false) # localy generated example with rhs and solution
A = md.A
b = md.b
x = md.x InstallNOTE: If you use Windows, you need to install MinGW/MSYS or Cygwin in order to use the SuiteSparse sparse and MatrixMarket matrix collection interface. To install the release version, type julia> Pkg.add("MatrixDepot") UsageNamingMatrix NamesEvery Matrix type has a unique name, which is a string of one of the forms:
The names are similar to relative path names, separated by a slash character.
The components of the name must not contain any of the characters Groupsa set of matrices may be assigned to predefined or user-defined groups.
The group names are represented as Numeric IdentifiersEvery matrix has a numeric identifier, which is unique for its area:
Sets of Matrix Names - PatternFor some functions it makes sense to have lists of matrix names to operate on, for example to select a set matrices with certain properties. These sets are descibed by 'Patterns', which are applied to matrix names and also to other matrix properties. The following pattern types are supported:
To express Examples: "gravity" | "HB/*" & ~(ishermitian & iscomplex) & ~sp(20:30) The set of all known matrices can be expressed as empty tuple A convenient form of a predicate-generator is @pred(expression) where expression is a valid Examples:
There is s set of predefined predicate functions including:
Special predicate generators Accessing DataListing matrices with certain propertiesmdinfo() # overview
listgroups() # list all defined group names
mdlist(pattern) # array of matrix names according to pattern
listdata(pattern) # array of `MatrixData`objects according to pattern
listnames(pattern) # MD-formatted listing of all names according to pattern
listdir("*//*") # MD-formatted - group over part before `//` - count matching Information about matricesmdinfo() # overview over database
mdinfo(pattern) # individual documentation about matrix(es) matching pattern Generating a matrix
Accessing Meta-DataIn general the first form is preferrable, if only the pure matrix is required. For remote collections no arguments are used. The second form allows to access all types of 'meta-data', which may be available for some local or remote matrices. Examples:
The last example shows, how to access textual meta-data, when the name contains
The function The system function
Backoffice JobsThe remote data are originally stored at the remote web-site of one of the matrix collections. Before they are presented to the user, they are downloaded to local disk storage, which serves as a permanent cache. By default, the data directory is a scratchspace managed by The data directory can be queried by
The occasional user needs not bother about downloads, because that is done in the background if matrix files are missing on the local disk. The same is true for the data required by Bulk DownloadsLoad Header DataA download job to transmit a subset of remote matrix files may be started to
load header data for all files. Header data always include the matrix type
according to the matrix-market-format and the size values
That is possible for the SuiteSparse collection and the
NIST MatrixMarket collection.
The patterns can always refer to matrix names and id numbers.
In the case of In general it would be possible by Load Complete Data Files
Please do not:
Make a reasonable selection, before you start a bulk download. Local and already loaded matrices are skipped automatically. Example:
Sample SessionTo see an overview of the matrices in the collection, type julia> using MatrixDepot
julia> mdinfo()
Currently loaded Matrices
–––––––––––––––––––––––––––
builtin(#)
–––––––––– ––––––––––– ––––––––––– ––––––––––– –––––––––– –––––––––––– ––––––––––– ––––––––––– ––––––––––––– ––––––––––––
1 baart 7 circul 13 fiedler 19 gravity 25 invhilb 31 magic 37 parter 43 randcorr 49 shaw 55 ursell
2 binomial 8 clement 14 forsythe 20 grcar 26 invol 32 minij 38 pascal 44 rando 50 smallworld 56 vand
3 blur 9 companion 15 foxgood 21 hadamard 27 kahan 33 moler 39 pei 45 randsvd 51 spikes 57 wathen
4 cauchy 10 deriv2 16 frank 22 hankel 28 kms 34 neumann 40 phillips 46 rohess 52 toeplitz 58 wilkinson
5 chebspec 11 dingdong 17 gilbert 23 heat 29 lehmer 35 oscillate 41 poisson 47 rosser 53 tridiag 59 wing
6 chow 12 erdrey 18 golub 24 hilb 30 lotkin 36 parallax 42 prolate 48 sampling 54 triw
user(#)
–––––––––
1 randsym
Groups
–––––– ––––––– ––––– –––– ––––– ––––– ––––––– ––––––– –––––– –––––– ––––––– –––––– –––––––––
all builtin local user eigen graph illcond inverse posdef random regprob sparse symmetric
Suite Sparse of
–––––––––––– ––––
2770 2833
MatrixMarket of
–––––––––––– –––
488 498
We can generate a 4-by-4 Hilbert matrix by typing julia> matrixdepot("hilb", 4)
4x4 Array{Float64,2}:
1.0 0.5 0.333333 0.25
0.5 0.333333 0.25 0.2
0.333333 0.25 0.2 0.166667
0.25 0.2 0.166667 0.142857 We can type the matrix name to get documentation about the matrix. julia> mdinfo("hilb")
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.
Input options:
• [type,] dim: the dimension of the matrix;
• [type,] row_dim, col_dim: the row and column dimensions.
Groups: ["inverse", "ill-cond", "symmetric", "pos-def"]
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. We can also specify the data type for locally generated matrices. julia> matrixdepot("hilb", Float16, 5, 3)
5x3 Array{Float16,2}:
1.0 0.5 0.33325
0.5 0.33325 0.25
0.33325 0.25 0.19995
0.25 0.19995 0.16663
0.19995 0.16663 0.14282
julia> matrixdepot("hilb", Rational{Int}, 4)
4x4 Array{Rational{T<:Integer},2}:
1//1 1//2 1//3 1//4
1//2 1//3 1//4 1//5
1//3 1//4 1//5 1//6
1//4 1//5 1//6 1//7 Matrices can be accessed by a variety of patterns and composed patterns.
Integer numbers julia> mdlist(sp(1)) # here sp(1) is the ident number of the SuiteSparse collection
list(1)
–––––––––––
HB/1138_bus
julia> listnames(builtin(1, 5:10)) # the internal numbering of the builtin-functions
list(7)
––––––– –––––––– –––– –––––– ––––––– ––––––––– ––––––
baart chebspec chow circul clement companion deriv2
julia> mdlist(builtin(1:4, 6, 10:15) | user(1:10) )
12-element Array{String,1}:
"baart"
"binomial"
"blur"
"cauchy"
"chow"
"deriv2"
"dingdong"
"erdrey"
"fiedler"
"forsythe"
"foxgood"
"randsym" While the We can type a group name to see all the matrices in that group. Group names are always written as symbols to distinguish them form matrix names and pattern, which are always strings. julia> listnames(:symmetric)
list(22)
–––––––– –––––––– ––––––– –––––– ––––––––– –––––––– ––––––– –––––––––
cauchy dingdong hilb lehmer oscillate poisson randsym wilkinson
circul fiedler invhilb minij pascal prolate tridiag
clement hankel kms moler pei randcorr wathen Extend Matrix DepotIt is possible to extend the builtin local problems with user defined generators and groups. We can add new matrix generators and define new groups of matrices. References
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论