ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fvar_ma1.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  {
21 
22  if (x.indexmin() != m.rowmin() || x.indexmax() != m.rowmax())
23  {
24  cerr << " Incompatible array bounds in "
25  "dvar_vector operator*(const dvector& x, const dvar_matrix& m)\n";
26  ad_exit(21);
27  }
28  dvar_vector tmp(m.colmin(),m.colmax());
29  dvariable sum;
30 
31  for (int j=m.colmin(); j<=m.colmax(); j++)
32  {
33  sum=0.0;
34  for (int i=x.indexmin(); i<=x.indexmax(); i++)
35  {
36  sum+=x.elem(i)*m.elem(i,j);
37  }
38  tmp[j]=sum;
39  }
41  return(tmp);
42  }
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
int colmin(void) const
Definition: fvar.hpp:2552
#define x
Vector of double precision numbers.
Definition: dvector.h:50
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
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
Definition: d3arr12.cpp:17
void RETURN_ARRAYS_INCREMENT()
Definition: gradstrc.cpp:478
int indexmax() const
Get maximum valid index.
Definition: dvector.h:204
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.
Fundamental data type for reverse mode automatic differentiation.
Definition: fvar.hpp:1518
int colmax(void) const
Definition: fvar.hpp:2556