Skip to content

ensure materialise and linearise preserves aux#195

Open
jpbrodrick89 wants to merge 1 commit intopatrick-kidger:mainfrom
jpbrodrick89:jpb/aux-consistency
Open

ensure materialise and linearise preserves aux#195
jpbrodrick89 wants to merge 1 commit intopatrick-kidger:mainfrom
jpbrodrick89:jpb/aux-consistency

Conversation

@jpbrodrick89
Copy link
Contributor

Fixes #194 , currently materialise(JacobianLinearOperator) returns an AuxLinearOperator but materialise(AuxLinearOperator) returns the materialised inner operator with the aux stripped. After this PR, materialise(AuxLinearOperator) will preserve the aux by returning AuxLinearOperator(linearise(operator.operator), operator.aux).

The same change has been made for linearise.

I also make a change to the handling of linearise/materialise for ComposedLinearOperator which changes it to returning an AuxLinearOperator, if the FIRST operator has aux. This means materialise(...).aux will always work if the original operator returned some kind of aux.

Note we currently have ill-defined behaviour if a user tries something strange like adding two operators that have aux or applying an operator to an aux operator. We might want to either make explicit the behaviour that we (may) silently strip aux, or catch this early and recommend the user to use an equivalent of _NoAuxOut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent behaviour of materialise wrt Aux

1 participant