ADMB Documentation  11.1.2251
 All Classes Files Functions Variables Typedefs Friends Defines
ivec9.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: ivec9.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   ivector& ivector::operator +=(const ivector& j)
00018   {
00019      int mmin=indexmin();
00020      int mmax=indexmax();
00021      if (mmin != j.indexmin() || mmax != j.indexmax())
00022      {
00023        cerr << " Incompatible array sizes in ivector::operator +=" << endl;
00024        exit(1);
00025      }
00026      for (int i=mmin; i<=mmax; i++)
00027      {
00028        (*this)(i)+=j(i);
00029      }
00030      return(*this);
00031   }
00032 
00037   ivector& ivector::operator +=(int j)
00038   {
00039      int mmin=indexmin();
00040      int mmax=indexmax();
00041      for (int i=mmin; i<=mmax; i++)
00042      {
00043        (*this)(i)+=j;
00044      }
00045      return(*this);
00046   }