Skip to content

Cannot build the C++ library #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6285c9e
Update
pfernique Sep 26, 2017
c14afba
Update wrappers
pfernique Nov 7, 2017
79dbc44
Update recipe
pfernique Mar 20, 2018
049f29b
Update recipes
pfernique Mar 20, 2018
f27ac61
Update recipes
pfernique Mar 20, 2018
aef31a1
Update recipe
pfernique Mar 20, 2018
f281e3d
Update recipe
pfernique Mar 20, 2018
01687d1
Update recipe
pfernique Mar 21, 2018
063dd6d
Correct for Python 3
pfernique Mar 22, 2018
6cea85e
Update
pfernique Mar 23, 2018
1c1f2d2
Update
pfernique Mar 23, 2018
87745df
Update
pfernique Mar 26, 2018
1cb3dee
Update
pfernique Mar 30, 2018
4687695
Update recipe
pfernique Mar 31, 2018
b2a2e64
Update wrappers
pfernique Apr 1, 2018
f302364
Update
pfernique Apr 6, 2018
363e6d9
Update
pfernique Apr 10, 2018
90b713c
Update CIs
pfernique Apr 11, 2018
a4b66d5
Update CIs
pfernique Apr 11, 2018
89cb49c
Test wrappers
pfernique Apr 13, 2018
aa9b4b7
Update
pfernique Apr 13, 2018
0366d27
Update
pfernique Apr 13, 2018
3ccf614
Update
pfernique Apr 17, 2018
70b2d70
Update
pfernique Apr 17, 2018
87f518b
Update
pfernique Apr 17, 2018
fffd8da
Update
pfernique Apr 17, 2018
d73920a
Update
pfernique Apr 17, 2018
b1efa9b
Update
pfernique Apr 17, 2018
b599d27
UpdatE
pfernique Apr 17, 2018
6df2bf3
Update
pfernique Apr 17, 2018
6e1922a
Update
pfernique Apr 17, 2018
7738809
Update
pfernique Apr 17, 2018
a2f9a2c
Update
pfernique Apr 17, 2018
1cfa547
Update
pfernique Apr 18, 2018
a4a17d5
Update
pfernique Apr 18, 2018
f670ec7
Update
pfernique Apr 18, 2018
900781e
Update
pfernique Apr 18, 2018
0ed44c1
Update
pfernique Apr 18, 2018
7af09d1
Update
pfernique Apr 19, 2018
f7bcd53
Update
pfernique Apr 19, 2018
332dcdc
Update
pfernique Apr 19, 2018
0906770
Update
pfernique Apr 21, 2018
b711469
Update
pfernique Apr 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion TODO.rst

This file was deleted.

6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ platform:

environment:
matrix:
- CONDA_RECIPE: bin/conda/libstatiskit_core-dev
CONDA_VERSION: 2
- CONDA_RECIPE: bin/conda/libstatiskit_core-dev
CONDA_VERSION: 3
- CONDA_RECIPE: bin\conda\libstatiskit_core
- CONDA_RECIPE: bin\conda\python-statiskit_core
CONDA_VERSION: 2
# - CONDA_RECIPE: bin\conda\python-statiskit_core
# CONDA_VERSION: 2
- CONDA_RECIPE: bin\conda\python-statiskit_core
CONDA_VERSION: 3

Expand Down
2 changes: 1 addition & 1 deletion bin/conda/libstatiskit_core-dev/bld.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
echo ON

scons autowig --prefix=%LIBRARY_PREFIX% -j%CPU_COUNT% --autowig-no-wrappers
scons cpp-dev --prefix=%LIBRARY_PREFIX% -j%CPU_COUNT%
if errorlevel 1 exit 1

echo OFF
6 changes: 5 additions & 1 deletion bin/conda/libstatiskit_core-dev/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
set -ve

scons autowig --prefix=$PREFIX -j$CPU_COUNT --autowig-no-wrappers
if [[ ! ( "$(uname)" == "Linux" && "$PY3K" == "1" ) ]]; then
scons cpp-dev --prefix=$PREFIX -j$CPU_COUNT
else
scons autowig --prefix=$PREFIX -j$CPU_COUNT --autowig-no-wrappers
fi

set +ve
8 changes: 5 additions & 3 deletions bin/conda/libstatiskit_core-dev/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ source:

build:
number: 0
detect_binary_files_with_prefix: False

about:
home: http://statiskit-stl.readthedocs.org
license: Apache License 2.0
summary: C++ Development Files for Basic Utilities for Statistical Analyses
summary: C++ Development Files of Basic Utilities for Statistical Analyses

requirements:
build:
Expand All @@ -20,7 +21,8 @@ requirements:
- libtoolchain-dev
- libstatiskit_stl-dev
- libstatiskit_linalg-dev
- libboost_core-dev
run:
- python
- libstatiskit_stl-dev
- libstatiskit_linalg-dev
- libstatiskit_linalg-dev
- libboost_core-dev
7 changes: 5 additions & 2 deletions bin/conda/libstatiskit_core/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ about:
requirements:
build:
- libtoolchain
- libstatiskit_stl-dev
- libstatiskit_linalg-dev
- libstatiskit_core-dev
- libstatiskit_stl
- libstatiskit_linalg
- libboost_core-dev
run:
- libboost
- libstatiskit_stl
- libstatiskit_linalg
6 changes: 3 additions & 3 deletions bin/conda/python-statiskit_core/bld.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
echo ON

