Java implementation of quadratic classifier