Created
May 7, 2019 18:19
-
-
Save drezap/bf5dfbbb5013c317fefd838dec271f3d to your computer and use it in GitHub Desktop.
resets includes to work with the flattened prim structure throughout the entire stan math library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
sed -i -e "s/stan\/math\/prim\/mat/stan\/math\/prim/g" $f ## "" mat | |
sed -i -e "s/stan\/math\/prim\/arr/stan\/math\/prim/g" $f ## "" arr | |
## edit higher level includes | |
sed -i -e "s/stan\/math\/prim\/scal.hpp/stan\/math\/prim.hpp/g" $f | |
sed -i -e "s/stan\/math\/prim\/mat.hpp/stan\/math\/prim.hpp/g" $f | |
sed -i -e "s/stan\/math\/prim\/arr.hpp/stan\/math\/prim.hpp/g" $f | |
done | |
for f in ./stan/math/rev/core/*.hpp | |
do | |
echo $f | |
sed -i -e "s/stan\/math\/prim\/scal/stan\/math\/prim/g" $f ## remove scal | |
sed -i -e "s/stan\/math\/prim\/mat/stan\/math\/prim/g" $f ## "" mat | |
sed -i -e "s/stan\/math\/prim\/arr/stan\/math\/prim/g" $f ## "" arrx | |
done | |
## editing the higher level includes | |
for f in ./stan/math/$fldr/*.hpp | |
do | |
echo $f | |
sed -i -e "s/stan\/math\/prim\/scal/stan\/math\/prim/g" $f | |
sed -i -e "s/stan\/math\/prim\/mat/stan\/math\/prim/g" $f | |
sed -i -e "s/stan\/math\/prim\/arr/stan\/math\/prim/g" $f | |
## edit higher level includes | |
sed -i -e "s/stan\/math\/prim\/scal.hpp/stan\/math\/prim.hpp/g" $f | |
sed -i -e "s/stan\/math\/prim\/mat.hpp/stan\/math\/prim.hpp/g" $f | |
sed -i -e "s/stan\/math\/prim\/arr.hpp/stan\/math\/prim.hpp/g" $f | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment