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

9
LINES

< > BotCompany Repo | #1033650 // eqMatrices - compare 2 matrices

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

Libraryless. Click here for Pure Java version (5028L/28K).

sbool <A> eqMatrices(Matrix<A> a, Matrix<A> b) {
  if (a == null || b == null) ret a == b;
  int w = a.getWidth(), h = a.getHeight();
  if (b.getWidth() != w || b.getHeight() != h) false;
  for y to h:
    for x to w:
      if (!eq(a.get(x, y), b.get(x, y))) false;
  true;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033650
Snippet name: eqMatrices - compare 2 matrices
Eternal ID of this version: #1033650/1
Text MD5: bc3f17b5957b571e6d1684b4c4425425
Transpilation MD5: 7eaa144814da50b02c3c3b61a19b4e20
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-12-25 22:43:02
Source code size: 283 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 149 / 219
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1033651 - matricesDifferingPoints - give all differing points