1 # ifndef CPPAD_CORE_DEPENDENT_HPP
2 # define CPPAD_CORE_DEPENDENT_HPP
149 template <
typename Base>
150 template <
typename ADvector>
155 "Can't store current operation sequence in this ADFun object"
156 "\nbecause there is no active tape (for this thread)."
176 template <
typename Base>
177 template <
typename ADvector>
182 "Dependent: independent variable vector has size zero."
186 "Dependent: independent variable vector has been changed."
191 "Dependent: independent variable vector has been changed."
195 for(j = 0; j < size_t(x.size()); j++)
197 size_t(x[j].taddr_) == (j+1),
198 "ADFun<Base>: independent variable vector has been changed."
201 x[j].tape_id_ == x[0].tape_id_,
202 "ADFun<Base>: independent variable vector has been changed."
205 for(i = 0; i < size_t(y.size()); i++)
208 "ADFun<Base>: dependent vector contains a variable for"
209 "\na different tape (thread) than the independent variables."
234 template <
typename Base>
235 template <
typename ADvector>
244 CheckSimpleVector< AD<Base>, ADvector>();
248 "ADFun operation sequence dependent variable size is zero size"
255 dep_parameter_.resize(m);
256 dep_taddr_.resize(m);
257 for(i = 0; i < m; i++)
259 if( dep_parameter_[i] )
263 else y_taddr = y[i].taddr_;
266 dep_taddr_[i] = y_taddr;
273 has_been_optimized_ =
false;
274 compare_change_count_ = 1;
275 compare_change_number_ = 0;
276 compare_change_op_index_ = 0;
277 num_order_taylor_ = 0;
278 num_direction_taylor_ = 0;
279 cap_order_taylor_ = 0;
283 num_var_tape_ = tape->
Rec_.num_var_rec();
289 cskip_op_.resize( tape->
Rec_.num_op_rec() );
292 load_op_.resize( tape->
Rec_.num_load_op_rec() );
298 play_.get(tape->
Rec_, n);
302 ind_taddr_.resize(n);
304 for(j = 0; j < n; j++)
310 for_jac_sparse_pack_.resize(0, 0);
311 for_jac_sparse_set_.resize(0,0);
314 subgraph_info_.resize(
addr_t RecordParOp(const Base &x)
Place a parameter in the tape.
#define CPPAD_ASSERT_KNOWN(exp, msg)
Check that exp is true, if not print msg and terminate execution.
size_t size_independent_
Number of independent variables in this tapes reconding. Set by Independent and effectively const...
size_t NumRes(OpCode op)
Number of variables resulting from the specified operation.
static local::ADTape< Base > * tape_manage(tape_manage_job job)
Create and delete tapes that record AD<Base> operations for current thread.
static local::ADTape< Base > * tape_ptr(void)
Pointer for the tape for this AD<Base> class and the current thread.
void Dependent(local::ADTape< Base > *tape, const ADvector &y)
change the operation sequence corresponding to this object
CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION bool Variable(const AD< Base > &x)
#define CPPAD_ASSERT_UNKNOWN(exp)
Check that exp is true, if not terminate execution.
local::recorder< Base > Rec_
This is where the information is recorded.
Class used to hold tape that records AD<Base> operations.
CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION bool Parameter(const AD< Base > &x)