Add block-matrix code as regression test