source: branches/cache/cppad/local/prototype_op.hpp @ 3324

Last change on this file since 3324 was 3324, checked in by bradbell, 6 years ago

merge trunk changes into cache

  • Property svn:keywords set to Id
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/forward_dir/cppad/local/prototype_op.hppmergedeligible
    /trunk/cppad/local/prototype_op.hppmergedeligible
    /branches/atomic/cppad/local/prototype_op.hpp2798-2858
    /branches/base_require/cppad/local/prototype_op.hpp2045-2056
    /branches/memory/cppad/local/prototype_op.hpp1964-1983
    /branches/multi_thread/cppad/local/prototype_op.hpp2125-2133
    /branches/multiple_result/cppad/local/prototype_op.hpp1584-1587
    /branches/omp_alloc/cppad/local/prototype_op.hpp1921-1947
    /branches/optimize/cppad/local/prototype_op.hpp1490-1496
    /branches/pthread/cppad/local/prototype_op.hpp2061-2081
    /branches/sparse/cppad/local/prototype_op.hpp2475-2479
    /branches/sparsity/cppad/local/prototype_op.hpp1544-1549
    /branches/thread/cppad/local/prototype_op.hpp2134-2177
    /branches/user_atomic/cppad/local/prototype_op.hpp1837-1864
File size: 42.3 KB
Line 
1/* $Id: prototype_op.hpp 3324 2014-09-12 12:14:53Z bradbell $ */
2# ifndef CPPAD_PROTOTYPE_OP_INCLUDED
3# define CPPAD_PROTOTYPE_OP_INCLUDED
4
5/* --------------------------------------------------------------------------
6CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
7
8CppAD is distributed under multiple licenses. This distribution is under
9the terms of the
10                    Eclipse Public License Version 1.0.
11
12A copy of this license is included in the COPYING file of this distribution.
13Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
14-------------------------------------------------------------------------- */
15
16
17namespace CppAD { // BEGIN_CPPAD_NAMESPACE
18/*!
19\file prototype_op.hpp
20Documentation for generic cases (these generic cases are never used).
21*/
22
23// ==================== Unary operators with one result ====================
24
25
26/*!
27Prototype for forward mode unary operator with one result (not used).
28
29\tparam Base
30base type for the operator; i.e., this operation was recorded
31using AD< \a Base > and computations by this routine are done using type
32\a Base.
33
34\param p
35lowest order of the Taylor coefficient that we are computing.
36
37\param q
38highest order of the Taylor coefficient that we are computing.
39
40\param i_z
41variable index corresponding to the result for this operation;
42i.e. the row index in \a taylor corresponding to z.
43
44\param i_x
45variable index corresponding to the argument for this operator;
46i.e. the row index in \a taylor corresponding to x.
47
48\param cap_order
49maximum number of orders that will fit in the \c taylor array.
50
51\param taylor
52\b Input: <code>taylor [ i_x * cap_order + k ]</code>,
53for k = 0 , ... , q,
54is the k-th order Taylor coefficient corresponding to x.
55\n
56\b Input: <code>taylor [ i_z * cap_order + k ]</code>,
57for k = 0 , ... , p-1,
58is the k-th order Taylor coefficient corresponding to z.
59\n
60\b Output: <code>taylor [ i_z * cap_order + k ]</code>,
61for k = p , ... , q,
62is the k-th order Taylor coefficient corresponding to z.
63
64\par Checked Assertions
65\li NumArg(op) == 1
66\li NumRes(op) == 1
67\li q < cap_order
68\li p <= q
69*/
70template <class Base>
71inline void forward_unary1_op(
72        size_t p           ,
73        size_t q           ,
74        size_t i_z         ,
75        size_t i_x         ,
76        size_t cap_order   , 
77        Base*  taylor      )
78{
79        // This routine is only for documentaiton, it should not be used
80        CPPAD_ASSERT_UNKNOWN( false );
81}
82
83/*!
84Prototype for multiple direction forward mode unary operator with one result
85(not used).
86
87\tparam Base
88base type for the operator; i.e., this operation was recorded
89using AD< \a Base > and computations by this routine are done using type
90\a Base.
91
92\param q
93order of the Taylor coefficients that we are computing.
94
95\param r
96number of directions for Taylor coefficients that we are computing.
97
98\param i_z
99variable index corresponding to the last (primary) result for this operation;
100i.e. the row index in \a taylor corresponding to z.
101The auxillary result is called y has index \a i_z - 1.
102
103\param i_x
104variable index corresponding to the argument for this operator;
105i.e. the row index in \a taylor corresponding to x.
106
107\param cap_order
108maximum number of orders that will fit in the \c taylor array.
109
110\par tpv
111We use the notation
112<code>tpv = (cap_order-1) * r + 1</code>
113which is the number of Taylor coefficients per variable
114
115\param taylor
116\b Input: If x is a variable,
117<code>taylor [ arg[0] * tpv + 0 ]</code>,
118is the zero order Taylor coefficient for all directions and
119<code>taylor [ arg[0] * tpv + (k-1)*r + ell + 1 ]</code>,
120for k = 1 , ... , q,
121ell = 0, ..., r-1,
122is the k-th order Taylor coefficient
123corresponding to x and the ell-th direction.
124\n
125\b Input: <code>taylor [ i_z * tpv + 0 ]</code>,
126is the zero order Taylor coefficient for all directions and
127<code>taylor [ i_z * tpv + (k-1)*r + ell + 1 ]</code>,
128for k = 1 , ... , q-1,
129ell = 0, ..., r-1,
130is the k-th order Taylor coefficient
131corresponding to z and the ell-th direction.
132\n
133\b Output:
134<code>taylor [ i_z * tpv + (q-1)*r + ell + 1]</code>,
135ell = 0, ..., r-1,
136is the q-th order Taylor coefficient
137corresponding to z and the ell-th direction.
138
139\par Checked Assertions
140\li NumArg(op) == 1
141\li NumRes(op) == 2
142\li i_x < i_z
143\li 0 < q
144\li q < cap_order
145*/
146template <class Base>
147inline void forward_unary1_op_dir(
148        size_t q           ,
149        size_t r           ,
150        size_t i_z         ,
151        size_t i_x         ,
152        size_t cap_order   , 
153        Base*  taylor      )
154{
155        // This routine is only for documentaiton, it should not be used
156        CPPAD_ASSERT_UNKNOWN( false );
157}
158
159/*!
160Prototype for zero order forward mode unary operator with one result (not used).
161\tparam Base
162base type for the operator; i.e., this operation was recorded
163using AD< \a Base > and computations by this routine are done using type
164\a Base .
165
166\param i_z
167variable index corresponding to the result for this operation;
168i.e. the row index in \a taylor corresponding to z.
169
170\param i_x
171variable index corresponding to the argument for this operator;
172i.e. the row index in \a taylor corresponding to x.
173
174\param cap_order
175maximum number of orders that will fit in the \c taylor array.
176
177\param taylor
178\b Input: \a taylor [ \a i_x * \a cap_order + 0 ]
179is the zero order Taylor coefficient corresponding to x.
180\n
181\b Output: \a taylor [ \a i_z * \a cap_order + 0 ]
182is the zero order Taylor coefficient corresponding to z.
183
184\par Checked Assertions
185\li NumArg(op) == 1
186\li NumRes(op) == 1
187\li \a i_x < \a i_z
188\li \a 0 < \a cap_order
189*/
190template <class Base>
191inline void forward_unary1_op_0(
192        size_t i_z         ,
193        size_t i_x         ,
194        size_t cap_order   , 
195        Base*  taylor      )
196{
197        // This routine is only for documentaiton, it should not be used
198        CPPAD_ASSERT_UNKNOWN( false );
199}
200
201/*!
202Prototype for reverse mode unary operator with one result (not used).
203
204This routine is given the partial derivatives of a function
205G(z , x , w, u ... )
206and it uses them to compute the partial derivatives of
207\verbatim
208        H( x , w , u , ... ) = G[ z(x) , x , w , u , ... ]
209\endverbatim
210
211\tparam Base
212base type for the operator; i.e., this operation was recorded
213using AD< \a Base > and computations by this routine are done using type
214\a Base .
215
216\param d
217highest order Taylor coefficient that
218we are computing the partial derivatives with respect to.
219
220\param i_z
221variable index corresponding to the result for this operation;
222i.e. the row index in \a taylor to z.
223
224\param i_x
225variable index corresponding to the argument for this operation;
226i.e. the row index in \a taylor corresponding to x.
227
228\param cap_order
229maximum number of orders that will fit in the \c taylor array.
230
231\param taylor
232\a taylor [ \a i_x * \a cap_order + k ]
233for k = 0 , ... , \a d
234is the k-th order Taylor coefficient corresponding to x.
235\n
236\a taylor [ \a i_z * \a cap_order + k ]
237for k = 0 , ... , \a d
238is the k-th order Taylor coefficient corresponding to z.
239
240\param nc_partial
241number of colums in the matrix containing all the partial derivatives.
242
243\param partial
244\b Input: \a partial [ \a i_x * \a nc_partial + k ]
245for k = 0 , ... , \a d
246is the partial derivative of G( z , x , w , u , ... ) with respect to
247the k-th order Taylor coefficient for x.
248\n
249\b Input: \a partial [ \a i_z * \a nc_partial + k ]
250for k = 0 , ... , \a d
251is the partial derivative of G( z , x , w , u , ... ) with respect to
252the k-th order Taylor coefficient for z.
253\n
254\b Output: \a partial [ \a i_x * \a nc_partial + k ]
255for k = 0 , ... , \a d
256is the partial derivative of H( x , w , u , ... ) with respect to
257the k-th order Taylor coefficient for x.
258\n
259\b Output: \a partial [ \a i_z * \a nc_partial + k ]
260for k = 0 , ... , \a d
261may be used as work space; i.e., may change in an unspecified manner.
262
263
264\par Checked Assumptions
265\li NumArg(op) == 1
266\li NumRes(op) == 1
267\li \a i_x < \a i_z
268\li \a d < \a cap_order
269\li \a d < \a nc_partial
270*/
271template <class Base>
272inline void reverse_unary1_op(
273        size_t      d            ,
274        size_t      i_z          ,
275        size_t      i_x          ,
276        size_t      cap_order    , 
277        const Base* taylor       ,
278        size_t      nc_partial   ,
279        Base*       partial      )
280{
281        // This routine is only for documentaiton, it should not be used
282        CPPAD_ASSERT_UNKNOWN( false );
283}
284
285// ==================== Unary operators with two results ====================
286
287/*!
288Prototype for forward mode unary operator with two results (not used).
289
290\tparam Base
291base type for the operator; i.e., this operation was recorded
292using AD< \a Base > and computations by this routine are done using type
293\a Base.
294
295\param p
296lowest order of the Taylor coefficients that we are computing.
297
298\param q
299highest order of the Taylor coefficients that we are computing.
300
301\param i_z
302variable index corresponding to the last (primary) result for this operation;
303i.e. the row index in \a taylor corresponding to z.
304The auxillary result is called y has index \a i_z - 1.
305
306\param i_x
307variable index corresponding to the argument for this operator;
308i.e. the row index in \a taylor corresponding to x.
309
310\param cap_order
311maximum number of orders that will fit in the \c taylor array.
312
313\param taylor
314\b Input: <code>taylor [ i_x * cap_order + k ]</code>
315for k = 0 , ... , q,
316is the k-th order Taylor coefficient corresponding to x.
317\n
318\b Input: <code>taylor [ i_z * cap_order + k ]</code>
319for k = 0 , ... , p - 1,
320is the k-th order Taylor coefficient corresponding to z.
321\n
322\b Input: <code>taylor [ ( i_z - 1) * cap_order + k ]</code>
323for k = 0 , ... , p-1,
324is the k-th order Taylor coefficient corresponding to the auxillary result y.
325\n
326\b Output: <code>taylor [ i_z * cap_order + k ]</code>,
327for k = p , ... , q,
328is the k-th order Taylor coefficient corresponding to z.
329\n
330\b Output: <code>taylor [ ( i_z - 1 ) * cap_order + k ]</code>,
331for k = p , ... , q,
332is the k-th order Taylor coefficient corresponding to
333the autillary result y.
334
335\par Checked Assertions
336\li NumArg(op) == 1
337\li NumRes(op) == 2
338\li i_x + 1 < i_z
339\li q < cap_order
340\li p <= q
341*/
342template <class Base>
343inline void forward_unary2_op(
344        size_t p           ,
345        size_t q           ,
346        size_t i_z         ,
347        size_t i_x         ,
348        size_t cap_order   , 
349        Base*  taylor      )
350{
351        // This routine is only for documentaiton, it should not be used
352        CPPAD_ASSERT_UNKNOWN( false );
353}
354
355/*!
356Prototype for multiple direction forward mode unary operator with two results
357(not used).
358
359\tparam Base
360base type for the operator; i.e., this operation was recorded
361using AD< \a Base > and computations by this routine are done using type
362\a Base.
363
364\param q
365order of the Taylor coefficients that we are computing.
366
367\param r
368number of directions for Taylor coefficients that we are computing.
369
370\param i_z
371variable index corresponding to the last (primary) result for this operation;
372i.e. the row index in \a taylor corresponding to z.
373The auxillary result is called y has index \a i_z - 1.
374
375\param i_x
376variable index corresponding to the argument for this operator;
377i.e. the row index in \a taylor corresponding to x.
378
379\param cap_order
380maximum number of orders that will fit in the \c taylor array.
381
382\par tpv
383We use the notation
384<code>tpv = (cap_order-1) * r + 1</code>
385which is the number of Taylor coefficients per variable
386
387\param taylor
388\b Input: <code>taylor [ i_x * tpv + 0 ]</code>
389is the zero order Taylor coefficient for all directions and
390<code>taylor [ i_x * tpv + (k-1)*r + ell + 1</code>
391for k = 1 , ... , q,
392ell = 0 , ..., r-1,
393is the k-th order Taylor coefficient
394corresponding to x and the ell-th direction.
395\n
396\b Input: <code>taylor [ i_z * tpv + 0 ]</code>,
397is the zero order Taylor coefficient for all directions and
398<code>taylor [ i_z * tpv + (k-1)*r + ell + 1 ]</code>,
399for k = 1 , ... , q-1,
400ell = 0, ..., r-1,
401is the k-th order Taylor coefficient
402corresponding to z and the ell-th direction.
403\n
404\b Input: <code>taylor [ (i_z-1) * tpv + 0 ]</code>,
405is the zero order Taylor coefficient for all directions and
406<code>taylor [ (i_z-1) * tpv + (k-1)*r + ell + 1 ]</code>,
407for k = 1 , ... , q-1,
408ell = 0, ..., r-1,
409is the k-th order Taylor coefficient
410corresponding to the auxillary result y and the ell-th direction.
411\n
412\b Output:
413<code>taylor [ i_z * tpv + (q-1)*r + ell + 1]</code>,
414ell = 0, ..., r-1,
415is the q-th order Taylor coefficient
416corresponding to z and the ell-th direction.
417
418\par Checked Assertions
419\li NumArg(op) == 1
420\li NumRes(op) == 2
421\li i_x + 1 < i_z
422\li 0 < q
423\li q < cap_order
424*/
425template <class Base>
426inline void forward_unary2_op_dir(
427        size_t q           ,
428        size_t r           ,
429        size_t i_z         ,
430        size_t i_x         ,
431        size_t cap_order   , 
432        Base*  taylor      )
433{
434        // This routine is only for documentaiton, it should not be used
435        CPPAD_ASSERT_UNKNOWN( false );
436}
437
438/*!
439Prototype for zero order forward mode unary operator with two results (not used).
440\tparam Base
441base type for the operator; i.e., this operation was recorded
442using AD< \a Base > and computations by this routine are done using type
443\a Base .
444
445\param i_z
446variable index corresponding to the last (primary) result for this operation;
447i.e. the row index in \a taylor corresponding to z.
448The auxillary result is called y and has index \a i_z - 1.
449
450\param i_x
451variable index corresponding to the argument for this operator;
452i.e. the row index in \a taylor corresponding to x.
453
454\param cap_order
455maximum number of orders that will fit in the \c taylor array.
456
457\param taylor
458\b Input: \a taylor [ \a i_x * \a cap_order + 0 ]
459is the zero order Taylor coefficient corresponding to x.
460\n
461\b Output: \a taylor [ \a i_z * \a cap_order + 0 ]
462is the zero order Taylor coefficient corresponding to z.
463\n
464\b Output: \a taylor [ ( \a i_z - 1 ) * \a cap_order + j ]
465is the j-th order Taylor coefficient corresponding to
466the autillary result y.
467
468\par Checked Assertions
469\li NumArg(op) == 1
470\li NumRes(op) == 2
471\li \a i_x + 1 < \a i_z
472\li \a j < \a cap_order
473*/
474template <class Base>
475inline void forward_unary2_op_0(
476        size_t i_z         ,
477        size_t i_x         ,
478        size_t cap_order   , 
479        Base*  taylor      )
480{
481        // This routine is only for documentaiton, it should not be used
482        CPPAD_ASSERT_UNKNOWN( false );
483}
484
485/*!
486Prototype for reverse mode unary operator with two results (not used).
487
488This routine is given the partial derivatives of a function
489G( z , y , x , w , ... )
490and it uses them to compute the partial derivatives of
491\verbatim
492        H( x , w , u , ... ) = G[ z(x) , y(x), x , w , u , ... ]
493\endverbatim
494
495\tparam Base
496base type for the operator; i.e., this operation was recorded
497using AD< \a Base > and computations by this routine are done using type
498\a Base .
499
500\param d
501highest order Taylor coefficient that
502we are computing the partial derivatives with respect to.
503
504\param i_z
505variable index corresponding to the last (primary) result for this operation;
506i.e. the row index in \a taylor to z.
507The auxillary result is called y and has index \a i_z - 1.
508
509\param i_x
510variable index corresponding to the argument for this operation;
511i.e. the row index in \a taylor corresponding to x.
512
513\param cap_order
514maximum number of orders that will fit in the \c taylor array.
515
516\param taylor
517\a taylor [ \a i_x * \a cap_order + k ]
518for k = 0 , ... , \a d
519is the k-th order Taylor coefficient corresponding to x.
520\n
521\a taylor [ \a i_z * \a cap_order + k ]
522for k = 0 , ... , \a d
523is the k-th order Taylor coefficient corresponding to z.
524\n
525\a taylor [ ( \a i_z - 1) * \a cap_order + k ]
526for k = 0 , ... , \a d
527is the k-th order Taylor coefficient corresponding to
528the auxillary variable y.
529
530\param nc_partial
531number of colums in the matrix containing all the partial derivatives.
532
533\param partial
534\b Input: \a partial [ \a i_x * \a nc_partial + k ]
535for k = 0 , ... , \a d
536is the partial derivative of
537G( z , y , x , w , u , ... )
538with respect to the k-th order Taylor coefficient for x.
539\n
540\b Input: \a partial [ \a i_z * \a nc_partial + k ]
541for k = 0 , ... , \a d
542is the partial derivative of G( z , y , x , w , u , ... ) with respect to
543the k-th order Taylor coefficient for z.
544\n
545\b Input: \a partial [ ( \a i_z - 1) * \a nc_partial + k ]
546for k = 0 , ... , \a d
547is the partial derivative of G( z , x , w , u , ... ) with respect to
548the k-th order Taylor coefficient for the auxillary variable y.
549\n
550\b Output: \a partial [ \a i_x * \a nc_partial + k ]
551for k = 0 , ... , \a d
552is the partial derivative of H( x , w , u , ... ) with respect to
553the k-th order Taylor coefficient for x.
554\n
555\b Output: \a partial [ \a ( i_z - j ) * \a nc_partial + k ]
556for j = 0 , 1 , and for k = 0 , ... , \a d
557may be used as work space; i.e., may change in an unspecified manner.
558
559
560\par Checked Assumptions
561\li NumArg(op) == 1
562\li NumRes(op) == 2
563\li \a i_x + 1 < \a i_z
564\li \a d < \a cap_order
565\li \a d < \a nc_partial
566*/
567template <class Base>
568inline void reverse_unary2_op(
569        size_t      d            ,
570        size_t      i_z          ,
571        size_t      i_x          ,
572        size_t      cap_order    , 
573        const Base* taylor       ,
574        size_t      nc_partial   ,
575        Base*       partial      )
576{
577        // This routine is only for documentaiton, it should not be used
578        CPPAD_ASSERT_UNKNOWN( false );
579}
580// =================== Binary operators with one result ====================
581
582/*!
583Prototype forward mode x op y (not used)
584
585\tparam Base
586base type for the operator; i.e., this operation was recorded
587using AD< \a Base > and computations by this routine are done using type
588\a Base.
589
590\param p
591lowest order of the Taylor coefficient that we are computing.
592
593\param q
594highest order of the Taylor coefficient that we are computing.
595
596\param i_z
597variable index corresponding to the result for this operation;
598i.e. the row index in \a taylor corresponding to z.
599
600\param arg
601\a arg[0]
602index corresponding to the left operand for this operator;
603i.e. the index corresponding to x.
604\n
605\a arg[1]
606index corresponding to the right operand for this operator;
607i.e. the index corresponding to y.
608
609\param parameter
610If x is a parameter, \a parameter [ \a arg[0] ]
611is the value corresponding to x.
612\n
613If y is a parameter, \a parameter [ \a arg[1] ]
614is the value corresponding to y.
615
616\param cap_order
617maximum number of orders that will fit in the \c taylor array.
618
619\param taylor
620\b Input: If x is a variable,
621<code>taylor [ arg[0] * cap_order + k ]</code>,
622for k = 0 , ... , q,
623is the k-th order Taylor coefficient corresponding to x.
624\n
625\b Input: If y is a variable,
626<code>taylor [ arg[1] * cap_order + k ]</code>,
627for k = 0 , ... , q,
628is the k-th order Taylor coefficient corresponding to y.
629\n
630\b Input: <code>taylor [ i_z * cap_order + k ]</code>,
631for k = 0 , ... , p-1,
632is the k-th order Taylor coefficient corresponding to z.
633\n
634\b Output: <code>taylor [ i_z * cap_order + k ]</code>,
635for k = p, ... , q,
636is the k-th order Taylor coefficient corresponding to z.
637
638\par Checked Assertions
639\li NumArg(op) == 2
640\li NumRes(op) == 1
641\li q <  cap_order
642\li p <=  q
643*/
644template <class Base>
645inline void forward_binary_op(
646        size_t        p          ,
647        size_t        q          ,
648        size_t        i_z        ,
649        const addr_t* arg        ,
650        const Base*   parameter  ,
651        size_t        cap_order  , 
652        Base*         taylor     )
653{
654        // This routine is only for documentaiton, it should not be used
655        CPPAD_ASSERT_UNKNOWN( false );
656}
657
658/*!
659Prototype multiple direction forward mode x op y (not used)
660
661\tparam Base
662base type for the operator; i.e., this operation was recorded
663using AD< \a Base > and computations by this routine are done using type
664\a Base.
665
666\param q
667is the order of the Taylor coefficients that we are computing.
668
669\param r
670number of directions for Taylor coefficients that we are computing
671
672\param i_z
673variable index corresponding to the result for this operation;
674i.e. the row index in \a taylor corresponding to z.
675
676\param arg
677\a arg[0]
678index corresponding to the left operand for this operator;
679i.e. the index corresponding to x.
680\n
681\a arg[1]
682index corresponding to the right operand for this operator;
683i.e. the index corresponding to y.
684
685\param parameter
686If x is a parameter, \a parameter [ \a arg[0] ]
687is the value corresponding to x.
688\n
689If y is a parameter, \a parameter [ \a arg[1] ]
690is the value corresponding to y.
691
692\param cap_order
693maximum number of orders that will fit in the \c taylor array.
694
695\par tpv
696We use the notation
697<code>tpv = (cap_order-1) * r + 1</code>
698which is the number of Taylor coefficients per variable
699
700\param taylor
701\b Input: If x is a variable,
702<code>taylor [ arg[0] * tpv + 0 ]</code>,
703is the zero order Taylor coefficient for all directions and
704<code>taylor [ arg[0] * tpv + (k-1)*r + ell + 1 ]</code>,
705for k = 1 , ... , q,
706ell = 0, ..., r-1,
707is the k-th order Taylor coefficient
708corresponding to x and the ell-th direction.
709\n
710\b Input: If y is a variable,
711<code>taylor [ arg[1] * tpv + 0 ]</code>,
712is the zero order Taylor coefficient for all directions and
713<code>taylor [ arg[1] * tpv + (k-1)*r + ell + 1 ]</code>,
714for k = 1 , ... , q,
715ell = 0, ..., r-1,
716is the k-th order Taylor coefficient
717corresponding to y and the ell-th direction.
718\n
719\b Input: <code>taylor [ i_z * tpv + 0 ]</code>,
720is the zero order Taylor coefficient for all directions and
721<code>taylor [ i_z * tpv + (k-1)*r + ell + 1 ]</code>,
722for k = 1 , ... , q-1,
723ell = 0, ..., r-1,
724is the k-th order Taylor coefficient
725corresponding to z and the ell-th direction.
726\n
727\b Output:
728<code>taylor [ i_z * tpv + (q-1)*r + ell + 1]</code>,
729ell = 0, ..., r-1,
730is the q-th order Taylor coefficient
731corresponding to z and the ell-th direction.
732
733\par Checked Assertions
734\li NumArg(op) == 2
735\li NumRes(op) == 1
736\li 0 < q <  cap_order
737*/
738template <class Base>
739inline void forward_binary_op_dir(
740        size_t        q          ,
741        size_t        r          ,
742        size_t        i_z        ,
743        const addr_t* arg        ,
744        const Base*   parameter  ,
745        size_t        cap_order  , 
746        Base*         taylor     )
747{
748        // This routine is only for documentaiton, it should not be used
749        CPPAD_ASSERT_UNKNOWN( false );
750}
751
752
753/*!
754Prototype zero order forward mode x op y (not used)
755
756\tparam Base
757base type for the operator; i.e., this operation was recorded
758using AD< \a Base > and computations by this routine are done using type
759\a Base.
760
761\param i_z
762variable index corresponding to the result for this operation;
763i.e. the row index in \a taylor corresponding to z.
764
765\param arg
766\a arg[0]
767index corresponding to the left operand for this operator;
768i.e. the index corresponding to x.
769\n
770\a arg[1]
771index corresponding to the right operand for this operator;
772i.e. the index corresponding to y.
773
774\param parameter
775If x is a parameter, \a parameter [ \a arg[0] ]
776is the value corresponding to x.
777\n
778If y is a parameter, \a parameter [ \a arg[1] ]
779is the value corresponding to y.
780
781\param cap_order
782maximum number of orders that will fit in the \c taylor array.
783
784\param taylor
785\b Input: If x is a variable, \a taylor [ \a arg[0] * \a cap_order + 0 ]
786is the zero order Taylor coefficient corresponding to x.
787\n
788\b Input: If y is a variable, \a taylor [ \a arg[1] * \a cap_order + 0 ]
789is the zero order Taylor coefficient corresponding to y.
790\n
791\b Output: \a taylor [ \a i_z * \a cap_order + 0 ]
792is the zero order Taylor coefficient corresponding to z.
793
794\par Checked Assertions
795\li NumArg(op) == 2
796\li NumRes(op) == 1
797*/
798template <class Base>
799inline void forward_binary_op_0(
800        size_t        i_z         ,
801        const addr_t* arg         ,
802        const Base*   parameter   ,
803        size_t        cap_order   , 
804        Base*         taylor      )
805{
806        // This routine is only for documentaiton, it should not be used
807        CPPAD_ASSERT_UNKNOWN( false );
808}
809
810/*!
811Prototype for reverse mode binary operator x op y (not used).
812
813This routine is given the partial derivatives of a function
814G( z , y , x , w , ... )
815and it uses them to compute the partial derivatives of
816\verbatim
817        H( y , x , w , u , ... ) = G[ z(x , y) , y , x , w , u , ... ]
818\endverbatim
819
820\tparam Base
821base type for the operator; i.e., this operation was recorded
822using AD< \a Base > and computations by this routine are done using type
823\a Base .
824
825\param d
826highest order Taylor coefficient that
827we are computing the partial derivatives with respect to.
828
829\param i_z
830variable index corresponding to the result for this operation;
831i.e. the row index in \a taylor corresponding to z.
832
833\param arg
834\a arg[0]
835index corresponding to the left operand for this operator;
836i.e. the index corresponding to x.
837\n
838\a arg[1]
839index corresponding to the right operand for this operator;
840i.e. the index corresponding to y.
841
842\param parameter
843If x is a parameter, \a parameter [ \a arg[0] ]
844is the value corresponding to x.
845\n
846If y is a parameter, \a parameter [ \a arg[1] ]
847is the value corresponding to y.
848
849\param cap_order
850maximum number of orders that will fit in the \c taylor array.
851
852\param taylor
853\a taylor [ \a i_z * \a cap_order + k ]
854for k = 0 , ... , \a d
855is the k-th order Taylor coefficient corresponding to z.
856\n
857If x is a variable, \a taylor [ \a arg[0] * \a cap_order + k ]
858for k = 0 , ... , \a d
859is the k-th order Taylor coefficient corresponding to x.
860\n
861If y is a variable, \a taylor [ \a arg[1] * \a cap_order + k ]
862for k = 0 , ... , \a d
863is the k-th order Taylor coefficient corresponding to y.
864
865\param nc_partial
866number of colums in the matrix containing all the partial derivatives.
867
868\param partial
869\b Input: \a partial [ \a i_z * \a nc_partial + k ]
870for k = 0 , ... , \a d
871is the partial derivative of
872G( z , y , x , w , u , ... )
873with respect to the k-th order Taylor coefficient for z.
874\n
875\b Input: If x is a variable, \a partial [ \a arg[0] * \a nc_partial + k ]
876for k = 0 , ... , \a d
877is the partial derivative of G( z , y , x , w , u , ... ) with respect to
878the k-th order Taylor coefficient for x.
879\n
880\b Input: If y is a variable, \a partial [ \a arg[1] * \a nc_partial + k ]
881for k = 0 , ... , \a d
882is the partial derivative of G( z , x , w , u , ... ) with respect to
883the k-th order Taylor coefficient for the auxillary variable y.
884\n
885\b Output: If x is a variable, \a partial [ \a arg[0] * \a nc_partial + k ]
886for k = 0 , ... , \a d
887is the partial derivative of H( y , x , w , u , ... ) with respect to
888the k-th order Taylor coefficient for x.
889\n
890\b Output: If y is a variable, \a partial [ \a arg[1] * \a nc_partial + k ]
891for k = 0 , ... , \a d
892is the partial derivative of H( y , x , w , u , ... ) with respect to
893the k-th order Taylor coefficient for y.
894\n
895\b Output: \a partial [ \a i_z * \a nc_partial + k ]
896for k = 0 , ... , \a d
897may be used as work space; i.e., may change in an unspecified manner.
898
899\par Checked Assumptions
900\li NumArg(op) == 2
901\li NumRes(op) == 1
902\li \a If x is a variable, arg[0] < \a i_z
903\li \a If y is a variable, arg[1] < \a i_z
904\li \a d < \a cap_order
905\li \a d < \a nc_partial
906*/
907template <class Base>
908inline void reverse_binary_op(
909        size_t      d            ,
910        size_t      i_z          ,
911        addr_t*     arg          ,
912        const Base* parameter    ,
913        size_t      cap_order    , 
914        const Base* taylor       ,
915        size_t      nc_partial   ,
916        Base*       partial      )
917{
918        // This routine is only for documentaiton, it should not be used
919        CPPAD_ASSERT_UNKNOWN( false );
920}
921// ======================= Pow Function ===================================
922/*!
923Prototype for forward mode z = pow(x, y) (not used).
924
925\tparam Base
926base type for the operator; i.e., this operation was recorded
927using AD< \a Base > and computations by this routine are done using type
928\a Base.
929
930\param p
931lowest order of the Taylor coefficient that we are computing.
932
933\param q
934highest order of the Taylor coefficient that we are computing.
935
936\param i_z
937variable index corresponding to the last (primary) result for this operation;
938i.e. the row index in \a taylor corresponding to z.
939Note that there are three results for this operation,
940below they are referred to as z_0, z_1, z_2 and correspond to
941\verbatim
942        z_0 = log(x)
943        z_1 = z0 * y
944        z_2 = exp(z1)
945\endverbatim
946It follows that the final result is equal to z; i.e., z = z_2 = pow(x, y).
947
948\param arg
949\a arg[0]
950index corresponding to the left operand for this operator;
951i.e. the index corresponding to x.
952\n
953\a arg[1]
954index corresponding to the right operand for this operator;
955i.e. the index corresponding to y.
956
957\param parameter
958If x is a parameter, \a parameter [ \a arg[0] ]
959is the value corresponding to x.
960\n
961If y is a parameter, \a parameter [ \a arg[1] ]
962is the value corresponding to y.
963
964\param cap_order
965maximum number of orders that will fit in the \c taylor array.
966
967\param taylor
968\b Input: If x is a variable,
969<code>taylor [ arg[0] * cap_order + k ]</code> 
970for k = 0 , ... , q,
971is the k-th order Taylor coefficient corresponding to x.
972\n
973\b Input: If y is a variable,
974<code>taylor [ arg[1] * cap_order + k ]</code> 
975for k = 0 , ... , q
976is the k-th order Taylor coefficient corresponding to y.
977\n
978\b Input: <code>taylor [ (i_z-2+j) * cap_order + k ]</code>,
979for j = 0, 1, 2 , for k = 0 , ... , p-1,
980is the k-th order Taylor coefficient corresponding to z_j.
981\n
982\b Output: <code>taylor [ (i_z-2+j) * cap_order + k ]</code>,
983is the k-th order Taylor coefficient corresponding to z_j.
984
985\par Checked Assertions
986\li NumArg(op) == 2
987\li NumRes(op) == 3
988\li If x is a variable, arg[0] < i_z - 2
989\li If y is a variable, arg[1] < i_z - 2
990\li q < cap_order
991\li p <= q
992*/
993template <class Base>
994inline void forward_pow_op(
995        size_t        p          ,
996        size_t        q          ,
997        size_t        i_z        ,
998        const addr_t* arg        ,
999        const Base*   parameter  ,
1000        size_t        cap_order  , 
1001        Base*         taylor     )
1002{
1003        // This routine is only for documentaiton, it should not be used
1004        CPPAD_ASSERT_UNKNOWN( false );
1005}
1006/*!
1007Prototype for multiple direction forward mode z = pow(x, y) (not used).
1008
1009\tparam Base
1010base type for the operator; i.e., this operation was recorded
1011using AD< \a Base > and computations by this routine are done using type
1012\a Base.
1013
1014\param q
1015order of the Taylor coefficient that we are computing.
1016
1017\param r
1018is the number of Taylor coefficient directions that we are computing
1019
1020\param i_z
1021variable index corresponding to the last (primary) result for this operation;
1022i.e. the row index in \a taylor corresponding to z.
1023Note that there are three results for this operation,
1024below they are referred to as z_0, z_1, z_2 and correspond to
1025\verbatim
1026        z_0 = log(x)
1027        z_1 = z0 * y
1028        z_2 = exp(z1)
1029\endverbatim
1030It follows that the final result is equal to z; i.e., z = z_2 = pow(x, y).
1031
1032\param arg
1033\a arg[0]
1034index corresponding to the left operand for this operator;
1035i.e. the index corresponding to x.
1036\n
1037\a arg[1]
1038index corresponding to the right operand for this operator;
1039i.e. the index corresponding to y.
1040
1041\param parameter
1042If x is a parameter, \a parameter [ \a arg[0] ]
1043is the value corresponding to x.
1044\n
1045If y is a parameter, \a parameter [ \a arg[1] ]
1046is the value corresponding to y.
1047
1048\param cap_order
1049maximum number of orders that will fit in the \c taylor array.
1050
1051\par tpv
1052We use the notation
1053<code>tpv = (cap_order-1) * r + 1</code>
1054which is the number of Taylor coefficients per variable
1055
1056\param taylor
1057\b Input: If x is a variable,
1058<code>taylor [ arg[0] * tpv + 0 ]</code> 
1059is the zero order coefficient corresponding to x and
1060<code>taylor [ arg[0] * tpv + (k-1)*r+1+ell ]</code> 
1061for k = 1 , ... , q,
1062ell = 0 , ... , r-1,
1063is the k-th order Taylor coefficient corresponding to x
1064for the ell-th direction.
1065\n
1066\n
1067\b Input: If y is a variable,
1068<code>taylor [ arg[1] * tpv + 0 ]</code> 
1069is the zero order coefficient corresponding to y and
1070<code>taylor [ arg[1] * tpv + (k-1)*r+1+ell ]</code> 
1071for k = 1 , ... , q,
1072ell = 0 , ... , r-1,
1073is the k-th order Taylor coefficient corresponding to y
1074for the ell-th direction.
1075\n
1076\n
1077\b Input:
1078<code>taylor [ (i_z-2+j) * tpv + 0 ]</code>,
1079is the zero order coefficient corresponding to z_j and
1080<code>taylor [ (i_z-2+j) * tpv + (k-1)*r+1+ell ]</code>,
1081for j = 0, 1, 2 , k = 0 , ... , q-1, ell = 0, ... , r-1,
1082is the k-th order Taylor coefficient corresponding to z_j
1083for the ell-th direction.
1084\n
1085\n
1086\b Output:
1087<code>taylor [ (i_z-2+j) * tpv + (q-1)*r+1+ell ]</code>,
1088for j = 0, 1, 2 , ell = 0, ... , r-1,
1089is the q-th order Taylor coefficient corresponding to z_j
1090for the ell-th direction.
1091
1092\par Checked Assertions
1093\li NumArg(op) == 2
1094\li NumRes(op) == 3
1095\li If x is a variable, arg[0] < i_z - 2
1096\li If y is a variable, arg[1] < i_z - 2
1097\li 0 < q
1098\li q < cap_order
1099*/
1100template <class Base>
1101inline void forward_pow_op_dir(
1102        size_t        q          ,
1103        size_t        r          ,
1104        size_t        i_z        ,
1105        const addr_t* arg        ,
1106        const Base*   parameter  ,
1107        size_t        cap_order  , 
1108        Base*         taylor     )
1109{
1110        // This routine is only for documentaiton, it should not be used
1111        CPPAD_ASSERT_UNKNOWN( false );
1112}
1113/*!
1114Prototype for zero order forward mode z = pow(x, y) (not used).
1115
1116\tparam Base
1117base type for the operator; i.e., this operation was recorded
1118using AD< \a Base > and computations by this routine are done using type
1119\a Base.
1120
1121\param i_z
1122variable index corresponding to the last (primary) result for this operation;
1123i.e. the row index in \a taylor corresponding to z.
1124Note that there are three results for this operation,
1125below they are referred to as z_0, z_1, z_2 and correspond to
1126\verbatim
1127        z_0 = log(x)
1128        z_1 = z0 * y
1129        z_2 = exp(z1)
1130\endverbatim
1131It follows that the final result is equal to z; i.e., z = z_2 = pow(x, y).
1132
1133\param arg
1134\a arg[0]
1135index corresponding to the left operand for this operator;
1136i.e. the index corresponding to x.
1137\n
1138\a arg[1]
1139index corresponding to the right operand for this operator;
1140i.e. the index corresponding to y.
1141
1142\param parameter
1143If x is a parameter, \a parameter [ \a arg[0] ]
1144is the value corresponding to x.
1145\n
1146If y is a parameter, \a parameter [ \a arg[1] ]
1147is the value corresponding to y.
1148
1149\param cap_order
1150maximum number of orders that will fit in the \c taylor array.
1151
1152\param taylor
1153\b Input: If x is a variable, \a taylor [ \a arg[0] * \a cap_order + 0 ]
1154is the zero order Taylor coefficient corresponding to x.
1155\n
1156\b Input: If y is a variable, \a taylor [ \a arg[1] * \a cap_order + 0 ]
1157is the k-th order Taylor coefficient corresponding to y.
1158\n
1159\b Output: \a taylor [ \a (i_z - 2 + j) * \a cap_order + 0 ]
1160is the zero order Taylor coefficient corresponding to z_j.
1161
1162\par Checked Assertions
1163\li NumArg(op) == 2
1164\li NumRes(op) == 3
1165\li If x is a variable, \a arg[0] < \a i_z - 2
1166\li If y is a variable, \a arg[1] < \a i_z - 2
1167*/
1168template <class Base>
1169inline void forward_pow_op_0(
1170        size_t        i_z        ,
1171        const addr_t* arg        ,
1172        const Base*   parameter  ,
1173        size_t        cap_order  , 
1174        Base*         taylor     )
1175{
1176        // This routine is only for documentaiton, it should not be used
1177        CPPAD_ASSERT_UNKNOWN( false );
1178}
1179/*!
1180Prototype for reverse mode z = pow(x, y) (not used).
1181
1182This routine is given the partial derivatives of a function
1183G( z , y , x , w , ... )
1184and it uses them to compute the partial derivatives of
1185\verbatim
1186        H( y , x , w , u , ... ) = G[ pow(x , y) , y , x , w , u , ... ]
1187\endverbatim
1188
1189\tparam Base
1190base type for the operator; i.e., this operation was recorded
1191using AD< \a Base > and computations by this routine are done using type
1192\a Base .
1193
1194\param d
1195highest order Taylor coefficient that
1196we are computing the partial derivatives with respect to.
1197
1198\param i_z
1199variable index corresponding to the last (primary) result for this operation;
1200i.e. the row index in \a taylor corresponding to z.
1201Note that there are three results for this operation,
1202below they are referred to as z_0, z_1, z_2 and correspond to
1203\verbatim
1204        z_0 = log(x)
1205        z_1 = z0 * y
1206        z_2 = exp(z1)
1207\endverbatim
1208It follows that the final result is equal to z; i.e., z = z_2 = pow(x, y).
1209
1210\param arg
1211\a arg[0]
1212index corresponding to the left operand for this operator;
1213i.e. the index corresponding to x.
1214\n
1215\a arg[1]
1216index corresponding to the right operand for this operator;
1217i.e. the index corresponding to y.
1218
1219\param parameter
1220If x is a parameter, \a parameter [ \a arg[0] ]
1221is the value corresponding to x.
1222\n
1223If y is a parameter, \a parameter [ \a arg[1] ]
1224is the value corresponding to y.
1225
1226\param cap_order
1227maximum number of orders that will fit in the \c taylor array.
1228
1229\param taylor
1230\a taylor [ \a (i_z - 2 + j) * \a cap_order + k ]
1231for j = 0, 1, 2 and k = 0 , ... , \a d
1232is the k-th order Taylor coefficient corresponding to z_j.
1233\n
1234If x is a variable, \a taylor [ \a arg[0] * \a cap_order + k ]
1235for k = 0 , ... , \a d
1236is the k-th order Taylor coefficient corresponding to x.
1237\n
1238If y is a variable, \a taylor [ \a arg[1] * \a cap_order + k ]
1239for k = 0 , ... , \a d
1240is the k-th order Taylor coefficient corresponding to y.
1241
1242\param nc_partial
1243number of colums in the matrix containing all the partial derivatives.
1244
1245\param partial
1246\b Input: \a partial [ \a (i_z - 2 + j) * \a nc_partial + k ]
1247for j = 0, 1, 2, and k = 0 , ... , \a d
1248is the partial derivative of
1249G( z , y , x , w , u , ... )
1250with respect to the k-th order Taylor coefficient for z_j.
1251\n
1252\b Input: If x is a variable, \a partial [ \a arg[0] * \a nc_partial + k ]
1253for k = 0 , ... , \a d
1254is the partial derivative of G( z , y , x , w , u , ... ) with respect to
1255the k-th order Taylor coefficient for x.
1256\n
1257\b Input: If y is a variable, \a partial [ \a arg[1] * \a nc_partial + k ]
1258for k = 0 , ... , \a d
1259is the partial derivative of G( z , x , w , u , ... ) with respect to
1260the k-th order Taylor coefficient for the auxillary variable y.
1261\n
1262\b Output: If x is a variable, \a partial [ \a arg[0] * \a nc_partial + k ]
1263for k = 0 , ... , \a d
1264is the partial derivative of H( y , x , w , u , ... ) with respect to
1265the k-th order Taylor coefficient for x.
1266\n
1267\b Output: If y is a variable, \a partial [ \a arg[1] * \a nc_partial + k ]
1268for k = 0 , ... , \a d
1269is the partial derivative of H( y , x , w , u , ... ) with respect to
1270the k-th order Taylor coefficient for y.
1271\n
1272\b Output: \a partial [ \a ( i_z - j ) * \a nc_partial + k ]
1273for j = 0 , 1 , 2 and for k = 0 , ... , \a d
1274may be used as work space; i.e., may change in an unspecified manner.
1275
1276\par Checked Assumptions
1277\li NumArg(op) == 2
1278\li NumRes(op) == 3
1279\li \a If x is a variable, arg[0] < \a i_z - 2
1280\li \a If y is a variable, arg[1] < \a i_z - 2
1281\li \a d < \a cap_order
1282\li \a d < \a nc_partial
1283*/
1284template <class Base>
1285inline void reverse_pow_op(
1286        size_t      d            ,
1287        size_t      i_z          ,
1288        addr_t*     arg          ,
1289        const Base* parameter    ,
1290        size_t      cap_order    , 
1291        const Base* taylor       ,
1292        size_t      nc_partial   ,
1293        Base*       partial      )
1294{
1295        // This routine is only for documentaiton, it should not be used
1296        CPPAD_ASSERT_UNKNOWN( false );
1297}
1298
1299// ==================== Sparsity Calculations ==============================
1300/*!
1301Prototype for reverse mode Hessian sparsity unary operators.
1302
1303This routine is given the forward mode Jacobian sparsity patterns for x.
1304It is also given the reverse mode dependence of G on z.
1305In addition, it is given the revese mode Hessian sparsity
1306for the quanity of interest G(z , y , ... )
1307and it uses them to compute the sparsity patterns for
1308\verbatim
1309        H( x , w , u , ... ) = G[ z(x) , x , w , u , ... ]
1310\endverbatim
1311
1312\tparam Vector_set
1313is the type used for vectors of sets. It can be either
1314\c sparse_pack, \c sparse_set, or \c sparse_list.
1315
1316\param i_z
1317variable index corresponding to the result for this operation;
1318i.e. the row index in sparsity corresponding to z.
1319
1320\param i_x
1321variable index corresponding to the argument for this operator;
1322i.e. the row index in sparsity corresponding to x.
1323
1324\param rev_jacobian
1325\a rev_jacobian[i_z]
1326is all false (true) if the Jacobian of G with respect to z must be zero
1327(may be non-zero).
1328\n
1329\n
1330\a rev_jacobian[i_x]
1331is all false (true) if the Jacobian with respect to x must be zero
1332(may be non-zero).
1333On input, it corresponds to the function G,
1334and on output it corresponds to the function H.
1335
1336\param for_jac_sparsity
1337The set with index \a i_x in for_jac_sparsity
1338is the forward mode Jacobian sparsity pattern for the variable x.
1339
1340\param rev_hes_sparsity
1341The set with index \a i_z in in \a rev_hes_sparsity
1342is the Hessian sparsity pattern for the fucntion G
1343where one of the partials derivative is with respect to z.
1344\n
1345\n
1346The set with index \a i_x in \a rev_hes_sparsity
1347is the Hessian sparsity pattern
1348where one of the partials derivative is with respect to x.
1349On input, it corresponds to the function G,
1350and on output it corresponds to the function H.
1351
1352\par Checked Assertions:
1353\li \a i_x < \a i_z
1354*/
1355
1356template <class Vector_set>
1357inline void reverse_sparse_hessian_unary_op(
1358        size_t              i_z               ,
1359        size_t              i_x               ,
1360        bool*               rev_jacobian      ,
1361        Vector_set&         for_jac_sparsity  ,
1362        Vector_set&         rev_hes_sparsity  )
1363{       
1364        // This routine is only for documentaiton, it should not be used
1365        CPPAD_ASSERT_UNKNOWN( false );
1366}
1367
1368/*!
1369Prototype for reverse mode Hessian sparsity binary operators.
1370
1371This routine is given the sparsity patterns the Hessian
1372of a function G(z, y, x, ... )
1373and it uses them to compute the sparsity patterns for the Hessian of 
1374\verbatim
1375        H( y, x, w , u , ... ) = G[ z(x,y) , y , x , w , u , ... ]
1376\endverbatim
1377
1378\tparam Vector_set
1379is the type used for vectors of sets. It can be either
1380\c sparse_pack, \c sparse_set, or \c sparse_list.
1381
1382\param i_z
1383variable index corresponding to the result for this operation;
1384i.e. the row index in sparsity corresponding to z.
1385
1386\param arg
1387\a arg[0]
1388variable index corresponding to the left operand for this operator;
1389i.e. the set with index \a arg[0] in \a var_sparsity
1390is the spasity pattern correspoding to x.
1391\n
1392\n arg[1]
1393variable index corresponding to the right operand for this operator;
1394i.e. the row index in sparsity patterns corresponding to y.
1395
1396\param jac_reverse
1397\a jac_reverse[i_z]
1398is false (true) if the Jacobian of G with respect to z is always zero
1399(may be non-zero).
1400\n
1401\n
1402\a jac_reverse[ \a arg[0] ]
1403is false (true) if the Jacobian with respect to x is always zero
1404(may be non-zero).
1405On input, it corresponds to the function G,
1406and on output it corresponds to the function H.
1407\n
1408\n
1409\a jac_reverse[ \a arg[1] ]
1410is false (true) if the Jacobian with respect to y is always zero
1411(may be non-zero).
1412On input, it corresponds to the function G,
1413and on output it corresponds to the function H.
1414
1415\param for_jac_sparsity
1416The set with index \a arg[0] in \a for_jac_sparsity for the
1417is the forward Jacobian sparsity pattern for x.
1418\n
1419\n
1420The set with index \a arg[1] in \a for_jac_sparsity
1421is the forward sparsity pattern for y.
1422
1423\param rev_hes_sparsity
1424The set wiht index \a i_x in \a rev_hes_sparsity
1425is the Hessian sparsity pattern for the function G
1426where one of the partial derivatives is with respect to z.
1427\n
1428\n
1429The set with index \a arg[0] in  \a rev_hes_sparsity
1430is the Hessian sparsity pattern where one of the
1431partial derivatives is with respect to x.
1432On input, it corresponds to the function G,
1433and on output it correspondst to H.
1434\n
1435\n
1436The set with index \a arg[1] in \a rev_hes_sparsity
1437is the Hessian sparsity pattern where one of the
1438partial derivatives is with respect to y.
1439On input, it corresponds to the function G,
1440and on output it correspondst to H.
1441
1442\par Checked Assertions:
1443\li \a arg[0] < \a i_z
1444\li \a arg[1] < \a i_z
1445*/
1446template <class Vector_set>
1447inline void reverse_sparse_hessian_binary_op(
1448        size_t            i_z                ,
1449        const addr_t*     arg                ,
1450        bool*             jac_reverse        ,
1451        Vector_set&       for_jac_sparsity   ,
1452        Vector_set&       rev_hes_sparsity   )
1453{       
1454        // This routine is only for documentaiton, it should not be used
1455        CPPAD_ASSERT_UNKNOWN( false );
1456}
1457
1458
1459} // END_CPPAD_NAMESPACE
1460# endif
Note: See TracBrowser for help on using the repository browser.