Skip to content

Commit dac23dd

Browse files
committed
cppadcg: fix ADFun constructor
1 parent 26f0c73 commit dac23dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/pycppad/ad_fun.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 INRIA
2+
* Copyright 2021-2022 INRIA
33
*/
44

55
#ifndef __pycppad_ad_fun_hpp__
@@ -68,9 +68,11 @@ namespace pycppad
6868
x = x_; y = y_;
6969
}
7070

71-
static ADFun* constructor(const ADVector & x, const ADVector & y)
71+
static ADFun* constructor(RefADVector x, RefADVector y)
7272
{
73-
ADFun * f = new ADFun(x,y);
73+
ADVector x_(x),y_(y);
74+
ADFun * f = new ADFun(x_,y_);
75+
x = x_; y = y_;
7476
return f;
7577
}
7678

0 commit comments

Comments
 (0)