ADMB Documentation  11.1.2531
 All Classes Files Functions Variables Typedefs Friends Defines
fvar_m13.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: fvar_m13.cpp 1919 2014-04-22 22:02:01Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 
00013 #ifdef __TURBOC__
00014   #pragma hdrstop
00015   #include <iostream.h>
00016 #endif
00017 
00022 dmatrix value(const dvar_matrix& m)
00023   {
00024     int nrl=m.rowmin();
00025     int nrh=m.rowmax();
00026     ivector ncl(nrl,nrh);
00027     ivector nch(nrl,nrh);
00028     int i;
00029     for (i=nrl;i<=nrh;i++)
00030     {
00031       ncl(i)=m(i).indexmin();
00032       nch(i)=m(i).indexmax();
00033     }
00034     dmatrix tmp(nrl,nrh,ncl,nch);
00035     for (i=nrl;i<=nrh;i++)
00036     {
00037       tmp(i)=value(m(i));
00038     }
00039     return tmp;
00040   }