File: TaoLineSearchApply.html

package info (click to toggle)
petsc 3.14.5%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 266,472 kB
  • sloc: ansic: 680,898; python: 33,303; cpp: 16,324; makefile: 14,022; f90: 13,731; javascript: 10,713; fortran: 9,581; sh: 1,373; xml: 619; objc: 445; csh: 192; pascal: 148; java: 13
file content (92 lines) | stat: -rw-r--r-- 7,408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TaoLineSearch/TaoLineSearchApply.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>TaoLineSearchApply</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>petsc-3.14.5 2021-03-03</b></div>
   <div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.14.5 v3.14.5 docs/manualpages/TaoLineSearch/TaoLineSearchApply.html "><small>Report Typos and Errors</small></a></div>
<A NAME="TaoLineSearchApply"><H1>TaoLineSearchApply</H1></A>
Performs a line-search in a given step direction.  Criteria for acceptable step length depends on the line-search algorithm chosen 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petsctaolinesearch.h" 
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../TaoLineSearch/TaoLineSearchApply.html#TaoLineSearchApply">TaoLineSearchApply</A>(TaoLineSearch ls, <A HREF="../Vec/Vec.html#Vec">Vec</A> x, <A HREF="../Sys/PetscReal.html#PetscReal">PetscReal</A> *f, <A HREF="../Vec/Vec.html#Vec">Vec</A> g, <A HREF="../Vec/Vec.html#Vec">Vec</A> s, <A HREF="../Sys/PetscReal.html#PetscReal">PetscReal</A> *steplength, TaoLineSearchConvergedReason *reason)
</PRE>
Collective on TaoLineSearch
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ls </B></TD><TD>- the <A HREF="../Tao/Tao.html#Tao">Tao</A> context
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>x </B></TD><TD>- The current solution (on output x contains the new solution determined by the line search)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>f </B></TD><TD>- objective function value at current solution (on output contains the objective function value at new solution)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>g </B></TD><TD>- gradient evaluated at x (on output contains the gradient at new solution)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>s </B></TD><TD>- search direction
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>x </B></TD><TD>- new solution
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>f </B></TD><TD>- objective function value at x
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>g </B></TD><TD>- gradient vector at x
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>steplength </B></TD><TD>- scalar multiplier of s used ( x = x0 + steplength * x)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>reason </B></TD><TD>- reason why the line-search stopped
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">reason will be set to one of</FONT></H3>
<P>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_FAILED_ASCENT </B></TD><TD>- initial line search step * g is not descent direction
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_FAILED_INFORNAN </B></TD><TD>- function evaluation gives Inf or Nan value
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_FAILED_BADPARAMETER </B></TD><TD>- negative value set as parameter
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_HALTED_MAXFCN </B></TD><TD>- maximum number of function evaluation reached
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_HALTED_UPPERBOUND </B></TD><TD>- step is at upper bound
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_HALTED_LOWERBOUND </B></TD><TD>- step is at lower bound
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_HALTED_RTOL </B></TD><TD>- range of uncertainty is smaller than given tolerance
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_HALTED_USER </B></TD><TD>- user can set this reason to stop line search
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_HALTED_OTHER </B></TD><TD>- any other reason
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>TAOLINESEARCH_SUCCESS </B></TD><TD>- successful line search
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Note</FONT></H3>
The algorithm developer must set up the TaoLineSearch with calls to
<A HREF="../TaoLineSearch/TaoLineSearchSetObjectiveRoutine.html#TaoLineSearchSetObjectiveRoutine">TaoLineSearchSetObjectiveRoutine</A>() and <A HREF="../TaoLineSearch/TaoLineSearchSetGradientRoutine.html#TaoLineSearchSetGradientRoutine">TaoLineSearchSetGradientRoutine</A>(), <A HREF="../TaoLineSearch/TaoLineSearchSetObjectiveAndGradientRoutine.html#TaoLineSearchSetObjectiveAndGradientRoutine">TaoLineSearchSetObjectiveAndGradientRoutine</A>(), or <A HREF="../TaoLineSearch/TaoLineSearchUseTaoRoutines.html#TaoLineSearchUseTaoRoutines">TaoLineSearchUseTaoRoutines</A>()
<P>
<H3><FONT COLOR="#CC3333">Note</FONT></H3>
You may or may not need to follow this with a call to
<A HREF="../Tao/TaoAddLineSearchCounts.html#TaoAddLineSearchCounts">TaoAddLineSearchCounts</A>(), depending on whether you want these
evaluations to count toward the total function/gradient evaluations.
<P>

<P>
.seealso: <A HREF="../TaoLineSearch/TaoLineSearchCreate.html#TaoLineSearchCreate">TaoLineSearchCreate</A>(), <A HREF="../TaoLineSearch/TaoLineSearchSetType.html#TaoLineSearchSetType">TaoLineSearchSetType</A>(), <A HREF="../TaoLineSearch/TaoLineSearchSetInitialStepLength.html#TaoLineSearchSetInitialStepLength">TaoLineSearchSetInitialStepLength</A>(), <A HREF="../Tao/TaoAddLineSearchCounts.html#TaoAddLineSearchCounts">TaoAddLineSearchCounts</A>()
<P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>beginner<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/tao/linesearch/interface/taolinesearch.c.html#TaoLineSearchApply">src/tao/linesearch/interface/taolinesearch.c</A>
<P><H3><FONT COLOR="CC3333">Implementations</FONT></H3><A HREF="../../../src/tao/linesearch/impls/armijo/armijo.c.html#TaoLineSearchApply_Armijo">TaoLineSearchApply_Armijo in src/tao/linesearch/impls/armijo/armijo.c</A><BR>
<A HREF="../../../src/tao/linesearch/impls/gpcglinesearch/gpcglinesearch.c.html#TaoLineSearchApply_GPCG">TaoLineSearchApply_GPCG in src/tao/linesearch/impls/gpcglinesearch/gpcglinesearch.c</A><BR>
<A HREF="../../../src/tao/linesearch/impls/morethuente/morethuente.c.html#TaoLineSearchApply_MT">TaoLineSearchApply_MT in src/tao/linesearch/impls/morethuente/morethuente.c</A><BR>
<A HREF="../../../src/tao/linesearch/impls/owarmijo/owarmijo.c.html#TaoLineSearchApply_OWArmijo">TaoLineSearchApply_OWArmijo in src/tao/linesearch/impls/owarmijo/owarmijo.c</A><BR>
<A HREF="../../../src/tao/linesearch/impls/unit/unit.c.html#TaoLineSearchApply_Unit">TaoLineSearchApply_Unit in src/tao/linesearch/impls/unit/unit.c</A><BR>
<BR><A HREF="./index.html">Index of all TaoLineSearch routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>