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 }
Generated on Tue Mar 8 2016 19:51:34 for ADMB Documentation by 1.8.0 |