tao-2.1-p0 2012-07-24

TaoDefaultComputeGradient

computes the gradient using finite differences.

Synopsis

#include "taosolver.h"  
PetscErrorCode TaoDefaultComputeGradient(TaoSolver tao,Vec X,Vec G,void *dummy) 
Collective on TaoSolver

Input Parameters

tao - the TaoSolver context
X - compute gradient at this point
dummy - not used

Output Parameters

G -Gradient Vector

Options Database Key

-tao_fd_gradient - Activates TaoDefaultComputeGradient()
-tao_fd_delta <delta> - change in x used to calculate finite differences

Note

This routine is slow and expensive, and is not currently optimized to take advantage of sparsity in the problem. Although TaoAppDefaultComputeGradient is not recommended for general use in large-scale applications, It can be useful in checking the correctness of a user-provided gradient. Use the tao method "tao_fd_test" to get an indication of whether your gradient is correct.

Note

This finite difference gradient evaluation can be set using the routine TaoSetGradientRoutine() or by using the command line option -tao_fd_gradient

See Also

TaoSetGradientRoutine()

Level:advanced
Location:src/interface/fdiff.c
TAO Solver Index
Table of Contents