Skip to content

Commit

Permalink
Fix ineq counting problem?
Browse files Browse the repository at this point in the history
  • Loading branch information
John Eslick committed Dec 10, 2021
1 parent ee4aea6 commit 4f0dbd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion petsc/petsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ int main(int argc, char **argv){
LUrhs = (real*)Malloc(n_con*sizeof(real)); /* Lower constraint right side */
Urhsx = (real*)Malloc(n_con*sizeof(real)); /* Upper constraint right side */
// count inequalities
for(i=0; i<n_con; ++i) if(LUrhs[i] - Urhsx[i] > 1e-10) ++sol_ctx.n_ineq;
for(i=0; i<n_con; ++i) if(LUrhs[i] - Urhsx[i] > 1e-8) {
++sol_ctx.n_ineq;
PetscPrintf(PETSC_COMM_SELF, "%d, ineq (%f < body < %f)", i, LUrhs[i], Urhsx[i]);
}
// count degrees of freedom (n_var and n_con are macros from asl.h)
sol_ctx.dof = n_var - n_con + sol_ctx.n_ineq;
// Print basic problem information
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.4 (DATE) (PLAT)
2.5.1 (DATE) (PLAT)

0 comments on commit 4f0dbd5

Please sign in to comment.