ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ivect11.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
7 #include "fvar.hpp"
8 
14 void ivector::reallocate(double s)
15 {
16  if (::allocated(*this))
17  {
18  int oldmin=indexmin();
19  int oldmax=indexmax();
20  ivector tmp(indexmin(),indexmax());
21  tmp=(*this);
22  deallocate();
23  allocate(tmp.indexmin(),int(s*tmp.indexmax()));
24 #ifndef OPT_LIB
25  initialize();
26 #endif
27  int max = oldmax < indexmax() ? oldmax : indexmax();
28  (*this)(oldmin, max) = tmp(oldmin, max);
29  }
30 }
int allocated() const
Definition: ivector.h:63
Array of integers(int) with indexes from index_min to indexmax.
Definition: ivector.h:50
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int indexmin() const
Definition: ivector.h:99
int indexmax() const
Definition: ivector.h:104
void allocate()
Does not allocate, but initializes class members.
Definition: ivector.cpp:316
void initialize(void)
Description not yet available.
Definition: ivec2.cpp:17
void reallocate(double size)
Reallocate size of array.
Definition: ivect11.cpp:14
void deallocate()
Deallocate i3_array memory.
Definition: ivector.cpp:91
#define max(a, b)
Definition: cbivnorm.cpp:189