Merge branch 'BFGS' of https://bitbucket.org/rcockett/simpeg into richards

This commit is contained in:
Rowan Cockett
2013-11-19 17:46:48 -08:00
5 changed files with 348 additions and 26 deletions
+2 -1
View File
@@ -241,7 +241,8 @@ function showClassDetail(cid, count) {
for (var i = 0; i < count; i++) {
tid = id_list[i];
if (toHide) {
document.getElementById('div_'+tid).style.display = 'none'
var divTid = document.getElementById('div_'+tid);
if(divTid !== null){divTid.style.display = 'none';}
document.getElementById(tid).className = 'hiddenRow';
}
else {
+4 -4
View File
@@ -276,16 +276,16 @@ def checkDerivative(fctn, x0, num=7, plotIt=True, dx=None, expectedOrder=2, tole
def getQuadratic(A, b):
def getQuadratic(A, b, c=0):
"""
Given A and b, this returns a quadratic, Q
Given A, b and c, this returns a quadratic, Q
.. math::
\mathbf{Q( x ) = 0.5 x A x + b x}
\mathbf{Q( x ) = 0.5 x A x + b x} + c
"""
def Quadratic(x, return_g=True, return_H=True):
f = 0.5 * x.dot( A.dot(x)) + b.dot( x )
f = 0.5 * x.dot( A.dot(x)) + b.dot( x ) + c
out = (f,)
if return_g:
g = A.dot(x) + b