Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pyadjoint/optimization/tao_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ def mult(self, A, x, y):
if self._shift != 0:
y.axpy(self._shift, x)

def multHermitian(self, A, x, y):
self.yinterface.from_petsc(x, self.x)
out = self.multHermitian_impl(A, self.x)
self.xinterface.to_petsc(y, out)
def multHermitian(self, AT, y, x):
self.yinterface.from_petsc(y, self.y)
Comment thread
jrmaddison marked this conversation as resolved.
out = self.multHermitian_impl(AT, self.y)
self.xinterface.to_petsc(x, out)
Comment thread
jrmaddison marked this conversation as resolved.

if self._shift != 0:
y.axpy(self._shift, x)
x.axpy(self._shift, y)

def mult_impl(self, A, x):
"""
Expand Down Expand Up @@ -355,7 +355,7 @@ def __init__(self, rf, *, apply_riesz=False, appctx=None,

self.xinterface = self.functional_interface
self.yinterface = self.control_interface
self.x = rf.functional._ad_copy()
self.x = rf.functional._ad_init_zero(dual=True)

@classmethod
def update_adjoint(self):
Expand Down