janestreet / base

Standard library for OCaml
MIT License
848 stars 124 forks source link

add Array.copy_matrix #119

Closed benjub closed 2 years ago

benjub commented 2 years ago

Following #118, add the function Array.copy_matrix to return a fresh copy of an array of arrays. As pointed out in #118 by @bcc32, nested arrays are often not the best way to represent matrices (which can be done with Bigarray), but the existence of Array.make_matrix justifies the addition of Array.copy_matrix.

bcc32 commented 2 years ago

Thanks for your contribution! I've imported this patch into our internal code review system. This PR should get merged once it makes its way to GitHub.