Revision 760 branches/threaded2/src/linad99/sgradclc.cpp

sgradclc.cpp (revision 760)
94 94
      ad_exit(1);
95 95
    }
96 96
  }
97
  dvector& g= (dvector&) _g;
97
  dvector& g = (dvector&)_g;
98 98
  gradient_structure::TOTAL_BYTES = 0;
99
  gradient_structure::PREVIOUS_TOTAL_BYTES=0;
99
  gradient_structure::PREVIOUS_TOTAL_BYTES = 0;
100 100
  unsigned int i;
101 101
  long int lpos;
102
  if(!gradient_structure::instances)
102
  if (!gradient_structure::instances)
103 103
  {
104 104
    g.initialize();
105 105
    return;
106 106
  }
107
  
108 107
  if (g.size() < nvar)
109 108
  {
110 109
    cerr  << "gradient vector size is less than the number of variables" << endl;
111 110
    ad_exit(1);
112 111
  }
113 112

  
114
   gradient_structure::GRAD_STACK1->_GRADFILE_PTR =
115
              gradient_structure::GRAD_STACK1->gradfile_handle();
113
  gradient_structure::GRAD_STACK1->_GRADFILE_PTR = gradient_structure::GRAD_STACK1->gradfile_handle();
116 114

  
117 115
  int& _GRADFILE_PTR=gradient_structure::GRAD_STACK1->_GRADFILE_PTR;
118 116

  
119 117
  lpos = lseek(_GRADFILE_PTR,0L,SEEK_CUR);
120 118

  
121
  if(gradient_structure::GRAD_STACK1->ptr
122
       <= gradient_structure::GRAD_STACK1->ptr_first)
119
  if (gradient_structure::GRAD_STACK1->ptr <= gradient_structure::GRAD_STACK1->ptr_first)
123 120
  {
124
   /*
125
    #ifdef SAFE_ARRAYS
126
      cerr << "warning -- calling gradcalc when no calculations generating"
127
	 << endl << "derivative information have occurred" << endl;
128
    #endif
129
   */
121
    cerr << "warning -- calling gradcalc when no calculations generating\nderivative information have occurred\n";
130 122
    g.initialize();
131 123
    return;
132 124
  }    // current is one past the end so -- it

Also available in: Unified diff