using nonscalable MatPtAP() implementation