ADMB Documentation  11.2.2828
 All Classes Files Functions Variables Typedefs Friends Defines
f3arr4.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: f3arr4.cpp 1942 2014-04-28 22:22:45Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 
00017 dvar3_array operator-(const double d, const dvar3_array& m2)
00018    {
00019      RETURN_ARRAYS_INCREMENT();
00020      dvar3_array tmp;
00021      tmp.allocate(m2);
00022      for (int i=tmp.slicemin();i<=tmp.slicemax();i++)
00023      {
00024        tmp(i)=d-m2(i);
00025      }
00026      RETURN_ARRAYS_DECREMENT();
00027      return tmp;
00028    }
00029 
00034 dvariable mean(const dvar3_array& m)
00035    {
00036      dvariable tmp;
00037      tmp=sum(m)/double(size_count(m));
00038      return tmp;
00039    }