Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/adshhzy/VIPSS
21 September 2020, 16:04:55 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 0dac218
  • /
  • vipss
  • /
  • src
  • /
  • Solver.h
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:e9239aa50f818be94b9f4ef2e32274b64a5244c6
origin badgedirectory badge
swh:1:dir:7e1fab2418cee550a6d1ceff4920914118a821a7
origin badgerevision badge
swh:1:rev:2717c4ad8edd0fc8552b437512b165a14185b617
origin badgesnapshot badge
swh:1:snp:416b2d138b45cb2802453235f1dabd6b268aa79a

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 2717c4ad8edd0fc8552b437512b165a14185b617 authored by adshhzy on 27 March 2020, 01:18:20 UTC
Delete deprecated code in surfacer
Tip revision: 2717c4a
Solver.h
#ifndef SOLVER_H
#define SOLVER_H


#include <iostream>
#include <vector>
#include <armadillo>
#include <nlopt.hpp>


using namespace std;

enum ConstraintMethod{
    CM_EQUAL,
    CM_LESS,
    CM_GREATER,
    CM_RANGE
};


struct triple{
    int i;
    int j;
    double val;
    triple(int i,int j,double val):i(i),j(j),val(val){}
};

struct LinearVec{

    vector<int>ts;
    vector<double>ws;
    double a;
    double b;
    int label;
    ConstraintMethod mt;


    LinearVec(){}
    LinearVec(int label):label(label){}
    void clear();
    void push_back(int t, double w);
    void set_label(int label);
    void set_ab(double a, double b);
};

struct QuadraticVec{

    vector<triple>ts;
    double b;
    ConstraintMethod mt;

    QuadraticVec(){}
    QuadraticVec(vector<triple>&ts, double b):ts(ts),b(b){}

    void push_back(int i,int j,double val);
    void set_b(double b);
    void clear();
};

struct NLOptConstraint{
    nlopt::vfunc constraintfunc;
    ConstraintMethod mt;
    void *data;

};


struct Solution_Struct{
    int Statue;
    double init_energy;
    double energy;
    double time;
    vector<double>solveval;
    arma::vec solvec_arma;

    Solution_Struct():init_energy(-1),energy(-1){}
    void init(int n);
};

class Solver{


public:

//    GRBEnv objenv;
//    GRBModel objmodel;

//    vector<GRBVar>c_vars;

public:
//    Solver():objenv(GRBEnv()),objmodel(GRBModel(objenv)){

//        objmodel.getEnv().set(GRB_IntParam_OutputFlag, 0);

//    }

    Solver(){}


public:


//    static int solveQuadraticProgramming(vector<triple> &M, vector<triple> &Ab,int n, vector<double>&solveval);

//    static int solveQuadraticProgramming(vector<triple> &M, vector<LinearVec> &Ab,int n, vector<double>&solveval);
//    static int solveQuadraticProgramming(arma::mat &M, vector<LinearVec> &Ab,int n, Solution_Struct &sol);


//    static int solveLinearLS(vector<triple> &M, vector<double> &b, int n, vector<double>&solveval);

//    static int solveQCQP(arma::mat &M, vector<LinearVec> &Ab, vector<QuadraticVec> &Cb, int n, Solution_Struct &sol);

    //int solveQP_multiupdata_main(Solution_Struct &sol, vector<LinearVec> &Ab, int n, bool suppressinfo = true);
    //int solveQP_multiupdata_init(arma::mat &M, int n);



    static int nloptwrapper(vector<double>&lowerbound,
                   vector<double>&upperbound,
                   nlopt::vfunc optfunc,
                   void *funcPara,
                   vector<NLOptConstraint>&nl_constraints,
                   double tor,
                   int maxIter,
                   Solution_Struct &sol
                   );

    static int nloptwrapper(vector<double>&lowerbound,
                   vector<double>&upperbound,
                   nlopt::vfunc optfunc,
                   void *funcPara,
                   double tor,
                   int maxIter,
                   Solution_Struct &sol
                   );

};




















#endif // SOLVER_H

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API