ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_m28.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 
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 #ifndef __SUN__
00028 #endif
00029 #include <math.h>
00030 
00035 dvar_matrix& dvar_matrix::operator/=(const double x)
00036 {
00037   RETURN_ARRAYS_INCREMENT();
00038   for (int i=rowmin();i<=rowmax();i++)
00039   {
00040     elem(i)/=x;
00041   }
00042   RETURN_ARRAYS_DECREMENT();
00043   return (*this);
00044 }
00045 
00050 dvar_matrix& dvar_matrix::operator/=(const prevariable& x)
00051 {
00052   RETURN_ARRAYS_INCREMENT();
00053   for (int i=rowmin();i<=rowmax();i++)
00054   {
00055     elem(i)/=x;
00056   }
00057   RETURN_ARRAYS_DECREMENT();
00058   return (*this);
00059 }
00060 
00065 dvar_matrix& dvar_matrix::operator=(const double x)
00066 {
00067   RETURN_ARRAYS_INCREMENT();
00068   for (int i=rowmin();i<=rowmax();i++)
00069   {
00070     elem(i)=x;
00071   }
00072   RETURN_ARRAYS_DECREMENT();
00073   return (*this);
00074 }
00075 
00080 dvar_matrix& dvar_matrix::operator=(const prevariable& x)
00081 {
00082   RETURN_ARRAYS_INCREMENT();
00083   for (int i=rowmin();i<=rowmax();i++)
00084   {
00085     elem(i)=x;
00086   }
00087   RETURN_ARRAYS_DECREMENT();
00088   return (*this);
00089 }
00090 
00095 dvar_matrix& dvar_matrix::operator*=(const double x)
00096 {
00097   RETURN_ARRAYS_INCREMENT();
00098   for (int i=rowmin();i<=rowmax();i++)
00099   {
00100     elem(i)*=x;
00101   }
00102   RETURN_ARRAYS_DECREMENT();
00103   return (*this);
00104 }
00105 
00110 dvar_matrix& dvar_matrix::operator*=(const prevariable& x)
00111 {
00112   RETURN_ARRAYS_INCREMENT();
00113   for (int i=rowmin();i<=rowmax();i++)
00114   {
00115     elem(i)*=x;
00116   }
00117   RETURN_ARRAYS_DECREMENT();
00118   return (*this);
00119 }