Skip to content

Commit

Permalink
fixed vector type in source_generation example
Browse files Browse the repository at this point in the history
  • Loading branch information
joao committed Oct 11, 2013
1 parent 6f60b6a commit 99627b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions example/source_generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ int main(void) {
typedef AD<CGD> ADCG;

// independent variable vector
std::vector<ADCG> U(2);
CppAD::vector<ADCG> U(2);
U[0] = 2.;
U[1] = 3.;
Independent(U);

// dependent variable vector
std::vector<ADCG> Z(1);
CppAD::vector<ADCG> Z(1);

// the model
ADCG a = U[0] / 1. + U[1] * U[1];
Expand All @@ -39,7 +39,7 @@ int main(void) {
ADFun<CGD> fun(U, Z);

// independent variable vector, indices, values, and declaration
std::vector<double> u(2);
CppAD::vector<double> u(2);
u[0] = 2.;
u[1] = 3.;

Expand All @@ -49,10 +49,10 @@ int main(void) {
*/
CodeHandler<double> handler;

std::vector<CGD> indVars(2);
CppAD::vector<CGD> indVars(2);
handler.makeVariables(indVars);

std::vector<CGD> jac = fun.SparseJacobian(indVars);
CppAD::vector<CGD> jac = fun.SparseJacobian(indVars);

CLanguage<double> langC("double");
CLangDefaultVariableNameGenerator<double> nameGen;
Expand Down

0 comments on commit 99627b6

Please sign in to comment.