Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Reg. product of variables in objective function

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Reg. product of variables in objective function


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Reg. product of variables in objective function
  • Date: Mon, 8 May 2023 08:54:19 +0200 (CEST)
  • Authentication-results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail ; dmarc=fail (p=none dis=none) d=inria.fr

On Wed, 3 May 2023, Ashish Kashinath wrote:

Hi, I was trying to understand the quadratic programming example given in
the repo : first_qp.cpp
<https://doc.cgal.org/latest/QP_solver/QP_solver_2first_qp_8cpp-example.html>
The example here uses the objective function: (x^2 + 4*y^2 -32*y + 64), and
uses set_d( ) and set_c( ) functions to setup the objective function

My question is this : What if the objective function contained a term that
is the product of the two variables such as this : (x^2 + 4*y^2 -32*y + 64
+ xy) ?
How can I use set_d( ) in such a case? How would the coefficients need to
be setup?

(up to a factor 2)

qp.set_d(X, X, 2);

represents X*X*2

qp.set_d (Y, Y, 8);

represents Y*Y*8

https://doc.cgal.org/latest/QP_solver/classCGAL_1_1Quadratic__program.html#a2b598d11d1d6daff9d20e43dc586257d
says
"sets the entries 2Dij and 2Dji of qp to val."

How about qp.set_d (Y, X, 84); ?

--
Marc Glisse



Archive powered by MHonArc 2.6.19+.

Top of Page