Skip to content

Instantly share code, notes, and snippets.

View ha7ilm's full-sized avatar
🇭🇺

András Retzler ha7ilm

🇭🇺
  • Belgium
  • 07:29 (UTC -12:00)
View GitHub Profile
@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

function [casadi_expr] = mupad2casadi(mupad_expr,mupad_var,casadi_var)
s = size(mupad_expr);
assert(numel(s)<=2, 'Tensors not supported. Make a vector or matrix from the mupad expression first.');
mupad_expr = mupad_expr(:);
matlabFunction(symfun(mupad_expr,mupad_var),'File','temp_fun.m');
clear temp_fun
args = vertsplit(casadi_var);
casadi_expr = temp_fun(args{:});