Add support for double[] and double[][] matrix inputs.