Revision 1627

trunk/src/linad99/fvar_op5.cpp (revision 1627)
4 4
 * Author: David Fournier
5 5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7

  
7 8
/**
8
 * \file
9
 * Description not yet available.
10
 */
11
// file: fvar_ops.cpp
12
// operators involving prevariables
9
\file
10
prevariable operations
11
*/
13 12

  
14 13
#include "fvar.hpp"
15 14

  
......
22 21
  #include <iostream.hpp>
23 22
#endif
24 23

  
25

  
26 24
#include <stdio.h>
27 25
#include <math.h>
28 26
#if !defined(OPT_LIB)
......
31 29
 * Description not yet available.
32 30
 * \param
33 31
 */
34
    void grad_stack::set_gradient_stack(void (* func)(void),
35
      double * dep_addr,double * ind_addr1, double mult1, double * ind_addr2,
36
      double mult2)
32
void grad_stack::set_gradient_stack(void (* func)(void), double * dep_addr,
33
  double * ind_addr1, double mult1, double * ind_addr2, double mult2)
34
{
35
#ifdef NO_DERIVS
36
  if (!gradient_structure::no_derivatives)
37
  {
38
#endif
39
#if defined(MYDEBUG)
40
    int wrote_buffer=0;
41
    if (ptr < ptr_first)
37 42
    {
38
      #ifdef NO_DERIVS
39
	if (!gradient_structure::no_derivatives)
40
	{
41
      #endif
42
#     if defined(MYDEBUG)
43
          int wrote_buffer=0;
44
	  if (ptr < ptr_first)
45
          {
46
            cerr << "Illegal ptr value" << endl;
47
            ad_exit(1);
48
          }
49
#     endif
50
	  if (ptr > ptr_last)
51
	  {
52
	     // current buffer is full -- write it to disk and reset pointer
53
	     // and counter
54
	     this->write_grad_stack_buffer();
55
#     if defined(MYDEBUG)
56
             wrote_buffer=1;
57
#     endif
58
	  }
59
#     if defined(MYDEBUG)
60
#     endif
61
	  ptr->func = func;
62
	  ptr->dep_addr = dep_addr;
63
	  ptr->ind_addr1 = ind_addr1;
64
	  ptr->mult1=mult1;
65
	  ptr->ind_addr2 = ind_addr2;
66
	  ptr->mult2=mult2;
67
	  ptr++;
68
      #ifdef NO_DERIVS
69
	}
70
      #endif
43
      cerr << "Illegal ptr value" << endl;
44
      ad_exit(1);
71 45
    }
72 46
#endif
73

  
47
    if (ptr > ptr_last)
48
    {
49
      // current buffer is full -- write it to disk and reset pointer
50
      // and counter
51
      this->write_grad_stack_buffer();
52
#if defined(MYDEBUG)
53
      wrote_buffer=1;
54
#endif
55
    }
56
    ptr->func = func;
57
    ptr->dep_addr = dep_addr;
58
    ptr->ind_addr1 = ind_addr1;
59
    ptr->mult1=mult1;
60
    ptr->ind_addr2 = ind_addr2;
61
    ptr->mult2=mult2;
62
    ptr++;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff