ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_m52.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 
18  const dvector& y)
19 {
20  int mmin=M.indexmin();
21  int mmax=M.indexmax();
22  int bw=M.bandwidth();
23 
24  if (y.indexmin() !=mmin || y.indexmax() !=mmax)
25  {
26  cerr << "incompatible size in solve_trans" << endl;
27  ad_exit(1);
28  }
29  dvar_vector x(mmin,mmax);
30  int i,j;
31 
32  for (i=mmax;i>=mmin;i--)
33  {
34  dvariable sum=0.0;
35  int jmax=admin(mmax,i+bw-1);
36  for (j=i+1;j<=jmax;j++)
37  {
38  sum+=M(j,i)*x(j);
39  }
40  x(i)=(y(i)-sum)/M(i,i);
41  }
42 
43  return x;
44 }
#define x
Vector of double precision numbers.
Definition: dvector.h:50
Description not yet available.
Definition: fvar.hpp:8190
int indexmin() const
Get minimum valid index.
Definition: dvector.h:199
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr.cpp:21
exitptr ad_exit
Definition: gradstrc.cpp:53
ADMB variable vector.
Definition: fvar.hpp:2172
prnstream & endl(prnstream &)
dvector solve_trans(const lower_triangular_dmatrix &M, const dvector &y)
Description not yet available.
Definition: dmat36.cpp:80
int indexmax() const
Get maximum valid index.
Definition: dvector.h:204
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
#define M
Definition: rngen.cpp:57
int admin(int i, int j)
Definition: fvar.hpp:8987
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518