ivy: use matrix constructor to guarantee a sensible number of elements