Issue #15 Approximate Hessians. By default these are not implemented, and are the same as J and Jt

This commit is contained in:
Rowan Cockett
2013-11-04 09:53:38 -08:00
parent 224b0cea9e
commit 56bacc4a27
2 changed files with 30 additions and 2 deletions
+29 -1
View File
@@ -150,10 +150,38 @@ class Problem(object):
:rtype: numpy.array
:return: JTv
Transpose of J
Effect of transpose of J on a vector v.
"""
pass
def J_approx(self, m, v, u=None):
"""
:param numpy.array m: model
:param numpy.array v: vector to multiply
:param numpy.array u: fields
:rtype: numpy.array
:return: Jv
Approximate effect of J on a vector v
"""
return self.J(m, v, u)
def Jt_approx(self, m, v, u=None):
"""
:param numpy.array m: model
:param numpy.array v: vector to multiply
:param numpy.array u: fields
:rtype: numpy.array
:return: JTv
Approximate transpose of J*v
"""
return self.Jt(m, v, u)
def field(self, m):
"""
The field given the model.