Libraryless. Click here for Pure Java version (5332L/29K).
1 | static <A> Matrix<A> listToMatrix(int w, L<A> data) {
|
2 | int n = l(data); |
3 | int h = n/w; |
4 | if (w*h != n) fail("Bad size", +n, +w, +h);
|
5 | ret ListToMatrix(w, h, data); |
6 | } |
Began life as a copy of #1033120
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1033239 |
| Snippet name: | listToMatrix |
| Eternal ID of this version: | #1033239/4 |
| Text MD5: | 471d1db374992303734a67f6a8c30552 |
| Transpilation MD5: | 6e2b07785b6c14f8ad30aee67e809395 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-10-27 00:05:43 |
| Source code size: | 172 bytes / 6 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 388 / 518 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |