ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f1b2vc9.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 <df1b2fun.h>
12 
18 {
19  //check_shape(x,M,"operator *");
21  int mmin=v.indexmin();
22  int mmax=v.indexmax();
23  df1b2vector tmp;
24  tmp.noallocate(mmin,mmax);
25  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)/x;
26  return tmp;
27 }
28 
34 {
36  //check_shape(x,M,"operator *");
37  int mmin=v.indexmin();
38  int mmax=v.indexmax();
39  df1b2vector tmp;
40  tmp.noallocate(mmin,mmax);
41  for (int i=mmin;i<=mmax;i++) tmp(i)=x/v(i);
42  return tmp;
43 }
44 
50 {
52  //check_shape(x,M,"operator *");
53  int mmin=v.indexmin();
54  int mmax=v.indexmax();
55  df1b2vector tmp;
56  tmp.noallocate(mmin,mmax);
57  for (int i=mmin;i<=mmax;i++) tmp(i)=x/v(i);
58  return tmp;
59 }
60 
61 //*********************************************************
67 {
68  //check_shape(x,M,"operator *");
69  int mmin=v.indexmin();
70  int mmax=v.indexmax();
71  df1b2vector tmp;
72  tmp.noallocate(mmin,mmax);
73  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)/x;
74  return tmp;
75 }
76 
82 {
84  //check_shape(x,M,"operator *");
85  int mmin=v.indexmin();
86  int mmax=v.indexmax();
87  df1b2vector tmp;
88  tmp.noallocate(mmin,mmax);
89  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)/x;
90  return tmp;
91 }
92 
97 df1b2vector operator / (const double& x,const df1b2vector& _v)
98 {
100  //check_shape(x,M,"operator *");
101  //check_shape(x,M,"operator *");
102  int mmin=v.indexmin();
103  int mmax=v.indexmax();
104  df1b2vector tmp;
105  tmp.noallocate(mmin,mmax);
106  for (int i=mmin;i<=mmax;i++) tmp(i)=x/v(i);
107  return tmp;
108 }
#define x
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Definition: fvar.hpp:140
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin() const
Get minimum valid index.
Definition: dvector.h:199
Description not yet available.
Definition: df1b2fun.h:953
Description not yet available.
Definition: df1b2fun.h:266
void noallocate(int lib, int ub)
Description not yet available.
Definition: f1b2vc1.cpp:733
int indexmax() const
Get maximum valid index.
Definition: dvector.h:204
Description not yet available.
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
Definition: d3arr2b.cpp:14