-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mzhurovich/optimize
Function opimization routines + tests
- Loading branch information
Showing
39 changed files
with
939 additions
and
208 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# | ||
# `readlink -e` replacement compatible with Mac OS X `readlink` implementation. | ||
# Credits to http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in and https://github.com/tarruda/zsh-autosuggestions/issues/38#issuecomment-69258372 | ||
|
||
set -u -e | ||
|
||
SOURCE="$1" | ||
while [ -h "$SOURCE" ]; do # Resolve $SOURCE until the file is no longer a symlink. | ||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
SOURCE="$(readlink "$SOURCE")" | ||
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # If $SOURCE was a relative symlink, we need to resolve it | ||
# relative to the path where the symlink file was located. | ||
done | ||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
|
||
echo "$DIR/$(basename "$1")" |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# This script generates the documentation in GitHub markdown format. | ||
# It scans all `docu_*.*` files, uses `.md` directly and takes the lines starting with double space from `.h`. | ||
# | ||
# Best practices: | ||
# | ||
# 1) Make `docu_*.cc` files that should be passing unit tests `docu_*_test.cc`. | ||
# This ensures they will be run by the full test make target, and thus it would | ||
# not so happen accidentally that some of the docu-mented code does not compile and/or pass tests. | ||
# | ||
# 2) Use header guards in those `docu_*_test.cc` files and `#include` them from the actual `test.cc` | ||
# for that Bricks module. | ||
# That would ensure that those `docu_*_test.cc` tests are run both by `make` from within that directory, | ||
# and by the top-level `make` that runs all tests at once and generates the coverage report. | ||
# | ||
# 3) Use the two spaces wisely. | ||
# If something should be in the docu, it should be indented. | ||
# If it should not be, it should not be indented. | ||
# The `docu_*.*` files are excluded from `make indent`. | ||
|
||
set -u -e | ||
|
||
for fn in $(for i in $(find . -type f -iname "docu_*.*" | grep -v ".noshit" | grep -v "zzz_full_test"); do | ||
echo -e "$(basename "$i")\t$i"; | ||
done | sort | cut -f2) ; do | ||
echo $fn >/dev/stderr | ||
case $fn in | ||
*.cc) | ||
echo '```cpp' | ||
(grep '^ ' $fn || echo " // No documentation data in '$fn'.") | sed "s/^ //g" | ||
echo '```' | ||
;; | ||
*.md) | ||
cat $fn | ||
;; | ||
*) | ||
echo "Unrecognized extension for file '$fn'." | ||
exit 1 | ||
;; | ||
esac | ||
done |
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
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
Oops, something went wrong.