ADMB Documentation  11.1x.2711
 All Classes Files Functions Variables Typedefs Friends Defines
d4arr2.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: d4arr2.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 
00017    void d4_array::operator /= (double d)
00018    {
00019      for (int i=indexmin();i<=indexmax();i++)
00020      {
00021        (*this)(i)/=d;
00022      }
00023    }
00024 
00029 d4_array operator/(const d4_array& m, double d)
00030    {
00031      d4_array tmp;
00032      tmp.allocate(m);
00033      for (int i=tmp.indexmin();i<=tmp.indexmax();i++)
00034      {
00035        tmp(i)=m(i)/d;
00036      }
00037      return tmp;
00038    }
00039 
00044 d4_array operator/(double d, const d4_array& m)
00045 {
00046   d4_array tmp;
00047   tmp.allocate(m);
00048   for (int i = tmp.indexmin(); i <= tmp.indexmax(); i++)
00049   {
00050     for (int j=tmp(i).indexmin(); j <= tmp(i).indexmax(); j++)
00051     {
00052       tmp(i, j) = d / m(i, j);
00053     }
00054   }
00055   return tmp;
00056 }