Login
Login

Reply To: Constrained Optimization

Home 21090308 Forums Numerical Method Optimization Constrained Optimization Reply To: Constrained Optimization

#2818
hao.ding
Member

Hi,

q1+q2+…+qn<=1 is a linear constraints, you can construct such a linear constraint in SuanShu use the following codes: Matrix A = new DenseMatrix(1, n); for (int i = 1; i <= n; i++) { A.set(1, i, 1.); } //A = [1,1,...,1] Vector b = new DenseVector(1.); // b = [1] LinearLessThanConstraints less = new LinearLessThanConstraints(A, b);