Skip to content

Instantly share code, notes, and snippets.

View drezap's full-sized avatar
🔥

Andre Zapico drezap

🔥
View GitHub Profile
@drezap
drezap / flatten_prim_meta.sh
Last active June 24, 2019 17:09
This flattens the meta programs of the C++ stan math library
# This script should do the following:
# 1) Move scal to prim/meta
# 2) Move mat to the prim/meta
# a) if a file exists, just cat it to the end
# b) properly handle the #ifndefs, and the brackets and stuff
# 3) Move arr
# a) same logic as a) above
# b) same logic as b) above
# we also need to creat the meta.hpp file properly
@drezap
drezap / edit_includes.sh
Created May 7, 2019 18:19
resets includes to work with the flattened prim structure throughout the entire stan math library
fldrs=("rev" "mix" "fwd" "prim")
for fldr in "${fldrs[@]}";
do
echo $fldr
## parsing all .hpp files in rev, mix and prim
for f in ./stan/math/$fldr/*/*/*.hpp
do
echo $f
sed -i -e "s/stan\/math\/prim\/scal/stan\/math\/prim/g" $f ## remove scal