ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_o10.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 
00026 #include <stdio.h>
00027 #include <math.h>
00028 
00029   void df_eq_pvdoub(void);
00030   void df_eq_pvpv(void);
00031 
00032 #if defined(__BORLANDC__)
00033 #  if (__BORLANDC__  >= 0x0540)
00034 
00038 prevariable& prevariable::operator=(const double t) const
00039     {
00040       (*v).x=t;
00041       gradient_structure::GRAD_STACK1->
00042         set_gradient_stack0(df_eq_pvdoub,&(v->x));
00043       return((prevariable&)(*this));
00044     }
00045 
00050 prevariable& prevariable::operator=(const prevariable& t) const
00051     {
00052       (*v).x=(*t.v).x;
00053       gradient_structure::GRAD_STACK1->
00054         set_gradient_stack1(default_evaluation1,&(v->x),&(t.v->x));
00055       return((prevariable&)(*this));
00056     }
00057 #  endif
00058 #endif
00059 
00065 prevariable& prevariable::operator=(const prevariable& t)
00066     {
00067       (*v).x=(*t.v).x;
00068       gradient_structure::GRAD_STACK1->
00069         set_gradient_stack1(default_evaluation1,&(v->x),&(t.v->x));
00070       return(*this);
00071     }
00072 
00078 dvariable& dvariable::operator=(const prevariable& t)
00079     {
00080       (*v).x=(*t.v).x;
00081       gradient_structure::GRAD_STACK1->
00082         set_gradient_stack1(default_evaluation1,&(v->x),&(t.v->x));
00083       return(*this);
00084     }
00085 
00091 dvariable& dvariable::operator=(const double t)
00092     {
00093       (*v).x=t;
00094       gradient_structure::GRAD_STACK1->
00095         set_gradient_stack0(df_eq_pvdoub,&(v->x));
00096       return(*this);
00097     }
00098 
00104 prevariable& prevariable::operator=(const double t)
00105     {
00106       (*v).x=t;
00107       gradient_structure::GRAD_STACK1->
00108         set_gradient_stack0(df_eq_pvdoub,&(v->x));
00109       return(*this);
00110     }
00111 
00115   void df_eq_pvdoub(void)
00116   {
00117     * gradient_structure::GRAD_STACK1->ptr->dep_addr=0.;
00118   }
00119