ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f1b2vc8.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 {
21  //check_shape(x,M,"operator *");
22  int mmin=v.indexmin();
23  int mmax=v.indexmax();
24  df1b2vector tmp;
25  tmp.noallocate(mmin,mmax);
26  for (int i=mmin;i<=mmax;i++) tmp(i)=x+v(i);
27  return tmp;
28 }
29 
35 {
38  //check_shape(x,M,"operator *");
39  int mmin=v.indexmin();
40  int mmax=v.indexmax();
41  df1b2vector tmp;
42  tmp.noallocate(mmin,mmax);
43  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)-x;
44  return tmp;
45 }
46 
52 {
55  //check_shape(x,M,"operator *");
56  int mmin=v.indexmin();
57  int mmax=v.indexmax();
58  df1b2vector tmp;
59  tmp.noallocate(mmin,mmax);
60  for (int i=mmin;i<=mmax;i++) tmp(i)=x-v(i);
61  return tmp;
62 }
63 
69 {
72  //check_shape(x,M,"operator *");
73  int mmin=v.indexmin();
74  int mmax=v.indexmax();
75  df1b2vector tmp;
76  tmp.noallocate(mmin,mmax);
77  for (int i=mmin;i<=mmax;i++) tmp(i)=x-v(i);
78  return tmp;
79 }
80 
86 {
89  //check_shape(x,M,"operator *");
90  int mmin=v.indexmin();
91  int mmax=v.indexmax();
92  df1b2vector tmp;
93  tmp.noallocate(mmin,mmax);
94  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)-x;
95  return tmp;
96 }
97 
103 {
104  ADUNCONST(dvector,v)
106  //check_shape(x,M,"operator *");
107  int mmin=v.indexmin();
108  int mmax=v.indexmax();
109  df1b2vector tmp;
110  tmp.noallocate(mmin,mmax);
111  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)+x;
112  return tmp;
113 }
114 
120 {
121  ADUNCONST(dvector,v)
123  //check_shape(x,M,"operator *");
124  int mmin=v.indexmin();
125  int mmax=v.indexmax();
126  df1b2vector tmp;
127  tmp.noallocate(mmin,mmax);
128  for (int i=mmin;i<=mmax;i++) tmp(i)=v(i)*x;
129  return tmp;
130 }
d3_array operator-(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
Definition: d3arr2a.cpp:152
#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
Description not yet available.
Definition: df1b2fun.h:953
d3_array operator+(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
Definition: d3arr2a.cpp:132
Description not yet available.
Definition: df1b2fun.h:266
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
Definition: d3arr12.cpp:17
void noallocate(int lib, int ub)
Description not yet available.
Definition: f1b2vc1.cpp:733
Description not yet available.