55 #include <Eigen/Dense> 60 using namespace Eigen;
62 template<
typename Vec,
typename Mat>
void foo() {
72 G(0,0)=2.1; G(0,1)=0.0; G(0,2)=1.0;
73 G(1,0)=1.5; G(1,1)=2.2; G(1,2)=0.0;
74 G(2,0)=1.2; G(2,1)=1.3; G(2,2)=3.1;
77 g0(0)=6.0; g0(1)=1.0; g0(2)=1.0;
85 CI(0,0)=1.0; CI(0,1)=0.0;CI(0,2)=0.0; CI(0,3)=-1.0;
86 CI(1,0)=0.0; CI(1,1)=1.0;CI(1,2)=0.0; CI(1,3)=-1.0;
87 CI(2,0)=0.0; CI(2,1)=0.0;CI(2,2)=1.0; CI(2,3)=0.0;
90 ci0(0)=0.0; ci0(1)=0.0;ci0(2)=0.0; ci0(3)=10.0;
95 std::cout << std::endl;
97 for (
int i = 0; i < x.size(); i++)
98 std::cout << x(i) <<
' ';
99 std::cout << std::endl;
116 g0[0]=6.0; g0[1]=1.0; g0[2]=1.0;
124 G[0]=2.1; G[3]=0.0; G[6]=1.0;
125 G[1]=1.5; G[4]=2.2; G[7]=0.0;
126 G[2]=1.2; G[5]=1.3; G[8]=3.1;
128 CI[0]=1.0; CI[3]=0.0; CI[6]=0.0; CI[9]=-1.0;
129 CI[1]=0.0; CI[4]=1.0; CI[7]=0.0; CI[10]=-1.0;
130 CI[2]=0.0; CI[5]=0.0; CI[8]=1.0; CI[11]=0.0;
132 ci0[0]=0.0; ci0[1]=0.0; ci0[2]=0.0; ci0[3]=10.0;
134 double ce_err[ce_len] ;
135 double ci_err[ci_len] ;
137 x_len, ce_len, ci_len, 1e-1,
138 2, ret_buf, ce_err, ci_err) ;
141 int main(
int argc,
char** argv){
143 foo<Eigen::VectorXd, MatrixXd>();
144 std::cout <<
"----------------------------" << std::endl ;
double solve_quadprog(MatrixXd &G, VectorXd &g0, const MatrixXd &CE, const VectorXd &ce0, const MatrixXd &CI, const VectorXd &ci0, VectorXd &x)
double * solve_eiquadprog(double *G, double *g0, double *CE, double *ce0, double *CI, double *ci0, double *x, int x_len, int ce_len, int ci_len, double eqthre, int debug, double *ret_buf, double *ce_err, double *ci_err)
int main(int argc, char **argv)