petsc-3.7.1 2016-05-15
Report Typos and Errors

TaoDefaultComputeGradient

computes the gradient using finite differences.

Synopsis

#include "petsctao.h"  
PetscErrorCode TaoDefaultComputeGradient(Tao tao,Vec X,Vec G,void *dummy)
Collective on Tao Many br

Input Parameters

tao - the Tao context Many br
X - compute gradient at this point Many br
dummy - not used Many br

Output Parameters

G -Gradient Vector Many br

Options Database Key

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

Many br

Note

This routine is slow and expensive, and is not currently optimized Many brto take advantage of sparsity in the problem. Although Many brTaoAppDefaultComputeGradient is not recommended for general use Many brin large-scale applications, It can be useful in checking the Many brcorrectness of a user-provided gradient. Use the tao method TAOTEST Many brto get an indication of whether your gradient is correct. Many br

Note

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

See Also

TaoSetGradientRoutine()

Level:advanced
Location:
src/tao/interface/fdiff.c
Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages