Skip to content

Commit

Permalink
more brain twisters #353 #364
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed May 23, 2023
1 parent 20af896 commit a198d62
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions examples/arrays2.lphy
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ a2 = rep(rep(0.0, 0), 0); // an empty 2d array
b2 = rep(rep(0.0, 0), 0);
c2 = a2 != b2;

// vectorization
// not sure true or false
empty = a == a2;

// vectorised
x = [1.0,2.0,3.0];
y = [1,2,3];
z = x == y;

x2 = [[1.0,2.0,3.0], [4.0,5.0,6.0]];
y2 = [[1,2,3], [4,5,6]];
z2 = x2 != y2;
z2 = x2 != y2;

// false
compare1 = a == x;
compare2 = a2 == x2;
// vectorised
compare3 = x == x2;

0 comments on commit a198d62

Please sign in to comment.