Closed floswald closed 11 years ago
So I actually think this is what to be expected.
When mpec.solve
is called the first time, it runs the cFunc with coloring set to TRUE. It needs to do that to get the Jacobian structure. This is done in mpec.solve line 18. The first call should be with coloring set to TRUE and then it should be with coloring set to FASLE.
I had first defined a global variable for coloring, but then global variable are never a good idea. It's also not really specific to the function.
yes ok i didnt' get that
guys, so just to document something strange. In
run the code up to and including line 17, where function FDiff a_ is defined. look at V:
as expected. plug in an FDiff:
as expected. Notice in particular that coloring=FALSE as set.
now do
and run the rest of the code. when you enter V the first time as it's called by
mpec.solve
, ain is a numeric, which is as expected, and gin is an FDiff. but look at the coloring slot of gin! it switched to TRUE. I've got no good explanation for this.Could we define an environment
etc and take out the coloring slot of the FDiff? This way either all variables are colored or none, and maybe it overcomes this problem?