ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dmat23.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 
17 dmatrix outer_prod(const dvector& v1, const dvector& v2)
18 {
19  int imin = v1.indexmin();
20  int imax = v1.indexmax();
21  int jmin = v2.indexmin();
22  int jmax = v2.indexmax();
23 
24  dmatrix tmp(imin, imax, jmin, jmax);
25 
26  dvector* ptmpi = &tmp(imin);
27  double* pv1i = v1.get_v() + imin;
28  for (int i = imin; i <= imax; ++i)
29  {
30  double* ptmpij = ptmpi->get_v() + jmin;
31  double* pv2j = v2.get_v() + jmin;
32  for (int j = jmin; j <= jmax; ++j)
33  {
34  *ptmpij = *pv1i * *pv2j;
35 
36  ++ptmpij;
37  ++pv2j;
38  }
39 
40  ++ptmpi;
41  ++pv1i;
42  }
43  return tmp;
44 }
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin() const
Get minimum valid index.
Definition: dvector.h:199
int indexmax() const
Get maximum valid index.
Definition: dvector.h:204
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dmatrix outer_prod(const dvector &v1, const dvector &v2)
Description not yet available.
Definition: dmat23.cpp:17
Description not yet available.
Definition: fvar.hpp:2819
double *& get_v(void)
Definition: dvector.h:148