Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1033112 // ArrayMatrix - simple array-based implementation of Matrix

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5412L/30K).

1  
persistable sclass ArrayMatrix<A> extends AbstractMatrix<A> {
2  
  A[] data;
3  
  
4  
  *(int *w, int *h) { data = (A[]) new O[w*h]; }
5  
  *(int *w, int *h, A[] *data) {}
6  
7  
  public A get(int x, int y) { ret data[y*w+x]; }
8  
  public void set(int x, int y, A a) { data[y*w+x] = a; }
9  
}

Author comment

Began life as a copy of #1033111

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033112
Snippet name: ArrayMatrix - simple array-based implementation of Matrix
Eternal ID of this version: #1033112/4
Text MD5: f7d61c0e4a4cd02c4a890af958170586
Transpilation MD5: 5601cf35883c56d189dd291f601c7fd9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-11-04 03:43:50
Source code size: 278 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 178 / 301
Version history: 3 change(s)
Referenced in: [show references]