Commit d5bcaa7c authored by Laurent Belcour's avatar Laurent Belcour

Merge.

parents 29d2c03b 2d67a399
......@@ -103,4 +103,6 @@ plugins = env.SConscript('sources/plugins/SConscript')
softs = env.SConscript('sources/softs/SConscript')
#env.SConscript(dirs=['sources/core', 'sources/softs', 'sources/plugins'])
env.Depends(plugins, core)
env.Depends(softs, core)
#env.NoClean(external)
......@@ -4,6 +4,6 @@
# ${ALTA}/external/quadprog++ directory provided with the ALTA
# library. You need to have the env variable ALTA defined.
CONFIG _+= quadprog
CONFIG += quadprog
INCLUDEPATH += $$(ALTA)/external/quadprog++
LIBS += -L$$(ALTA)/external/build/lib -lquadprog++
......@@ -89,4 +89,4 @@ IPOPT_OPT_LIB = []
##
MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
MATLAB_LIB = ['eng', 'mex','mat']
MATLAB_LIB = ['eng', 'mx','mat']
......@@ -18,7 +18,7 @@ LINKFLAGS = []
##
CORE_LIB = ['dl']
SOFT_LIB = ['core', 'dl']
PLUGINSLIB = ['core']
PLUGIN_LIB = ['core']
## OpenMP flags
......@@ -85,4 +85,4 @@ IPOPT_OPT_LIB = []
##
MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
MATLAB_LIB = ['eng', 'mex','mat']
MATLAB_LIB = ['eng', 'mx','mat']
import os, sys
##----------------------------------------------------------------##
## This file describes required and optional arguments to ALTA ##
## compilation. If you want to manualy tune the use of an already ##
## present library, uncomment the according lines. ##
##----------------------------------------------------------------##
## Compilators build flags
##
CXX = 'cl'
CCFLAGS = []
LINKFLAGS = []
## ALTA internal flags
##
CORE_LIB = []
SOFT_LIB = ['core']
PLUGIN_LIB = ['core']
## OpenMP flags
##
OPENMP_FLAG = ['/openmp']
OPENMP_LIB = []
## OpenEXR library
##
OPENEXR_INC = ['/usr/include/OpenEXR']
OPENEXR_DIR = ['/usr/lib']
OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
## FLANN library
##
FLANN_INC = ['/usr/include/flann']
FLANN_DIR = ['/usr/lib/x86_64_linux-gnu']
FLANN_LIB = ['flann']
## QUADPROG library
##
## You have to specify the directory of the QuadProg library
##
QUADPROG_INC = ['#external/quadprog++']
QUADPROG_DIR = ['#external/build/lib']
QUADPROG_LIB = ['quadprog++']
## CERES library
##
## You have to specify both the directory of the CERES library
## and the glog library
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIB = ['ceres', 'glog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas']
## NlOpt library
##
## You have to specify the directory of the NlOpt library
##
NLOPT_INC = ['#external/build/include']
NLOPT_DIR = ['#external/build/lib']
NLOPT_LIB = ['nlopt']
NLOPT_OPT_LIB = []
## coin IpOpt library
##
## You have to specify the directory of the IpOpt library
##
IPOPT_INC = ['#external/build/include']
IPOPT_DIR = ['#external/build/lib']
IPOPT_LIB = ['ipopt']
IPOPT_OPT_LIB = []
## MATLAB library and Engine
##
MATLAB_INC = ['/Applications/MATLAB_R2014a.app/extern/include/']
MATLAB_DIR = ['/Applications/MATLAB_R2014a.app/bin/maci64/']
MATLAB_LIB = ['eng', 'mex','mat']
TEMPLATE = subdirs
SUBDIRS = quadprog++-v2
SUBDIRS = quadprog++ \
# quadprog++-v2
......@@ -153,12 +153,17 @@ std::ostream& operator<<(std::ostream& out, const timer& t)
unsigned int timer::current_time() const
{
#ifdef _WIN32
#if defined(_WIN32)
SYSTEMTIME res;
GetSystemTime(&res);
return (unsigned int)(res.wSecond + res.wMinute*60 + res.wHour*360);
#else
time_t _t = time(NULL);
return (unsigned int)_t;
#elif defined(__APPLE__)
struct timespec _time;
gettimeofday(&_time, NULL);
return (unsigned int)_time.tv_sec;
#else
struct timespec _time;
clock_gettime(CLOCK_MONOTONIC, &_time);
return (unsigned int)_time.tv_sec;
#endif
}
......@@ -276,6 +276,30 @@ template<typename T> bool isnan(T x)
{
return x==std::numeric_limits<T>::signaling_NaN();
}
template<typename T> T erf(T x)
{
// constants
const double a1 = 0.254829592;
const double a2 = -0.284496736;
const double a3 = 1.421413741;
const double a4 = -1.453152027;
const double a5 = 1.061405429;
const double p = 0.3275911;
// Save the sign of x
int sign = 1;
if (x < 0) {
sign = -1;
}
x = fabs(x);
// A&S formula 7.1.26
const double t = 1.0/(1.0 + p*x);
const double y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
return sign*y;
}
#endif
#ifdef _WIN32
......
......@@ -9,12 +9,14 @@ env.AppendUnique(CPPPATH = env['OPENEXR_INC'])
build_lib = False
conf = Configure(env)
if conf.CheckLib(env['OPENEXR_LIB']):
if conf.CheckLibWithHeader(env['OPENEXR_LIB'], 'ImfRgbaFile.h', 'c++'):
build_lib = True
#end
env = conf.Finish()
sources = ['data.cpp']
env.SharedLibrary('../../build/data_brdf_slice', sources)
if build_lib:
sources = ['data.cpp']
env.SharedLibrary('../../build/data_brdf_slice', sources)
#end
......@@ -7,6 +7,7 @@ cd ../alta-alpha
# Remove unecessary parts (data, retro plugins, ...)
rm -rf data
rm -rf papers
rm -rf external/quadprog++-v2
rm -rf sources/tests
rm -rf sources/matlab
rm -rf sources/xml
......
......@@ -67,7 +67,7 @@ int main(int argc, char** argv)
// Load a data file
if(args.is_defined("data") || args.is_defined("in-data"))
if(args.is_defined("data") || args.is_defined("data-file"))
{
ptr<data> d = plugins_manager::get_data(args["data"]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment