]> git.rustad.me Git - nummat1/commitdiff
Fix error in gradient
authorBjørn Rustad <bjorn@rustad.me>
Fri, 30 Sep 2011 13:20:11 +0000 (15:20 +0200)
committerBjørn Rustad <bjorn@rustad.me>
Fri, 30 Sep 2011 13:20:11 +0000 (15:20 +0200)
bj_function.py

index 6eb99fda6ababc24f5b9e37daecfd11d894dd5f4..34c6e410a971525123c5187e37109bc73582ab92 100644 (file)
@@ -4,7 +4,7 @@ def function_g(x, H, b, c):
 
 # Calculate gradient of g in point x
 def gradient_g(x, H, b, c):
-    return -b.T + H.dot(x) + (1.0/3.0) * x.T.dot(_C(x,c))
+    return -b + H.dot(x) + (1.0/3.0) * _C(x,c).dot(x)
 
 # Calculate hessian of g in point x
 def hessian_g(x, H, b, c):