if "%PY3K%" == "1" (
2to3 -n -w %SRC_DIR%\src\py\autowig
2to3 -n -w %SRC_DIR%\test
if "%PY3K%" == "0" (
3to2 -n -w %SRC_DIR%\src\py\autowig -x str
3to2 -n -w %SRC_DIR%\test -x str
)

scons py --prefix=%LIBRARY_PREFIX% -j%CPU_COUNT% --arch=%ARCH%
Expand Down
6 changes: 3 additions & 3 deletions bin/conda/python-statiskit_core/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set -ve

if [[ "$PY3K" = "1" ]]; then
2to3 -n -w $SRC_DIR/src/py/statiskit
2to3 -n -w $SRC_DIR/test
if [[ "$PY3K" = "0" ]]; then
3to2 -n -w $SRC_DIR/src/py/statiskit -x str
3to2 -n -w $SRC_DIR/test -x str
fi

scons py --prefix=$PREFIX -j$CPU_COUNT
Expand Down
7 changes: 6 additions & 1 deletion bin/conda/python-statiskit_core/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ build:
about:
home: http://statiskit-core.readthedocs.io
license: Apache License 2.0
summary: A Python Interface from C++ Library of Basic Utilities for Statistical Analyses

requirements:
build:
- libtoolchain
- python-toolchain
- libboost_python-dev
- libboost_core-dev
- libstatiskit_core-dev
- libstatiskit_core
- libboost_python-dev
- libboost_python
- python
run:
- libboost_python
- libstatiskit_core
- python-statiskit_linalg
- python-statiskit_stl
Expand Down
40 changes: 0 additions & 40 deletions script.py

This file was deleted.

5 changes: 3 additions & 2 deletions src/cpp/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ Alias("autowig", targets)
Alias("install", targets)

wigenv = cppenv.Clone(tools = ['wig'])
wigenv.AppendUnique(CPPDEFINES=['EIGEN_NO_STATIC_ASSERT', 'AUTOWIG'])
targets = wigenv.BoostPythonWIG('statiskit_core', [target for target in targets if target.name.endswith('.h')],
module='../py/wrapper/_core.cpp',
decorator='../py/statiskit/core/_core.py',
parser_bootstrap=3,
parser_bootstrap=1,
controller='AutoWIG.py',
depends=['statiskit_linalg', 'statiskit_stl'])
depends=['statiskit_linalg'])
Alias("autowig", targets)
wigenv.Depends(targets, "cpp-dev")

Expand Down
4 changes: 3 additions & 1 deletion src/cpp/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace statiskit

/** Get the random generator
*
* The random generator used is the <a href="http://www.boost.org/doc/libs/1_60_0/doc/html/boost/random/mt19937.html">Mersenne Twister</a> random generator of the Boost.Random library
* The random generator used is the <a href="http://www.boost.org /doc/libs/1_60_0/doc/html/boost/random/mt19937.html">Mersenne Twister</a> random generator of the Boost.Random library
*/
STATISKIT_CORE_API boost::mt19937& get_random_generator();

Expand Down Expand Up @@ -200,5 +200,7 @@ namespace statiskit
namespace std { template<typename T, typename... Args> unique_ptr<T> make_unique(Args&&... args); }
#endif

#ifndef AUTOWIG
#include "base.hpp"
#endif
#endif
11 changes: 11 additions & 0 deletions src/cpp/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace statiskit
{
UnivariateData::~UnivariateData()
{}

Index UnivariateData::size() const
{
Index index = 0;
Expand Down Expand Up @@ -166,6 +169,9 @@ namespace statiskit
return maximum;
}

UnivariateData::Generator::~Generator()
{}

unsigned int NamedData::__index = 0;

NamedData::NamedData()
Expand Down Expand Up @@ -357,6 +363,9 @@ namespace statiskit
{ throw proxy_connection_error(); }
return 1;
}

MultivariateData::~MultivariateData()
{}

Index MultivariateData::size() const
{
Expand All @@ -382,6 +391,8 @@ namespace statiskit
return total;
}

MultivariateData::Generator::~Generator()
{}

MultivariateDataFrame::MultivariateDataFrame()
{
Expand Down
12 changes: 11 additions & 1 deletion src/cpp/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ namespace statiskit
typedef UnivariateEvent event_type;
typedef WeightedUnivariateData weighted_type;

virtual ~UnivariateData() = 0;

struct STATISKIT_CORE_API Generator
{
virtual ~Generator() = 0;

virtual bool is_valid() const = 0;

virtual Generator& operator++() = 0;
Expand Down Expand Up @@ -46,7 +50,7 @@ namespace statiskit
NamedData();
NamedData(const std::string& name);
NamedData(const NamedData& named_data);
~NamedData();
virtual ~NamedData();

const std::string& get_name() const;
void set_name(const std::string& name);
Expand Down Expand Up @@ -115,8 +119,12 @@ namespace statiskit
typedef MultivariateEvent event_type;
typedef WeightedMultivariateData weighted_type;

virtual ~MultivariateData() = 0;

struct STATISKIT_CORE_API Generator
{
virtual ~Generator() = 0;

virtual bool is_valid() const = 0;

virtual Generator& operator++() = 0;
Expand Down Expand Up @@ -608,5 +616,7 @@ namespace statiskit
};*/
}

#ifndef AUTOWIG
#include "data.hpp"
#endif
#endif
16 changes: 14 additions & 2 deletions src/cpp/distribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace statiskit
{
UnivariateDistribution::~UnivariateDistribution()
{}

double UnivariateDistribution::loglikelihood(const UnivariateData& data) const
{
double llh = 0.;
Expand Down Expand Up @@ -1355,10 +1358,10 @@ namespace statiskit
}

double LaplaceDistribution::ldf(const double& value) const
{ return abs(_mu - value) / _sigma - log(2*_sigma); }
{ return fabs(_mu - value) / _sigma - log(2*_sigma); }

double LaplaceDistribution::pdf(const double& value) const
{ return 0.5 * exp( abs(_mu - value) / _sigma) / _sigma; }
{ return 0.5 * exp(fabs(_mu - value) / _sigma) / _sigma; }

double LaplaceDistribution::cdf(const double& value) const
{
Expand Down Expand Up @@ -1994,6 +1997,12 @@ namespace statiskit
return llh;
}

UnivariateConditionalDistribution::~UnivariateConditionalDistribution()
{}

MultivariateDistribution::~MultivariateDistribution()
{}

double MultivariateDistribution::loglikelihood(const MultivariateData& data) const
{
double llh = 0.;
Expand Down Expand Up @@ -2301,6 +2310,9 @@ namespace statiskit
return p;
}

MultivariateConditionalDistribution::~MultivariateConditionalDistribution()
{}

double MultivariateConditionalDistribution::loglikelihood(const MultivariateConditionalData& data) const
{
double llh = 0.;
Expand Down
20 changes: 11 additions & 9 deletions src/cpp/distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace statiskit
{
typedef UnivariateData data_type;

virtual ~UnivariateDistribution() = 0;

/// \brief Get the number of parameters of the distribution.
virtual unsigned int get_nb_parameters() const = 0;

Expand Down Expand Up @@ -1982,6 +1984,8 @@ namespace statiskit
{
typedef UnivariateDistribution response_type;

virtual ~UnivariateConditionalDistribution() = 0;

/// \Brief This is an operation of conditioning that returns the conditional distribution \f$ Y \vert \boldsymbol{X} = \boldsymbol{x} \f$.
virtual const UnivariateDistribution* operator() (const MultivariateEvent& event) const = 0;

Expand Down Expand Up @@ -2013,6 +2017,8 @@ namespace statiskit
typedef MultivariateData data_type;
typedef UnivariateDistribution marginal_type;

virtual ~MultivariateDistribution() = 0;

/// \brief Get the number of components of the distribution.
virtual Index get_nb_components() const = 0;

Expand Down Expand Up @@ -2153,27 +2159,21 @@ namespace statiskit
typedef IndependentMultivariateDistribution< DiscreteMultivariateDistribution > DiscreteIndependentMultivariateDistribution;
typedef IndependentMultivariateDistribution< ContinuousMultivariateDistribution > ContinuousIndependentMultivariateDistribution;*/

/** \Brief This class MultivariateConditionalDistribution represents the conditional distribution \f$ Y \vert \boldsymbol{X} \f$ of an univariate random component \f$ Y\f$ given a multivariate component \f$ \boldsymbol{X} \f$.
*
*/

struct STATISKIT_CORE_API MultivariateConditionalDistribution
{
typedef MultivariateDistribution response_type;

virtual ~MultivariateConditionalDistribution() = 0;

virtual Index get_nb_components() const = 0;

/// \Brief This is an operation of conditioning that returns the conditional distribution \f$ Y \vert \boldsymbol{X} = \boldsymbol{x} \f$.
virtual const MultivariateDistribution* operator() (const MultivariateEvent& event) const = 0;

double loglikelihood(const MultivariateConditionalData& data) const;

/// \Brief Get the sample space of the response component \f$ Y \f$.
//virtual std::unique_ptr< MultivariateSampleSpace > get_response_space() const = 0;

/// \Brief Get the sample space of the explanatory components \f$ \boldsymbol{X} \f$.
virtual const MultivariateSampleSpace* get_explanatory_space() const = 0;

/// \Brief Get the number of parameters of the \f$ Y \vert \boldsymbol{X} \f$.
virtual unsigned int get_nb_parameters() const = 0;

virtual std::unique_ptr< MultivariateConditionalDistribution > copy() const = 0;
Expand Down Expand Up @@ -2331,5 +2331,7 @@ namespace statiskit
typedef std::vector< ContinuousMultivariateDistribution* > ContinuousMultivariateDistributionVector;
}

#ifndef AUTOWIG
#include "distribution.hpp"
#endif
#endif
Loading