added matrix methods size1/size2/size/numel, added profiling flags