OP-Hw5.docx - Hw5.This exercise is essentially an exercise of code from several programs that can be set to one another Part A In this part you should

# OP-Hw5.docx - Hw5.This exercise is essentially an exercise...

• 5

This preview shows page 1 - 2 out of 5 pages.

Hw5 This exercise is essentially an exercise of code from several programs that can be set to one another . Part A In this part you should implement different versions for steepest decent that differ Using the one- dimensional search method by α : - Secant method . - Factor method . - Least squares . Tow first methods require a 2 start point, third 3. For the first 2 methods the first point would be 0.0, the second find using find_minimal_alpha2. For the third method, square adjustment method, we take the third (0.0, alpha 2/2, alpha 2) where alpha2 is the value returned by Find_minimal_alpha2 . Your routine declaration will be : typedef double (*FUN_PTR)(double[]); // pointer to function typedef void (*GRAD_FUN_PTR)(double grad[], double x[] ); // pointer //to function typedef int VECTOR_CONVERGENCE_TEST(double arr[], int n, double epsilon); void steepest(double xn[], double x0[], int n, FUN_PTR f, GRAD_FUN_PTR grad, double epsilon, VECTOR_CONVERGENCE_TEST v) When xn points to an array in which the optimum point is reported, x0 the point of the search start, n the number of variables, f points to the target function, grad points to the residual redemption,  #### You've reached the end of your free preview.

Want to read all 5 pages?

• • •  