ADMB Documentation  11.1.2246
 All Classes Files Functions Variables Typedefs Friends Defines
gradchk.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: gradchk.cpp 1683 2014-02-26 00:16:59Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 
00017 void grad_chk(void)
00018 {
00019   if(gradient_structure::GRAD_STACK1->ptr
00020        <= gradient_structure::GRAD_STACK1->ptr_first)
00021   {
00022     cout << " 0 offset in gradstack " << endl;
00023   }    // current is one past the end so -- it
00024   else
00025   {
00026 #if defined(__x86_64)
00027     cout << intptr_t(gradient_structure::GRAD_STACK1->ptr)
00028             - intptr_t(gradient_structure::GRAD_STACK1->ptr_first)
00029 #else
00030     cout << int(gradient_structure::GRAD_STACK1->ptr)
00031        -int(gradient_structure::GRAD_STACK1->ptr_first)
00032 #endif
00033      << " offset in gradstack " << endl;
00034   }
00035 }