Libraryless. Click here for Pure Java version (5433L/30K).
1 | static <A, B> Matrix<B> lambdaMapLike mapMatrix(IF1<A, B> f, Matrix<A> m) { |
2 | if (m == null) null; |
3 | |
4 | class MappedMatrix extends AbstractMatrix<B> { |
5 | *() { super(m.getWidth(), m.getHeight()); } |
6 | |
7 | public B get(int x, int y) { ret f.get(m.get(x, y)); } |
8 | public void set(int x, int y, B a) { unimplemented(); } |
9 | } |
10 | |
11 | ret new MappedMatrix; |
12 | } |
Began life as a copy of #1003239
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033641 |
Snippet name: | mapMatrix |
Eternal ID of this version: | #1033641/4 |
Text MD5: | 6af22ce7913fa16d679e71c96ab0253a |
Transpilation MD5: | 0bdd2f1e61adcf9580c4d4075850fafc |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-12-25 17:25:03 |
Source code size: | 366 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 178 / 243 |
Version history: | 3 change(s) |
Referenced in: | [show references] |