added function to c api to create a nmatrix from a ruby array