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