Skip to content
Prev Previous commit
Next Next commit
cppadcg: fix ADFun constructor
  • Loading branch information
jcarpent committed May 19, 2022
commit dac23ddaeb2d27ab5c8324918a7e23c4084e7934
8 changes: 5 additions & 3 deletions include/pycppad/ad_fun.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 INRIA
* Copyright 2021-2022 INRIA
*/

#ifndef __pycppad_ad_fun_hpp__
Expand Down Expand Up @@ -68,9 +68,11 @@ namespace pycppad
x = x_; y = y_;
}

static ADFun* constructor(const ADVector & x, const ADVector & y)
static ADFun* constructor(RefADVector x, RefADVector y)
{
ADFun * f = new ADFun(x,y);
ADVector x_(x),y_(y);
ADFun * f = new ADFun(x_,y_);
x = x_; y = y_;
return f;
}

Expand Down