Skip to content

Instantly share code, notes, and snippets.

View enkimute's full-sized avatar
💭
( ͡° ͜ʖ ͡°) ∑ xⁿ/n!

Steven De Keninck enkimute

💭
( ͡° ͜ʖ ͡°) ∑ xⁿ/n!
View GitHub Profile
using Grassmann;
@basis D"1,1,1,0";
P = [ rand()*v124 + rand()*v134 + rand()*v234 + v123 for i=1:1000 ];
L = [ rand()*v12 + rand()*v13 + rand()*v14 + rand()*v23 + rand()*v24 + rand()*v34 for i=1:1000 ];
A = [ rand() for i=1:1000];
test2(L,A,P) = (LA = exp.(L.*A); LA.*P.*.~LA)
@time begin for j in 1:1000; test2(L,A,P); end; end;
# Checked with the Grassmann author - this setup re-allocates but our non-allocating tests were slower.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
<SCRIPT SRC="../ganja.js"></SCRIPT>
</head>
<body>