Linear algebra for D