Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#!/bin/bash
# Author: snikumbh
#
# Expected input arguments:
# a. First argument: executable/matlab
# b. Only if you specified "executable" in (a), specify the path where the MATLAB Runtime is installed
# c. Only if you specified "executable" in (a), specify the version as v86/v90 for MATLAB Runtime version 8.6 (R2015b) or version 9.0 (R2016a)
#
echo 'Preparing for testing ...'
cp config-comik.txt config-comik-test.txt
sed -i 's/OUTPUT_FOLDER=comik_run_simulated_dataset1/OUTPUT_FOLDER=test_comik_run_simulated_dataset1/g' config-comik-test.txt
sed -i 's/NUMBER_OF_CLUSTERS=\[2 5 7]/NUMBER_OF_CLUSTERS=\[2\]/g' config-comik-test.txt
sed -i 's/SIGMA_VALUES=10\.\^\[1\:1\:2\]/SIGMA_VALUES=10\.\^\[1\]/g' config-comik-test.txt
sed -i 's/COST_VALUES=10\.\^\[-3\:1\:3\]/COST_VALUES=10\.\^\[1\]/g' config-comik-test.txt
sed -i 's/NUMBER_OF_INNER_FOLDS=5/NUMBER_OF_INNER_FOLDS=3/g' config-comik-test.txt
sed -i 's/NUMBER_OF_OUTER_FOLDS=5/NUMBER_OF_OUTER_FOLDS=3/g' config-comik-test.txt
if [ "$1" = "executable" ]
then
echo "Only testing the executable ... this might take some time"
if [ "$3" = "v86" ];
then
if [ -f "run_CoMIK_v86.sh" ];
then
./run_CoMIK_v86.sh $2 config-comik-test.txt
fi
elif [ "$3" = "v90" ];
then
if [ -f "run_CoMIK_v90.sh" ];
then
./run_CoMIK_v90.sh $2 config-comik-test.txt
fi
else
echo 'No file to run.'
fi
elif [ "$1" = "matlab" ]
then
echo 'Only testing inside MATLAB ... this might take some time'
matlab -nodesktop -nodisplay -nosplash -r "comik_wrapper('config-comik-test.txt'); exit;"
fi
if [ -d "$test_comik_run_simulated_dataset1"]; then
rm -R -f test_comik_run_simulated_dataset1/
rm config-comik-test.txt
fi
echo "Done."