Commit e0302605 authored by Dr.李's avatar Dr.李

update linux libs

parent bcf2a1f1
......@@ -2,7 +2,6 @@
#define pfopt_linear_programming_optimizer_hpp
#include "types.hpp"
#include <vector>
#include "ClpSimplex.hpp"
namespace pfopt {
......@@ -16,14 +15,16 @@ namespace pfopt {
double* upperBound,
double* objective);
std::vector<double> xValue() const { return sol_; }
~LpOptimizer() { delete [] sol_;}
double* xValue() const { return sol_; }
double feval() const;
int status() const { return model_.status(); }
private:
ClpSimplex model_;
size_t numberOfProb_;
std::vector<double> sol_;
double* sol_;
};
}
......
......@@ -22,6 +22,8 @@ namespace pfopt {
double* varMatrix,
double riskAversion=1.);
virtual ~MeanVariance() { delete [] x_;}
bool setBoundedConstraint(const double* lb, const double* ub);
bool setLinearConstrains(int numCons, const double* consMatrix, const double* clb, const double* cub);
......@@ -54,7 +56,7 @@ namespace pfopt {
IpoptCalculatedQuantities *ip_cq);
double feval() const { return feval_; }
std::vector<double> xValue() const { return x_; }
double* xValue() const { return x_; }
private:
VectorXd expectReturn_;
......@@ -68,7 +70,7 @@ namespace pfopt {
const double* ub_;
VectorXd grad_f_;
double feval_;
std::vector<double> x_;
double* x_;
std::vector<Index> iRow_;
std::vector<Index> jCol_;
std::vector<double> g_grad_values_;
......
......@@ -18,7 +18,7 @@ namespace pfopt {
double *cub = nullptr,
double riskAversion = 1.);
std::vector<double> xValue() const { return mvImpl_->xValue(); }
double* xValue() const { return mvImpl_->xValue(); }
double feval() const { return mvImpl_->feval(); }
......
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