Skip to content

Commit

Permalink
temporary turned off GPL flag for QP solver
Browse files Browse the repository at this point in the history
  • Loading branch information
lambday authored and karlnapf committed Jul 1, 2016
1 parent d120e78 commit 466e915
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/shogun/statistical_testing/internals/OptimizationSolver.cpp
Expand Up @@ -16,17 +16,17 @@
#include <shogun/mathematics/Math.h>
#include <shogun/statistical_testing/internals/OptimizationSolver.h>

#ifdef USE_GPL_SHOGUN
//#ifdef USE_GPL_SHOGUN
#include <shogun/lib/external/libqp.h>
#endif // USE_GPL_SHOGUN
//#endif // USE_GPL_SHOGUN

using namespace shogun;
using namespace internal;

struct OptimizationSolver::Self
{
Self(SGVector<float64_t> mmds, SGMatrix<float64_t> Q);
#ifdef USE_GPL_SHOGUN
//#ifdef USE_GPL_SHOGUN
SGVector<float64_t> solve() const;
void init();
static const float64_t* get_Q_col(uint32_t i);
Expand All @@ -37,19 +37,23 @@ struct OptimizationSolver::Self
float64_t opt_low_cut;
SGVector<float64_t> m_mmds;
static SGMatrix<float64_t> m_Q;
#endif // USE_GPL_SHOGUN
//#endif // USE_GPL_SHOGUN
};

//#ifdef USE_GPL_SHOGUN
SGMatrix<float64_t> OptimizationSolver::Self::m_Q=SGMatrix<float64_t>();
//#endif // USE_GPL_SHOGUN

OptimizationSolver::Self::Self(SGVector<float64_t> mmds, SGMatrix<float64_t> Q)
{
#ifdef USE_GPL_SHOGUN
//#ifdef USE_GPL_SHOGUN
m_Q=Q;
m_mmds=mmds;
init();
#endif // USE_GPL_SHOGUN
//#endif // USE_GPL_SHOGUN
}

#ifdef USE_GPL_SHOGUN
//#ifdef USE_GPL_SHOGUN
void OptimizationSolver::Self::init()
{
opt_max_iterations=10000;
Expand Down Expand Up @@ -136,7 +140,7 @@ SGVector<float64_t> OptimizationSolver::Self::solve() const
}
return weights;
}
#endif // USE_GPL_SHOGUN
//#endif // USE_GPL_SHOGUN

OptimizationSolver::OptimizationSolver(const SGVector<float64_t>& mmds, const SGMatrix<float64_t>& Q)
{
Expand All @@ -149,10 +153,10 @@ OptimizationSolver::~OptimizationSolver()

SGVector<float64_t> OptimizationSolver::solve() const
{
#ifdef USE_GPL_SHOGUN
//#ifdef USE_GPL_SHOGUN
return self->solve();
#else // USE_GPL_SHOGUN
SG_SWARNING("Presently this feature is only available with GNU GPLv3 license!");
return SGVector<float64_t>();
#endif // USE_GPL_SHOGUN
//#else // USE_GPL_SHOGUN
// SG_SWARNING("Presently this feature is only available with GNU GPLv3 license!");
// return SGVector<float64_t>();
//#endif // USE_GPL_SHOGUN
}

0 comments on commit 466e915

Please sign in to comment.