source: trunk/cppad/local/prototype_op.hpp @ 3301

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

merge in multiple forward direcitons from branches/forward_dir

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