Make use of gradient class in place of arrays like mag[][], ang[][], LX, LY.
Only clients should be linked against boost.