Subject: CGAL users discussion list
List archive
- From: William Taysom <>
- To:
- Subject: [cgal-discuss] Segmentation fault from Quadratic (and Linear) Program
- Date: Tue, 10 Jan 2012 23:13:39 +0800
Hello,
I recently found a small example quadratic program (actually the objective is
linear) which causes a segmentation fault. The basic setup is as follows and
a complete test file is attached.
== qp_segault (excerpt) ==
const int X = 0;
const int Y = 1;
const int Z = 2;
Quadratic_program<NT> qp;
void set_row(int i, NT x, NT y, NT z, Comparison_result rel, NT b) {
qp.set_a(X, i, x);
qp.set_a(Y, i, y);
qp.set_a(Z, i, z);
qp.set_r(i, rel);
qp.set_b(i, b);
}
int main() {
// Just try to minimize X
// though the objective function doesn't make a difference.
qp.set_c(X, 1);
set_row(0, 1, 1, 1, EQUAL, 4);
set_row(1, 1, 1, 1, LARGER, 4);
set_row(2, 1, 0, 1, LARGER, 3);
set_row(3, 1, 1, 0, LARGER, 3);
qp.set_u(X, true, 2);
Quadratic_program_solution<ET> sol;
sol = solve_quadratic_program(qp, ET());
std::cout << sol;
}
==
Pretty much any change to the problem setup removes the segfault, but changes
to the objective function, solution function, number type, and options do not.
I'm new to CGAL, and I've been very pleased with the API so far. I hope we
can work together to find the root cause of this segfault.
Best regards,
William
Attachment:
qp_segfault.cpp
Description: Binary data
- [cgal-discuss] Segmentation fault from Quadratic (and Linear) Program, William Taysom, 01/10/2012
- AW: [cgal-discuss] Segmentation fault from Quadratic (and Linear) Program, Gärtner Bernd, 01/11/2012
- Re: [cgal-discuss] Segmentation fault from Quadratic (and Linear) Program, William Taysom, 01/12/2012
- AW: [cgal-discuss] Segmentation fault from Quadratic (and Linear) Program, Gärtner Bernd, 01/11/2012
Archive powered by MHonArc 2.6.16.