add public API for matrices