now uses alglib for every matrix multiplications