Skip to content
Snippets Groups Projects
Commit eeedb54a authored by Mark Woolrich's avatar Mark Woolrich
Browse files

*** empty log message ***

parent dc3e6ee0
No related branches found
No related tags found
No related merge requests found
...@@ -161,6 +161,18 @@ float diff2(const ColumnVector& x, const EvalFunction& func, int i,int j,float h ...@@ -161,6 +161,18 @@ float diff2(const ColumnVector& x, const EvalFunction& func, int i,int j,float h
return deriv; return deriv;
} }
ReturnMatrix gradient(const ColumnVector& x, const EvalFunction& func, float h,int errorord){
ColumnVector deriv(x.Nrows());
deriv = 0;
for(int i=1;i<=x.Nrows();i++){
deriv(i) = diff1(x,func,i,h,errorord);
}
deriv.Release();
return deriv;
}
ReturnMatrix hessian(const ColumnVector& x, const EvalFunction& func, float h,int errorord) ReturnMatrix hessian(const ColumnVector& x, const EvalFunction& func, float h,int errorord)
{ //evaluates the hessian of function "eval" at x in parameter space { //evaluates the hessian of function "eval" at x in parameter space
......
...@@ -76,6 +76,8 @@ float diff2(const ColumnVector& x, const EvalFunction& func, int i,float h,int e ...@@ -76,6 +76,8 @@ float diff2(const ColumnVector& x, const EvalFunction& func, int i,float h,int e
float diff2(const ColumnVector& x, const EvalFunction& func, int i,int j,float h,int errorord=4);// finite diff cross derivative float diff2(const ColumnVector& x, const EvalFunction& func, int i,int j,float h,int errorord=4);// finite diff cross derivative
ReturnMatrix gradient(const ColumnVector& x, const EvalFunction& func,float h,int errorord=4);// finite diff derivative vector
ReturnMatrix hessian(const ColumnVector& x, const EvalFunction& func,float h,int errorord=4);// finite diff hessian ReturnMatrix hessian(const ColumnVector& x, const EvalFunction& func,float h,int errorord=4);// finite diff hessian
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment