Optimal fisher discriminant analysis using the rank decomposition