ADMB Documentation  11.1.1903
 All Classes Files Functions Variables Typedefs Friends Defines
ivect11.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: ivect11.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 ivector::reallocate(double s)
00018   {
00019     int oldmin=indexmin();
00020     int oldmax=indexmax();
00021     if (::allocated(*this))
00022     {
00023       ivector tmp(indexmin(),indexmax());
00024       tmp=(*this);
00025       deallocate();
00026       allocate(indexmin(),int(s*indexmax()));
00027       (*this)(oldmin,oldmax)=tmp;
00028     }
00029     else
00030     {
00031       ivector tmp(1,s);
00032     }
00033   }