ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_m13.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 
23 {
24  int nrl = m.rowmin();
25  int nrh = m.rowmax();
26  ivector ncl(nrl, nrh);
27  ivector nch(nrl, nrh);
28  int* pncli = ncl.get_v() + nrl;
29  int* pnchi = nch.get_v() + nrl;
30  const dvar_vector* pmi = &m(nrl);
31  for (int i = nrl; i <= nrh; ++i)
32  {
33  *pncli = pmi->indexmin();
34  *pnchi = pmi->indexmax();
35 
36  ++pncli;
37  ++pnchi;
38  ++pmi;
39  }
40  dmatrix tmp(nrl, nrh, ncl, nch);
41  pmi = &m(nrl);
42 
43  dvector* ptmpi = &tmp(nrl);
44  for (int i = nrl; i <= nrh; ++i)
45  {
46  *ptmpi = value(*pmi);
47 
48  ++ptmpi;
49  ++pmi;
50  }
51  return tmp;
52 }
int rowmax(void) const
Definition: fvar.hpp:2564
Vector of double precision numbers.
Definition: dvector.h:50
ADMB variable vector.
Definition: fvar.hpp:2172
int * get_v() const
Definition: ivector.h:114
Array of integers(int) with indexes from index_min to indexmax.
Definition: ivector.h:50
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int rowmin(void) const
Definition: fvar.hpp:2560
Description not yet available.
Definition: fvar.hpp:2819
int indexmin() const
Definition: fvar.hpp:2287
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
int indexmax() const
Definition: fvar.hpp:2292