17 #include <iostream.hpp>
39 cerr <<
"Incompatible bounds in "
40 "dvar_vector elem_prod(const dvar_vector& v1, const dvar_vector& v2)"
50 double* ptmp_inv = tmp_inv.
get_v() +
min;
52 for (
int i = min; i <=
max; ++i)
54 *ptmp_inv = 1.0 / pv2->
x;
55 ptmp->
x = pv1->
x * *ptmp_inv;
107 double* ptmp_div = tmp_div.
get_v() +
min;
108 double* pdftmp = dftmp.
get_v() +
min;
111 double* pdfv2 = dfv2.
get_v() + min2;
112 for (
int i = min; i <=
max; ++i)
117 double xx = *ptmp_div;
119 *pdfv1 = *pdftmp * xx;
121 *pdfv2 = -(*pdftmp) * *pcv1 * xx * xx;
152 cerr <<
"Incompatible bounds in "
153 "dvar_vector elem_prod(const dvar_vector& v1, const dvar_vector& v2)"
163 double* ptmp_inv = tmp_inv.
get_v() +
min;
165 for (
int i = min; i <=
max; ++i)
169 *ptmp_inv = 1.0 / *pv2;
170 ptmp->
x = pv1->
x * *ptmp_inv;
212 dfv1(i)=dftmp.
elem(i)*tmp_div.
elem(i);
214 dfv1.save_dvector_derivatives(v1pos);
234 cerr <<
"Incompatible bounds in "
235 "dvar_vector elem_prod(const dvar_vector& v1, const dvar_vector& v2)"
245 tmp.elem_value(i)=v1.
elem(i)*
x;
246 tmp_inv.elem(i)=-tmp.elem_value(i)*
x;
280 for (
int i=dfv2.indexmin();i<=dfv2.indexmax();i++)
283 dfv2(i)=dftmp.
elem(i)*tmp_div.
elem(i);
285 dfv2.save_dvector_derivatives(v2pos);
void dvdv_elem_div(void)
Adjoint gradient computation of elem_div(const dvar_vector&, const dvar_vector&)
double & elem_value(int i)
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
d3_array elem_div(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements division of a(i, j, k) / b(i, j, k).
void save_dvector_derivatives(const dvar_vector_position &pos) const
Puts the derivative values in a dvector into a dvar_vector's guts.
Description not yet available.
Description not yet available.
void verify_identifier_string(const char *)
Verifies gradient stack string.
dvector restore_dvector_value(const dvector_position &tmp)
Holds the data for the prevariable class.
void set_gradient_stack(void(*func)(void), double *dep_addr, double *ind_addr1=NULL, double mult1=0, double *ind_addr2=NULL, double mult2=0)
Description not yet available.
void save_dvector_position(const dvector &v)
prnstream & endl(prnstream &)
void save_dvector_value(const dvector &v)
void save_dvar_vector_value(const dvar_vector &v)
dvar_vector_position restore_dvar_vector_position()
void RETURN_ARRAYS_INCREMENT()
int indexmax() const
Get maximum valid index.
void cvdv_elem_div(void)
Adjoint gradient computation of elem_div(const dvector&, const dvar_vector&)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static _THREAD gradient_structure * _instance
int save_identifier_string(const char *)
Writes a gradient stack verification string.
dvector restore_dvar_vector_value(const dvar_vector_position &tmp)
Restores the size, address, and value information for a dvar_vector.
dvector_position restore_dvector_position()
void save_dvar_vector_position(const dvar_vector &v)
static _THREAD DF_FILE * fp
Stores the adjoint gradient data that will be processed by gradcalc.
dvector restore_dvar_vector_derivatives(const dvar_vector_position &tmp)
Description not yet available.
void RETURN_ARRAYS_DECREMENT()
void dvcv_elem_div(void)
Adjoint gradient computation of elem_div(const dvar_vector&, const dvector&)
static _THREAD grad_stack * GRAD_STACK1
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
double x
< value of the variable