ADMB Documentation  11.6rc.3352
 All Classes Files Functions Variables Typedefs Friends Defines
dvect24.cpp
Go to the documentation of this file.
00001 
00005 #include "fvar.hpp"
00006 
00011 ivector sgn(const dvector& v)
00012 {
00013   int mmin = v.indexmin();
00014   int mmax = v.indexmax();
00015   ivector ret(mmin, mmax);
00016   for (int i = mmin; i <= mmax; ++i)
00017   {
00018     ret(i)= v(i) > 0 ? 1 : -1;
00019   }
00020   return ret;
00021 }