-
Simplifications that are automatically done by
LazyAlgebra
may change multipliers but must not change the coefficients of the mappings. Callsimplify(A)
to apply further simplifications that may change the coefficients of the mappings inA
. For instance, assuminga
is an array,inv(Diag(a))
automatically yieldsInverse(Diag(a))
whilesimplify(inv(Diag(a)))
yieldsDiag(1 ./ a)
. -
Calling BLAS should be avoided in some cases, either because BLAS is slower than optimized Julia code, or because BLAS may use more than one thread in inappropriate places (e.g., Julia multi-threaded code).
-
As far as possible, make the code more agnostic of the element type of the arguments. This would be useful to deal with arrays whose elements have non-standard numerical types as physical quantities in the
Unitful
package.
- Make
set_val!
for sparse operators returns the same result assetindex!
.
-
Simplify and generalize
vfill!
andvzero!
to be able to work withUnitful
elements. -
Automatically specialize
multiplier_type
forUnitful.AbstractQuantity
.
- Improve
promote_multiplier
and make it easy to extend. The work done bypromote_multiplier
is break in several functions:multiplier_type(x)
yields the element type corresponding tox
(which can be a number, an array of numbers, or a number type),multiplier_floatingpoint_type(args...)
combines the types given bymultiplier_type
for allargs...
to yield a concrete floating-point type. The methodmultiplier_type
is intended to be extended by other packages.
-
Replace
@assert
by@certify
. Compared to@assert
, the assertion made by@certify
may never be disabled whatever the optimization level. -
Provide default
vcreate
method for Gram operators.
-
Sub-module
LazyAlgebra.Foundations
(previouslyLazyAlgebra.LazyAlgebraLowLevel
) exports types and methods needed to extend or implementLazyAlgebra
mappings. -
The finite difference operator was too limited (finite differences were forcibly computed along all dimensions and only 1st order derivatives were implemented) and slow (because the leading dimension was used to store the finite differences along each dimension). The new family of operators can compute 1st or 2nd derivatives along all or given dimensions. The last dimension of the result is used to store finite differences along each chosen dimensions; the operators are much faster (at least 3 times faster for 200×200 arrays for instance). Applying the Gram composition
D'*D
of a finite difference operatorD
is optimized and is about 2 times faster than applyingD
and thenD'
. TypeSimpleFiniteDifferences
is no longer available, useDiff
instead (Diff
was available as a shortcut in previous releases).
-
New rules:
α/A -> α*inv(A)
. -
Exported methods and types have been limited to the ones for the end-user. Use
using LazyAlgebra.LazyAlgebraLowLevel
to use low-level symbols. -
Large sub-package for sparse operators which are linear mappings with few non-zero coefficients (see doc. for
SparseOperator
andCompressedSparseOperator
). All common compressed sparse storage formats (COO, CSC and CSR) are supported and easy conversion between them is provided. Generalized matrix-vector multiplication is implemented and is as fast or significantly faster than withSparseArrays.SparseMatrixCSC
. -
Method
∇(A,x)
yields the Jacobian of the mappingA
at the variablesx
. IfA
is a linear-mapping, then∇(A,x)
yieldsA
whateverx
. The new typeJacobian
type is used to denote the Jacobian of a non-linear mapping. The notationA'
, which is strictly equivalent toadjoint(A)
, is only allowed for linear mappings and always denote the adjoint (conjugate transpose) ofA
. -
Method
gram(A)
yieldsA'*A
for the linear mappingA
. An associated decorated typeGram
is used to denote this specific expression and some constructions are automatically recognized as valid Gram operators. Making this work for more complex constructions (like sums and compositions) would require to change the simplification rules (notably for the adjoint of such constructions). -
Methods
has_oneto_axes
,densearray
,densevector
anddensematrix
have been replaced byhas_standard_indexing
andto_flat_array
fromArrayTools
. -
The exported constant
I = Identity()
has been renamed asId
to avoid conflicts with standardLinearAlgebra
package.Id
is systematically exported whileI
was only exported if not already defined in theBase
module. The constantLinearAlgebra.I
and, more generally, any instance ofLinearAlgebra.UniformScaling
is recognized by LazyAlgebra in the sense that they behave as the identity when combined with any LazyAlgebra mapping. -
operand
andoperands
are deprecated in favor ofunveil
andterms
which are less confusing. Theterms
method behaves exactly like the formeroperands
method. Compared tooperand
, theunveil
method has a better defined behavior: for a decorated mapping (that is an instance ofAdjoint
,Inverse
orInverseAdjoint
), it yields the embedded mapping; for other LazyAlgebra mappings (including scaled ones), it returns its argument; for an instance ofLinearAlgebra.UniformScaling
, it returns the equivalent LazyAlgebra mapping (that isλ⋅Id
). To get the mapping embedded in a scaled mapping, call theunscaled
method. -
unscaled
is introduced as the counterpart ofmultiplier
so thatmultiplier(A)*unscaled(A) === A
always holds. Previously it was wrongly suggested to useoperand
(nowunveil
) for that but, then the strict equality was only true forA
being a scaled mapping. These methods also work for instances ofLinearAlgebra.UniformScaling
. -
NonuniformScalingOperator
deprecated in favor ofNonuniformScaling
. -
In most cases, complex-valued arrays and multipliers are supported.
-
Argument
scratch
is no longer optional in low-levelvcreate
. -
Not so well defined
HalfHessian
andHessian
have been removed (HalfHessian
is somewhat equivalent toGram
). -
New
gram(A)
method which yieldsA'*A
and aliasGram{typeof(A)}
to represent the type of this construction. -
The
CroppingOperators
sub-module has been renamedCropping
. -
Add cropping and zero-padding operators.
-
Left multiplication by a scalar and left/right multiplication by a non-uniform scaling (a.k.a. diagonal operator) is optimized for sparse and non-uniform scaling operators.
-
Provide
unpack!
method to unpack the non-zero coefficients of a sparse operator and extendreshape
to be applicable to a sparse operator. -
Make constructor of a sparse operator (
SparseOperator
) reminiscent of thesparse
method. Row and column dimensions can be a single scalar. -
Provide utility method
dimensions
which yields a dimension list out of its arguments and associated union typeDimensions
. -
A sparse operator (
SparseOperator
) can be converted to a regular array or to a sparse matrix (SparseMatrixCSC
) and reciprocally. -
Trait constructors now return trait instances (instead of type). This is more natural in Julia and avoid having different method names.
-
Skip bound checking when applying a
SparseOperator
(unless the operator structure has been corrupted, checking the dimensions of the arguments is sufficient to insure that indices are correct). -
Provide
lgemv
andlgemv!
for Lazily Generalized Matrix-Vector multiplication andlgemm
andlgemm!
for Lazily Generalized Matrix-Matrix multiplication. The names of these methods are reminiscent ofxGEMV
andxGEMM
BLAS subroutines in LAPACK (withx
the prefix corresponding to the type of the arguments). -
Deprecated
fastrange
is replaced byallindices
which is extended to scalar dimension and index intervals. -
Complete rewrite of the rules for simplifying complex constructions involving compositions and linear combination of mappings.
-
Add rule for left-division by a scalar.
-
UniformScalingOperator
has been suppressed (was deprecated). -
show
has been extend for mapping constructions. -
contents
, too vague, has been suppressed and replaced byoperands
oroperand
. Accessormultiplier
is provided to query the multiplier of a scaled mapping. Methodsgetindex
,first
andlast
are extended. In principle, direct reference to a field of any base mapping structures is no longer needed. -
The multiplier of a scaled mapping can now be any number although applying linear combination of mappings is still limited to real-valued multipliers.
-
Add
fftfreq
,rfftdims
,goodfftdim
andgoodfftdims
inLazyAlgebra.FFT
and re-exportfftshift
andifftshift
whenusing LazyAlgebra.FFT
. -
Add
is_same_mapping
to allow for automatic simplifications when building-up sums and compositions. -
Optimal, an more general, management of temporaries is now done via the
scratch
argument of thevcreate
andapply!
methods.InPlaceType
trait andis_applicable_in_place
method have been removed. -
promote_scalar
has been modified and renamed aspromote_multipler
. -
Provide
SimpleFiniteDifferences
operator. -
Provide
SparseOperator
. -
LinearAlgebra.UniformScaling
can be combined with mappings in LazyAlgebra. -
UniformScalingOperator
has been deprecated in favor of aScaled
version of the identity. -
Compatible with Julia 0.6, 0.7 and 1.0.
-
Provide (partial) support for complex-valued arrays.
-
Traits replace abstract types such as
Endomorphism
,SelfAdjointOperator
, etc. Some operators may be endomorphisms or not. For instance the complex-to-complexFFTOperator
is an endomorphism while the real-to-complex FFT is not. Another example:NonuniformScaling
is self-adjoint if its coefficients are reals, not if they are complexes. This also overcomes the fact that multiple heritage is not possible in Julia. -
The
apply!
method has been rewritten to allow for optimized combination to doy = α*Op(A)⋅x + β*y
(as in LAPACK and optimized if scalars have values 0, ±1):apply!(α::Real, Op::Type{<:Operations}, A::LinearMapping, x, β::Real, y) apply!(β::Real, y, α::Real, Op::Type{<:Operations}, A::LinearMapping, x)