ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dvect20.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 {
19  int min = indexmin();
20  int max = indexmax();
21  double* pvi = v + min;
22  for (int i = min; i <= max; ++i)
23  {
24  *pvi /= x;
25  ++pvi;
26  }
27  return *this;
28 }
29 
35 {
36  int min = indexmin();
37  int max = indexmax();
38  double* pvi = v + min;
39  for (int i = min; i <= max; ++i)
40  {
41  *pvi *= x;
42  ++pvi;
43  }
44  return *this;
45 }
dvector & operator*=(double v1)
Multiply elements of a vector by a constant.
Definition: dvect20.cpp:34
double * v
pointer to the data
Definition: dvector.h:53
#define x
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin() const
Get minimum valid index.
Definition: dvector.h:199
friend double min(const dvector &)
Returns the minimum value of vector vec.
Definition: dvect7.cpp:107
friend double max(const dvector &)
Returns the maximum value of vector vec.
Definition: dvect7.cpp:85
int indexmax() const
Get maximum valid index.
Definition: dvector.h:204
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector & operator/=(double v1)
Divide elements of a vector by a constant.
Definition: dvect20.cpp:17