ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_m57.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.cpp
00012 // constructors, destructors and misc functions involving class prevariable
00013 
00014 #include "fvar.hpp"
00015 
00020 dvar_matrix operator + (const dvariable& x,const dmatrix& m)
00021 {
00022   int mmin=m.indexmin();
00023   int mmax=m.indexmax();
00024   dvar_matrix tmp(mmin,mmax);
00025   for (int i=mmin;i<=mmax;i++)
00026   {
00027     tmp(i)=x+m(i);
00028   }
00029   return tmp;
00030 }
00031 
00036 dvar_matrix operator - (const dvariable& x,const dmatrix& m)
00037 {
00038   int mmin=m.indexmin();
00039   int mmax=m.indexmax();
00040   dvar_matrix tmp(mmin,mmax);
00041   for (int i=mmin;i<=mmax;i++)
00042   {
00043     tmp(i)=x-m(i);
00044   }
00045   return tmp;
00046 }