[Developers] admb bug

dave fournier davef at otter-rsch.com
Sun Mar 9 20:37:03 PDT 2014


I noticed that the subvector operator for dvectors does not
check to see that the index bounds for the subvector are valid.
This should fix the problem. code is in dvector.cpp


dvector::dvector(_CONST predvector& pdv)
  {
    shape=pdv.p->shape;
    if (shape)
    {
      (shape->ncopies)++;
    }
    else
    {
      cerr << "Taking a subvector  of an unallocated dvector"<<endl;
    }
    v = pdv.p->v;
    int mmin=pdv.p->indexmin();
    int mmax=pdv.p->indexmax();
    if (pdv.lb<mmin || pdv.ub> mmax)
    {
      cerr << "index out of bounds in dvector subvector operator" << endl;
      ad_exit(1);
    }
    index_min=pdv.lb;
    index_max=pdv.ub;
  }



More information about the Developers mailing list