function [egv,discrim,coeff] = fda(X,gnum,reg)
// Fisher discriminant analysis with regularization
// X ... data matrix arranged as columns - variables and rows - observations
// across individual groups
// gnum ... vector of group marks, e.g. gnum = [1 1 1 1 1 2 2 2 2 2 2 2 ...
// 3 3 3 3]' of the length corresponding to number of rows of X
// reg 0 ... without regularization (default)
// any numerical value ... parameter used within the regularization
// coeff ... discriminant coefficients - eigenvectors
// discrim ... discriminant variables
// egv ... eigenvalues
// Authors: Lukáš Malec, Lenka Netušilová and Hana Tvrdíková
// Date: $2015-10-23$