Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Linear Operators for Julia

License

NotificationsYou must be signed in to change notification settings

JuliaSmoothOptimizers/LinearOperators.jl

Repository files navigation

AJulia Linear Operator Package

DocumentationLinux/macOS/Windows/FreeBSDCoverageDOI
docs-stabledocs-devbuild-ghbuild-cirruscodecovdoi

How to Cite

If you use LinearOperators.jl in your work, please cite using the format given inCITATION.cff.

Philosophy

Operators behave like matrices (with some exceptions - see below) but are defined by their effect when applied to a vector. They can be transposed, conjugated, or combined with other operators cheaply. The costly operation is deferred until multiplied with a vector.

Compatibility

Julia 1.6 and up.

How to Install

pkg> add LinearOperatorspkg> test LinearOperators

How to use

Check thetutorial.

Operators Available

OperatorDescription
LinearOperatorBase class. Useful to define operators from functions
TimedLinearOperatorLinear operator instrumented with timers fromTimerOutputs
BlockDiagonalOperatorBlock-diagonal linear operator
opEyeIdentity operator
opOnesAll ones operator
opZerosAll zeros operator
opDiagonalSquare (equivalent todiagm()) or rectangular diagonal operator
opInverseEquivalent to\
opCholeskyMore efficient thanopInverse for symmetric positive definite matrices
opHouseholderApply a Householder transformationI-2hh'
opHermitianRepresent a symmetric/hermitian operator based on the diagonal and strict lower triangle
opRestrictionRepresent a selection of "rows" when composed on the left with an existing operator
opExtensionRepresent a selection of "columns" when composed on the right with an existing operator
LBFGSOperatorLimited-memory BFGS approximation in operator form (damped or not)
InverseLBFGSOperatorInverse of a limited-memory BFGS approximation in operator form (damped or not)
LSR1OperatorLimited-memory SR1 approximation in operator form

Utility Functions

FunctionDescription
check_ctransposeCheap check thatA' is correctly implemented
check_hermitianCheap check thatA = A'
check_positive_definiteCheap check that an operator is positive (semi-)definite
diagExtract the diagonal of an operator
MatrixConvert an abstract operator to a dense array
hermitianDetermine whether the operator is Hermitian
push!For L-BFGS or L-SR1 operators, push a new pair {s,y}
reset!For L-BFGS or L-SR1 operators, reset the data
showDisplay basic information about an operator
sizeReturn the size of a linear operator
symmetricDetermine whether the operator is symmetric
normestEstimate the 2-norm
solve_shifted_system!Solves linear system$(B + \sigma I) x = b$, where$B$ is a forward L-BFGS operator and$\sigma \geq 0$.

Other Operations on Operators

Operators can be transposed (transpose(A)), conjugated (conj(A)) and conjugate-transposed (A').Operators can be sliced (A[:,3],A[2:4,1:5],A[1,1]), but unlike matrices, slices always returnoperators (see differences below).

Differences

Unlike matrices, an operator never reduces to a vector or a number.

A=rand(5,5)opA=LinearOperator(A)A[:,1]*3# VectoropA[:,1]*3# LinearOperatorA[:,1]* [3]# ERRORopA[:,1]* [3]# Vector

This is also true forA[i,J], which returns vectors on 0.5, and for the scalarA[i,j].Similarly,opA[1,1] is an operator of size (1,1):"

opA[1,1]# LinearOperatorA[1,1]# Number

In the same spirit, the operatorfull always returns a matrix.

full(opA[:,1])# nx1 matrix

Other Operators

  • LimitedLDLFactorizations features a limited-memoryLDLT factorization operator that may be used as preconditionerin iterative methods
  • MUMPS.jl features a fulldistributed-memory factorization operator that may be used to represent thepreconditioner in, e.g., constraint-preconditioned Krylov methods.

Bug reports and discussions

If you think you found a bug, feel free to open anissue.Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussionhere. This forum is for general discussion about this repository and theJuliaSmoothOptimizers organization, so questions about any of our packages are welcome.

Packages

No packages published

Contributors27

Languages


[8]ページ先頭

©2009-2025 Movatter.jp