Building igl statically and moving to the dep scripts

Fixing dep build script on Windows and removing some warnings.

Use bundled igl by default.

Not building with the dependency scripts if not explicitly stated. This way, it will stay in
Fix the libigl patch to include C source files in header only mode.
This commit is contained in:
tamasmeszaros
2019-06-19 14:52:55 +02:00
parent 89e39e3895
commit 2ae2672ee9
1095 changed files with 181 additions and 5 deletions

59
src/libigl/igl/pso.h Normal file
View File

@@ -0,0 +1,59 @@
#ifndef IGL_PSO_H
#define IGL_PSO_H
#include <igl/igl_inline.h>
#include <Eigen/Core>
#include <functional>
namespace igl
{
// Solve the problem:
//
// minimize f(x)
// subject to lb ≤ x ≤ ub
//
// by particle swarm optimization (PSO).
//
// Inputs:
// f function that evaluates the objective for a given "particle" location
// LB #X vector of lower bounds
// UB #X vector of upper bounds
// max_iters maximum number of iterations
// population number of particles in swarm
// Outputs:
// X best particle seen so far
// Returns objective corresponding to best particle seen so far
template <
typename Scalar,
typename DerivedX,
typename DerivedLB,
typename DerivedUB>
IGL_INLINE Scalar pso(
const std::function< Scalar (DerivedX &) > f,
const Eigen::MatrixBase<DerivedLB> & LB,
const Eigen::MatrixBase<DerivedUB> & UB,
const int max_iters,
const int population,
DerivedX & X);
// Inputs:
// P whether each DOF is periodic
template <
typename Scalar,
typename DerivedX,
typename DerivedLB,
typename DerivedUB,
typename DerivedP>
IGL_INLINE Scalar pso(
const std::function< Scalar (DerivedX &) > f,
const Eigen::MatrixBase<DerivedLB> & LB,
const Eigen::MatrixBase<DerivedUB> & UB,
const Eigen::DenseBase<DerivedP> & P,
const int max_iters,
const int population,
DerivedX & X);
}
#ifndef IGL_STATIC_LIBRARY
# include "pso.cpp"
#endif
#endif