C-Frost icon indicating copy to clipboard operation
C-Frost copied to clipboard

JacStructFuncs field missing in solver.Constraint and solver.Objective

Open ayush-agrawal opened this issue 6 years ago • 1 comments

On running both the examples, I get the following error:

Reference to non-existent field 'JacStructFuncs'.
Error in frost_c.formulateProblemStructure (line 63)
            jac_pattern = feval(obj.Constraint.JacStructFuncs{i},0);
Error in frost_c.createDataFile (line 6)
    obj = frost_c.formulateProblemStructure(solver, funcs);
Error in main_opt (line 141)
    frost_c.createDataFile(solver, funcs, res_path, 'data');

It looks like the JacStructFuncs field is missing in solver.Constraint and solver.Objective. I've fixed it for now by adding the following lines before the call to frost_c.createDataFile(solver, funcs, res_path, 'data'); in the main file:

for i = 1:length(solver.Constraint.JacFuncs)
        solver.Constraint.JacStructFuncs{i} = [solver.Constraint.JacFuncs{i}(1),'s',solver.Constraint.JacFuncs{i}(2:end)];
    end
    for i = 1:length(solver.Objective.JacFuncs)
        solver.Objective.JacStructFuncs{i} = [solver.Objective.JacFuncs{i}(1),'s',solver.Objective.JacFuncs{i}(2:end)];
    end

Is there a better way to resolve this issue, or am I missing something?

ayush-agrawal avatar Jul 19 '18 22:07 ayush-agrawal

Have you pulled the latest commits to FROST?

RossHartley avatar Jul 19 '18 23:07 RossHartley