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

10
LINES

< > BotCompany Repo | #1033658 // copyMatrix

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

Libraryless. Click here for Pure Java version (5216L/29K).

1  
static <A, B extends Matrix<A>> B copyMatrix(Matrix<A> src, B dest) {
2  
  assertSameSize(src, dest);
3  
  int w = src.getWidth(), h = src.getHeight();
4  
5  
  for y to h:
6  
    for x to w:
7  
      dest.set(x, y, src.get(x, y));
8  
      
9  
  ret dest;
10  
}

Author comment

Began life as a copy of #1033649

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033658
Snippet name: copyMatrix
Eternal ID of this version: #1033658/4
Text MD5: d333b04f20e26d7d80aa2c9741000d34
Transpilation MD5: cc323c926c01ee5d781f99f4777fe3a7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-12-26 16:02:30
Source code size: 243 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 155 / 218
Version history: 3 change(s)
Referenced in: [show references]