Prev Next

AD Copy Constructor and Assignment Operator

Syntax

Constructor
AD<Basey(x)
AD<Basey = x

Assignment
y = x

Purpose
The constructor creates a new AD<Base> object y and the assignment operator uses an existing y. In either case, y has the same value as x, and the same dependence on the independent variables (y is a variable if and only if x is a variable).

x
The argument x has prototype
     const 
Type &x
where Type is VecAD<Base>::reference, AD<Base>, Base, or double.

y
The target y has prototype
     AD<
Base> &y

Example
The following files contain examples and tests of these operations. Each test returns true if it succeeds and false otherwise.
CopyAD.cpp AD Copy Constructor: Example and Test
CopyBase.cpp AD Constructor From Base Type: Example and Test
Eq.cpp AD Assignment Operator: Example and Test

Input File: cppad/local/ad_copy.hpp