QuadraticProgrammingSolver.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_QUADRATICPROGRAMMINGSOLVER_HPP
2 #define JULIAN_QUADRATICPROGRAMMINGSOLVER_HPP
3 
4 #include <armadillo>
5 #include <vector>
6 #include <utils/utils.hpp>
7 
8 
9 namespace julian {
10 
37  public:
39 
40  void setQuadraticTerm(const arma::mat& );
41  void setLinearTerm(const arma::mat& );
42 
43  void setEqualityConstrainsMatrix(const arma::mat& );
44  void setEqualityConstrainsVector(const arma::mat& );
45 
46  void setNonEqualityConstrainsMatrix(const arma::mat&);
47  void setNonEqualityConstrainsLowerVector(const arma::mat&);
48  void setNonEqualityConstrainsUpperVector(const arma::mat&);
49 
50  void setArgumentLowerConstrains(const arma::mat& );
51  void setArgumentUpperConstrains(const arma::mat& );
52 
53  void setInfo(const bool input);
54 
55  arma::mat solve();
56 
57  private:
58  void MatrixToArray(int*,int*,double*,const arma::mat&);
59  void SymetricMatrixToArray(int*,int*,double*,const arma::mat&);
60  void Matrix1dToArray(double*,const arma::mat&);
61 
62  arma::mat quadratic_term_;
63  arma::mat linear_term_;
75  bool silent_;
76  };
77 }
78 
79 // The following is a notice of limited availability of this software and disclaimer which must be included as a preface to the software,
80 // in all source listings of the code, and in any supporting documentation.
81 // COPYRIGHT 2001 UNIVERSITY OF CHICAGO
82 // The copyright holder hereby grants you royalty-free rights to use, reproduce, prepare derivative works, and to redistribute this software to others, provided that any changes are clearly documented.
83 // This software was authored by:
84 
85 // E. MICHAEL GERTZ gertz@mcs.anl.gov
86 // Mathematics and Computer Science Division
87 // Argonne National Laboratory
88 // 9700 S. Cass Avenue
89 // Argonne, IL 60439-4844
90 // STEPHEN J. WRIGHT swright@cs.wisc.edu
91 // Department of Computer Sciences
92 // University of Wisconsin
93 // 1210 West Dayton Street
94 // Madison, WI 53706 FAX: (608)262-9777
95 // Any questions or comments may be directed to one of the authors.
96 
97 // ARGONNE NATIONAL LABORATORY (ANL), WITH FACILITIES IN THE STATES OF ILLINOIS AND IDAHO, IS OWNED BY THE UNITED STATES GOVERNMENT, AND OPERATED BY THE UNIVERSITY OF CHICAGO UNDER PROVISION OF A CONTRACT WITH THE DEPARTMENT OF ENERGY.
98 #endif
99 
void Matrix1dToArray(double *, const arma::mat &)
Column matrix adapter.
Definition: QuadraticProgrammingSolver.cpp:307
bool silent_
If true solve function prints status of each iteration.
Definition: QuadraticProgrammingSolver.hpp:75
arma::mat non_equality_constrains_upper_vector_
Vector d.
Definition: QuadraticProgrammingSolver.hpp:70
void setEqualityConstrainsMatrix(const arma::mat &)
Sets matrix E.
Definition: QuadraticProgrammingSolver.cpp:30
Definition: cadHoliday.cpp:3
arma::mat quadratic_term_
Matrix Q, representing the quadratic term of cost function.
Definition: QuadraticProgrammingSolver.hpp:62
arma::mat linear_term_
Matrix L, representing the linear term of cost function.
Definition: QuadraticProgrammingSolver.hpp:63
void setLinearTerm(const arma::mat &)
Sets vector L.
Definition: QuadraticProgrammingSolver.cpp:22
File contains small programming tools.
void setNonEqualityConstrainsMatrix(const arma::mat &)
Sets matrix N.
Definition: QuadraticProgrammingSolver.cpp:46
arma::mat solve()
Solves quadratic problem.
Definition: QuadraticProgrammingSolver.cpp:96
void SymetricMatrixToArray(int *, int *, double *, const arma::mat &)
Symetric matrix adapter.
Definition: QuadraticProgrammingSolver.cpp:283
void setArgumentUpperConstrains(const arma::mat &)
Sets vector f.
Definition: QuadraticProgrammingSolver.cpp:78
arma::mat non_equality_constrains_lower_vector_
Vector c.
Definition: QuadraticProgrammingSolver.hpp:69
arma::mat equality_constrains_matrix_
Matrix E, representing an equality constrain.
Definition: QuadraticProgrammingSolver.hpp:65
void setArgumentLowerConstrains(const arma::mat &)
Sets vector e.
Definition: QuadraticProgrammingSolver.cpp:70
arma::mat argument_lower_constrains_
Vector e.
Definition: QuadraticProgrammingSolver.hpp:72
arma::mat argument_upper_constrains_
Vector f.
Definition: QuadraticProgrammingSolver.hpp:73
Quadratic Programming Solver.
Definition: QuadraticProgrammingSolver.hpp:36
void setEqualityConstrainsVector(const arma::mat &)
Sets vector b.
Definition: QuadraticProgrammingSolver.cpp:38
void setInfo(const bool input)
Sets silent_ variable.
Definition: QuadraticProgrammingSolver.cpp:87
arma::mat equality_constrains_vector_
Vector b.
Definition: QuadraticProgrammingSolver.hpp:66
void setQuadraticTerm(const arma::mat &)
Sets matrix Q.
Definition: QuadraticProgrammingSolver.cpp:14
void MatrixToArray(int *, int *, double *, const arma::mat &)
Matrix adapter.
Definition: QuadraticProgrammingSolver.cpp:317
void setNonEqualityConstrainsUpperVector(const arma::mat &)
Sets vector d.
Definition: QuadraticProgrammingSolver.cpp:62
void setNonEqualityConstrainsLowerVector(const arma::mat &)
Sets vector c.
Definition: QuadraticProgrammingSolver.cpp:54
arma::mat non_equality_constrains_matrix_
Matrix N, representing an non-equality constrain.
Definition: QuadraticProgrammingSolver.hpp:68