ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
cmpdif7.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
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 
00018 #ifdef __ZTC__
00019   #include <iostream.hpp>
00020 #endif
00021 
00022 #include <string.h>
00023 
00028 void nograd_assign_row(const dvar_matrix& m, const dvector& v, const int& ii)
00029 {
00030   // cout << "Entering nograd assign"<<endl;
00031   //kkludge_object kg;
00032   if (ii<m.rowmin()||ii>m.rowmax()  ||
00033    (v.indexmin()!=m(ii).indexmin()) ||
00034    (v.indexmax()!=m(ii).indexmax()) )
00035   {
00036     cerr << "Error -- Index out of bounds in\n"
00037     "void nograd_assign(const dvar_matrix& m, const dvector& v, const int& ii)"
00038     << endl;
00039     ad_exit(1);
00040   }
00041   int min=v.indexmin();
00042   int max=v.indexmax();
00043   for (int j=min;j<=max;j++)
00044   {
00045     value(m(ii,j))=v(j);
00046   }
00047     // out(i)=nograd_assign(m(i));
00048   }
00049 
00054 dvariable nograd_assign(double tmp)
00055 {
00056   kkludge_object kg;
00057   dvariable tmpout(kg);
00058   value(tmpout)=tmp;
00059   return tmpout;
00060 }