if [ "$1" == "" ] ; then
cat _internal/example-bash-help
exit 1
fi
if [ "$4" != "" ] ; then
echo Too many parameters specified
echo Did you enclose parameters to be passed to the compiler in double quotes?
exit 1
fi
if [ "$1" == "list" ] ; then
case $2 in
dforest)
echo No examples for this unit
;;
tsort)
echo No examples for this unit
;;
descriptivestatistics)
echo No examples for this unit
;;
bdss)
echo No examples for this unit
;;
kmeans)
echo No examples for this unit
;;
blas)
echo No examples for this unit
;;
lda)
echo No examples for this unit
;;
hblas)
echo No examples for this unit
;;
reflections)
echo No examples for this unit
;;
creflections)
echo No examples for this unit
;;
sblas)
echo No examples for this unit
;;
ablasf)
echo No examples for this unit
;;
ablas)
echo No examples for this unit
;;
ortfac)
echo No examples for this unit
;;
rotations)
echo No examples for this unit
;;
hsschur)
echo No examples for this unit
;;
evd)
echo No examples for this unit
;;
hqrnd)
echo No examples for this unit
;;
matgen)
echo No examples for this unit
;;
trfac)
echo No examples for this unit
;;
trlinsolve)
echo No examples for this unit
;;
safesolve)
echo No examples for this unit
;;
rcond)
echo rcond_1             condition number of the Vandermonde matrix
;;
matinv)
echo No examples for this unit
;;
linreg)
echo No examples for this unit
;;
gammafunc)
echo No examples for this unit
;;
normaldistr)
echo No examples for this unit
;;
igammaf)
echo No examples for this unit
;;
bdsvd)
echo No examples for this unit
;;
svd)
echo No examples for this unit
;;
logit)
echo No examples for this unit
;;
mlpbase)
echo mlp_process         MLPProcess\(\) example
echo mlp_process_cls     MLPProcess\(\) example
echo mlp_randomize       MLPRandomize\(\) example
echo mlp_serialize       MLPSerialize\(\)/MLPUnserialize\(\) example
;;
xblas)
echo No examples for this unit
;;
densesolver)
echo No examples for this unit
;;
mlpe)
echo No examples for this unit
;;
linmin)
echo No examples for this unit
;;
minlbfgs)
echo minlbfgs_1          L-BFGS optimization #1
echo minlbfgs_2          L-BFGS optimization #2
;;
mlptrain)
echo No examples for this unit
;;
pca)
echo No examples for this unit
;;
odesolver)
echo ode_example1        ODE solver: example #1
echo ode_example2        ODE solver: example #2
;;
conv)
echo No examples for this unit
;;
ftbase)
echo No examples for this unit
;;
fft)
echo No examples for this unit
;;
corr)
echo No examples for this unit
;;
fht)
echo No examples for this unit
;;
autogk)
echo autogk_singular     1-dimensional integration of singular functions
echo autogk_smooth       1-dimensional integration
;;
gq)
echo No examples for this unit
;;
gkq)
echo No examples for this unit
;;
lsfit)
echo lsfit_linear        Linear least squares fitting
echo lsfit_nonlinear     Nonlinear least squares fitting, Hessian-free
echo lsfit_nonlinear2    Nonlinear least squares fitting, using Hessian
;;
minlm)
echo minlm_fgh           Levenberg-Marquardt optimization, FGH scheme
echo minlm_fgj           Levenberg-Marquardt optimization, FGJ scheme
echo minlm_fj            Levenberg-Marquardt optimization, FJ scheme
echo minlm_fj2           Levenberg-Marquardt optimization, FJ scheme
;;
polint)
echo polint_cheb1        1-dimensional Chebyshev polynomial interpolation
echo polint_cheb2        1-dimensional Chebyshev polynomial interpolation
echo polint_eqdist       1-dimensional equidistant polynomial interpolation
echo polint_fit          1-dimensional polynomial fitting
echo polint_gen          1-dimensional polynomial interpolation
;;
ratinterpolation)
echo No examples for this unit
;;
ratint)
echo ratint_fit          Rational fitting
;;
apserv)
echo No examples for this unit
;;
spline2d)
echo No examples for this unit
;;
spline3)
echo No examples for this unit
;;
spline1d)
echo spline1d_calc       1-dimensional spline operations
echo spline1d_cubic      cubic spline interpolation
echo spline1d_fit        1-dimensional spline fitting
echo spline1d_fitc       1-dimensional constrained spline fitting
echo spline1d_hermite    1-dimensional Hermite spline interpolation
echo spline1d_linear     1-dimensional linear spline interpolation
;;
idwint)
echo No examples for this unit
;;
nearestneighbor)
echo No examples for this unit
;;
pspline)
echo No examples for this unit
;;
matdet)
echo No examples for this unit
;;
sdet)
echo No examples for this unit
;;
ldlt)
echo No examples for this unit
;;
spdgevd)
echo No examples for this unit
;;
sinverse)
echo No examples for this unit
;;
inverseupdate)
echo No examples for this unit
;;
srcond)
echo No examples for this unit
;;
ssolve)
echo No examples for this unit
;;
estnorm)
echo No examples for this unit
;;
schur)
echo No examples for this unit
;;
mincg)
echo mincg_2             CG optimization #2 \(StpMax demo\)
echo mincg_1             CG optimization #1
;;
minasa)
echo minasa_1            Bound constrained optimization #1
echo minasa_2            Bound constrained optimization #2
;;
airyf)
echo No examples for this unit
;;
bessel)
echo No examples for this unit
;;
betaf)
echo No examples for this unit
;;
chebyshev)
echo No examples for this unit
;;
dawson)
echo No examples for this unit
;;
elliptic)
echo No examples for this unit
;;
expintegrals)
echo No examples for this unit
;;
fresnel)
echo No examples for this unit
;;
hermite)
echo No examples for this unit
;;
ibetaf)
echo No examples for this unit
;;
jacobianelliptic)
echo No examples for this unit
;;
laguerre)
echo No examples for this unit
;;
legendre)
echo No examples for this unit
;;
psif)
echo No examples for this unit
;;
trigintegrals)
echo No examples for this unit
;;
binomialdistr)
echo No examples for this unit
;;
nearunityunit)
echo No examples for this unit
;;
chisquaredistr)
echo No examples for this unit
;;
correlation)
echo No examples for this unit
;;
fdistr)
echo No examples for this unit
;;
correlationtests)
echo No examples for this unit
;;
studenttdistr)
echo No examples for this unit
;;
jarquebera)
echo No examples for this unit
;;
mannwhitneyu)
echo No examples for this unit
;;
poissondistr)
echo No examples for this unit
;;
stest)
echo No examples for this unit
;;
studentttests)
echo No examples for this unit
;;
variancetests)
echo No examples for this unit
;;
wsr)
echo No examples for this unit
;;
*)
echo unknown unit
exit 1
;;
esac
exit 0
fi
if [ "$1" == "view" ] ; then
case $2 in
autogk_singular)
cat examples/_demo_autogk_singular.*
;;
autogk_smooth)
cat examples/_demo_autogk_smooth.*
;;
minlbfgs_1)
cat examples/_demo_minlbfgs_1.*
;;
lsfit_linear)
cat examples/_demo_lsfit_linear.*
;;
lsfit_nonlinear)
cat examples/_demo_lsfit_nonlinear.*
;;
lsfit_nonlinear2)
cat examples/_demo_lsfit_nonlinear2.*
;;
minlm_fgh)
cat examples/_demo_minlm_fgh.*
;;
minlm_fgj)
cat examples/_demo_minlm_fgj.*
;;
minlm_fj)
cat examples/_demo_minlm_fj.*
;;
minlm_fj2)
cat examples/_demo_minlm_fj2.*
;;
mlp_process)
cat examples/_demo_mlp_process.*
;;
mlp_process_cls)
cat examples/_demo_mlp_process_cls.*
;;
mlp_randomize)
cat examples/_demo_mlp_randomize.*
;;
mlp_serialize)
cat examples/_demo_mlp_serialize.*
;;
ode_example1)
cat examples/_demo_ode_example1.*
;;
ode_example2)
cat examples/_demo_ode_example2.*
;;
polint_cheb1)
cat examples/_demo_polint_cheb1.*
;;
polint_cheb2)
cat examples/_demo_polint_cheb2.*
;;
polint_eqdist)
cat examples/_demo_polint_eqdist.*
;;
polint_fit)
cat examples/_demo_polint_fit.*
;;
polint_gen)
cat examples/_demo_polint_gen.*
;;
ratint_fit)
cat examples/_demo_ratint_fit.*
;;
rcond_1)
cat examples/_demo_rcond_1.*
;;
spline1d_calc)
cat examples/_demo_spline1d_calc.*
;;
spline1d_cubic)
cat examples/_demo_spline1d_cubic.*
;;
spline1d_fit)
cat examples/_demo_spline1d_fit.*
;;
spline1d_fitc)
cat examples/_demo_spline1d_fitc.*
;;
spline1d_hermite)
cat examples/_demo_spline1d_hermite.*
;;
spline1d_linear)
cat examples/_demo_spline1d_linear.*
;;
minlbfgs_2)
cat examples/_demo_minlbfgs_2.*
;;
mincg_2)
cat examples/_demo_mincg_2.*
;;
mincg_1)
cat examples/_demo_mincg_1.*
;;
minasa_1)
cat examples/_demo_minasa_1.*
;;
minasa_2)
cat examples/_demo_minasa_2.*
;;
*)
echo unknown example
exit 1
;;
esac
exit 0
fi
cd _tmp
rm -f *
cd ..
case $1 in
gcc)
cp out/libalglib.a _tmp >> log.txt 2>> log.txt
if [ $? -ne 0 ] ; then
echo Error copying ALGLIB library. Did you ran build?
exit 1
fi
cp out/*.h _tmp >> log.txt 2>> log.txt
if [ $? -ne 0 ] ; then
echo Error copying ALGLIB library. Did you ran build?
exit 1
fi
;;
mingw)
cp out/libalglib.a _tmp >> log.txt 2>> log.txt
if [ $? -ne 0 ] ; then
echo Error copying ALGLIB library. Did you ran build?
exit 1
fi
cp out/*.h _tmp >> log.txt 2>> log.txt
if [ $? -ne 0 ] ; then
echo Error copying ALGLIB library. Did you ran build?
exit 1
fi
;;
*)
echo unknown compiler
exit 1
;;
esac
case $2 in
autogk_singular)
cp examples/_demo_autogk_singular.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
autogk_smooth)
cp examples/_demo_autogk_smooth.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minlbfgs_1)
cp examples/_demo_minlbfgs_1.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
lsfit_linear)
cp examples/_demo_lsfit_linear.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
lsfit_nonlinear)
cp examples/_demo_lsfit_nonlinear.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
lsfit_nonlinear2)
cp examples/_demo_lsfit_nonlinear2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minlm_fgh)
cp examples/_demo_minlm_fgh.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minlm_fgj)
cp examples/_demo_minlm_fgj.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minlm_fj)
cp examples/_demo_minlm_fj.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minlm_fj2)
cp examples/_demo_minlm_fj2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
mlp_process)
cp examples/_demo_mlp_process.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
mlp_process_cls)
cp examples/_demo_mlp_process_cls.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
mlp_randomize)
cp examples/_demo_mlp_randomize.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
mlp_serialize)
cp examples/_demo_mlp_serialize.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
ode_example1)
cp examples/_demo_ode_example1.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
ode_example2)
cp examples/_demo_ode_example2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
polint_cheb1)
cp examples/_demo_polint_cheb1.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
polint_cheb2)
cp examples/_demo_polint_cheb2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
polint_eqdist)
cp examples/_demo_polint_eqdist.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
polint_fit)
cp examples/_demo_polint_fit.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
polint_gen)
cp examples/_demo_polint_gen.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
ratint_fit)
cp examples/_demo_ratint_fit.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
rcond_1)
cp examples/_demo_rcond_1.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
spline1d_calc)
cp examples/_demo_spline1d_calc.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
spline1d_cubic)
cp examples/_demo_spline1d_cubic.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
spline1d_fit)
cp examples/_demo_spline1d_fit.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
spline1d_fitc)
cp examples/_demo_spline1d_fitc.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
spline1d_hermite)
cp examples/_demo_spline1d_hermite.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
spline1d_linear)
cp examples/_demo_spline1d_linear.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minlbfgs_2)
cp examples/_demo_minlbfgs_2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
mincg_2)
cp examples/_demo_mincg_2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
mincg_1)
cp examples/_demo_mincg_1.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minasa_1)
cp examples/_demo_minasa_1.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
minasa_2)
cp examples/_demo_minasa_2.cpp _tmp/_demo.cpp >> log.txt 2>> log.txt
;;
*)
echo unknown example
exit 1
;;
esac
case $1 in
gcc)
cd _tmp
gcc -I. -L. -o _demo *.cpp $3  -lalglib -lm -lstdc++ >> ../log.txt 2>> ../log.txt
if [ $? -ne 0 ] ; then
echo Error while compiling \(see ../log.txt for more info\)
exit 1
fi
cd ..
pushd _tmp > /dev/null
./_demo
popd > /dev/null
;;
mingw)
cd _tmp
g++ -I. -o _demo.exe $3 *.cpp  libalglib.a >> ../log.txt 2>> ../log.txt
if [ $? -ne 0 ] ; then
echo Error while compiling \(see ../log.txt for more info\)
exit 1
fi
cd ..
pushd _tmp > /dev/null
./_demo
popd > /dev/null
;;
*)
echo unknown compiler
exit 1
;;
esac
exit 0
