ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_op9.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 // file: fvar_ops.cpp
00012 // operators involving prevariables
00013 
00014 #include "fvar.hpp"
00015 
00016 #ifdef __TURBOC__
00017   #pragma hdrstop
00018   #include <iostream.h>
00019 #endif
00020 
00021 #ifdef __ZTC__
00022   #include <iostream.hpp>
00023 #endif
00024 
00025 #include <stdio.h>
00026 #include <math.h>
00027 
00028   void df_plus_eq_pvpv(void);
00029   //extern ofstream gradlog;
00030 
00035 void prevariable::operator+=(const prevariable& v1)
00036   {
00037     (*v).x+=(*v1.v).x;
00038     gradient_structure::GRAD_STACK1->set_gradient_stack1
00039       (df_plus_eq_pvpv,&(v->x),&(v1.v->x));
00040   }
00041 
00046   void df_plus_eq_pvpv(void)
00047   {
00048     //cout <<  setprecision(13) <<
00049      //  * gradient_structure::GRAD_STACK1->ptr->ind_addr1 << endl;
00050 
00051     //cout <<  setprecision(13) <<
00052      //  * gradient_structure::GRAD_STACK1->ptr->dep_addr << endl;
00053 
00054     //gradlog <<  setprecision(13) <<
00055      //  * gradient_structure::GRAD_STACK1->ptr->ind_addr1 << endl;
00056 
00057     * gradient_structure::GRAD_STACK1->ptr->ind_addr1
00058                += * gradient_structure::GRAD_STACK1->ptr->dep_addr;
00059     //gradlog <<  setprecision(13) <<
00060      //  * gradient_structure::GRAD_STACK1->ptr->ind_addr1 << endl;
00061   }