Linear improvements.

Performance improvements for Linear constraint.