ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
gradchk.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <fvar.hpp>
00012 #if defined(__x86_64) || (defined(_MSC_VER) && defined(_M_X64))
00013   #include <stdint.h>
00014 #endif
00015 
00020 void grad_chk(void)
00021 {
00022   if(gradient_structure::GRAD_STACK1->ptr
00023        <= gradient_structure::GRAD_STACK1->ptr_first)
00024   {
00025     cout << " 0 offset in gradstack " << endl;
00026   }    // current is one past the end so -- it
00027   else
00028   {
00029 #if defined(__x86_64) || (defined(_MSC_VER) && defined(_M_X64))
00030     cout << intptr_t(gradient_structure::GRAD_STACK1->ptr)
00031             - intptr_t(gradient_structure::GRAD_STACK1->ptr_first)
00032 #else
00033     cout << int(gradient_structure::GRAD_STACK1->ptr)
00034        -int(gradient_structure::GRAD_STACK1->ptr_first)
00035 #endif
00036      << " offset in gradstack " << endl;
00037   }
00038 }