You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to specify a very simple program (here it is actually not even specified, the containers are just setup) that has no constraints. You can see that I tried to make the constraint matrices have zero rows:
Eigen::MatrixXd Ci(n,0);
and the constraint vectors have zero length:
int zero = 0;
Eigen::VectorXd ce(zero);
Here is the code, but when I run it I get:
QPDemo: /home/doriad/src/QP/eigen/Eigen/src/Core/Matrix.h:235: Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Index) [with _Scalar = double; int _Rows = -1; int _Cols = 1; int _Options = 0; int _MaxRows = -1; int _MaxCols = 1; Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Index = long int]: Assertion `dim > 0' failed.
Can you please let me know how to specify a problem with no constraints?
include
include "uQuadProg++.hh"
include <Eigen/Eigen>
include <EigenQP.h>
int main (int argc, char *const argv[])
{
int n = 2;
Eigen::MatrixXd G(n,n);
Eigen::MatrixXd Ci(n,0);
Eigen::MatrixXd Ce(n,0);
Eigen::VectorXd g0(n);
int zero = 0;
Eigen::VectorXd ce(zero);
Eigen::VectorXd ci(zero);
Eigen::VectorXd x(n);
I tried to specify a very simple program (here it is actually not even specified, the containers are just setup) that has no constraints. You can see that I tried to make the constraint matrices have zero rows:
Eigen::MatrixXd Ci(n,0);
and the constraint vectors have zero length:
int zero = 0;
Eigen::VectorXd ce(zero);
Here is the code, but when I run it I get:
QPDemo: /home/doriad/src/QP/eigen/Eigen/src/Core/Matrix.h:235: Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Index) [with _Scalar = double; int _Rows = -1; int _Cols = 1; int _Options = 0; int _MaxRows = -1; int _MaxCols = 1; Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Index = long int]: Assertion `dim > 0' failed.
Can you please let me know how to specify a problem with no constraints?
include
include "uQuadProg++.hh"
include <Eigen/Eigen>
include <EigenQP.h>
int main (int argc, char *const argv[])
{
int n = 2;
Eigen::MatrixXd G(n,n);
Eigen::MatrixXd Ci(n,0);
Eigen::MatrixXd Ce(n,0);
Eigen::VectorXd g0(n);
int zero = 0;
Eigen::VectorXd ce(zero);
Eigen::VectorXd ci(zero);
Eigen::VectorXd x(n);
double objectiveValue = QP::solve_quadprog(G, g0, Ce, ce, Ci, ci, x);
std::cout << "objectiveValue: " << objectiveValue << std::endl;
std::cout <<"Solution:" << std::endl << x << std::endl;
}
The text was updated successfully, but these errors were encountered: