ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_a28.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
12 {
13  if ((m.rowmin() != m.colmin()) || (m.rowmax() != m.colmax()))
14  {
15  cerr << "Error in extract_diagonal function -- input matrix not square\n";
16  ad_exit(1);
17  }
20 
22 
23  for (int i = m.rowmin(); i <= m.rowmax(); ++i)
24  {
25  diagonal.elem(i) = m.elem(i,i);
26  }
27 
29 
30  return diagonal;
31 }
int rowmax(void) const
Definition: fvar.hpp:2564
dvar_vector & elem(int i)
Definition: fvar.hpp:2507
double & elem(int i)
Definition: dvector.h:152
dvector diagonal(const dmatrix &matrix)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: dmat31.cpp:12
int colmin(void) const
Definition: fvar.hpp:2552
exitptr ad_exit
Definition: gradstrc.cpp:53
ADMB variable vector.
Definition: fvar.hpp:2172
dvector extract_diagonal(const dmatrix &matrix)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: dvect17.cpp:12
void RETURN_ARRAYS_INCREMENT()
Definition: gradstrc.cpp:478
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static _THREAD gradient_structure * _instance
int rowmin(void) const
Definition: fvar.hpp:2560
Class definition of matrix with derivitive information .
Definition: fvar.hpp:2480
void RETURN_ARRAYS_DECREMENT()
Definition: gradstrc.cpp:511
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
int colmax(void) const
Definition: fvar.hpp:2556