I'm new to Eigen and I'd like to use Eigen for solving linear least squares systems with bounds. The example on Eigen's site is straightforward but I'm not sure how to set bounds for the solution.
Here's the example code:
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3, 2);
cout << "Here is the matrix A:\n" << A << endl;
VectorXf b = VectorXf::Random(3);
cout << "Here is the right hand side b:\n" << b << endl;
cout << "The least-squares solution is:\n"
<< A.bdcSvd(ComputeThinU | ComputeThinV).solve(b) << endl;
}
It's solving Ax=b. I'm looking for the solution where x is bounded. For example I'm looking for the best solution of Ax=b such that 0 < x < 1. What's the proper way to do this?