The explicit derivation of the efficient portfolio frontier in the case of degeneracy and general singularity