Inverse Electromagnetics for EUV mask metrology and inspection