ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cmpdif7.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  */
11 #include <fvar.hpp>
12 
13 #ifdef __TURBOC__
14  #pragma hdrstop
15  #include <iostream.h>
16 #endif
17 
18 #ifdef __ZTC__
19  #include <iostream.hpp>
20 #endif
21 
22 #include <string.h>
23 
28 void nograd_assign_row(const dvar_matrix& m, const dvector& v, const int& ii)
29 {
30  // cout << "Entering nograd assign"<<endl;
31  //kkludge_object kg;
32  if (ii<m.rowmin()||ii>m.rowmax() ||
33  (v.indexmin()!=m(ii).indexmin()) ||
34  (v.indexmax()!=m(ii).indexmax()) )
35  {
36  cerr << "Error -- Index out of bounds in\n"
37  "void nograd_assign(const dvar_matrix& m, const dvector& v, const int& ii)"
38  << endl;
39  ad_exit(1);
40  }
41  int min=v.indexmin();
42  int max=v.indexmax();
43  for (int j=min;j<=max;j++)
44  {
45  value(m(ii,j))=v(j);
46  }
47  // out(i)=nograd_assign(m(i));
48  }
49 
55 {
56  kkludge_object kg;
57  dvariable tmpout(kg);
58  value(tmpout)=tmp;
59  return tmpout;
60 }
int rowmax(void) const
Definition: fvar.hpp:2564
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin() const
Get minimum valid index.
Definition: dvector.h:199
dvar_vector nograd_assign(dvector tmp)
Description not yet available.
Definition: cmpdif6.cpp:252
exitptr ad_exit
Definition: gradstrc.cpp:53
Null class to allow specialized function overloads.
Definition: fvar.hpp:469
void nograd_assign_row(const dvar_matrix &m, const dvector &v, const int &ii)
Description not yet available.
Definition: cmpdif7.cpp:28
prnstream & endl(prnstream &)
#define min(a, b)
Definition: cbivnorm.cpp:188
int indexmax() const
Get maximum valid index.
Definition: dvector.h:204
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int rowmin(void) const
Definition: fvar.hpp:2560
int indexmax(void) const
Definition: fvar.hpp:2572
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
#define max(a, b)
Definition: cbivnorm.cpp:189
int indexmin(void) const
Definition: fvar.hpp:2568
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518