diff --git a/include/igl/active_set.cpp b/include/igl/active_set.cpp index b7112e8b1..247ecfb96 100755 --- a/include/igl/active_set.cpp +++ b/include/igl/active_set.cpp @@ -108,6 +108,12 @@ IGL_INLINE igl::SolverStatus igl::active_set( Matrix as_ux = Matrix::Constant(n,1,FALSE); Matrix as_ieq = Matrix::Constant(Aieq.rows(),1,FALSE); + Matrix fixed = Matrix::Constant(n,1,FALSE); + for(int k = 0;k ux(z)) - { - new_as_ux += (as_ux(z)?0:1); - //new_as_ux++; - as_ux(z) = TRUE; + if(Z(z) < lx(z)) + { + new_as_lx += (as_lx(z)?0:1); + //new_as_lx++; + as_lx(z) = TRUE; + } + if(Z(z) > ux(z)) + { + new_as_ux += (as_ux(z)?0:1); + //new_as_ux++; + as_ux(z) = TRUE; + } } } if(Aieq.rows() > 0) @@ -253,11 +263,11 @@ IGL_INLINE igl::SolverStatus igl::active_set( #ifndef NDEBUG { // NO DUPES! - Matrix fixed = Matrix::Constant(n,1,FALSE); + Matrix fixed_i = Matrix::Constant(n,1,FALSE); for(int k = 0;k