-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize the rounding loop and support sparse computations in preprocessing routines #312
Changes from all commits
911e030
85b1faf
b3f75ba
7e66e8c
5df7093
d50b4cd
6051ebc
e27854b
25a39b1
4168002
960969c
da7348d
035cfe8
9b72f5f
11b4948
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -638,6 +638,12 @@ class OrderPolytope { | |
return false; | ||
} | ||
|
||
// Apply linear transformation, of square matrix T^{-1}, in H-polytope P:= Ax<=b | ||
// This is most of the times for testing reasons because it might destroy the sparsity | ||
void linear_transformIt(MT const& T) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should follow naming conventions here, so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
_A = _A * T; | ||
} | ||
|
||
// shift polytope by a point c | ||
void shift(VT const& c) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// VolEsti (volume computation and sampling library) | ||
|
||
// Copyright (c) 2024 Vissarion Fisikopoulos | ||
// Copyright (c) 2024 Apostolos Chalkis | ||
// Copyright (c) 2024 Elias Tsigaridas | ||
|
||
// Licensed under GNU LGPL.3, see LICENCE file | ||
|
||
|
||
#ifndef FEASIBLE_POINT_HPP | ||
#define FEASIBLE_POINT_HPP | ||
|
||
#include <tuple> | ||
|
||
#include "preprocess/max_inscribed_ball.hpp" | ||
|
||
// Using MT as to deal with both dense and sparse matrices | ||
template <typename MT, typename VT> | ||
VT compute_feasible_point(MT const& A, VT const& b) | ||
{ | ||
VT x; | ||
bool feasibility_only = true, converged; | ||
unsigned max_iters = 10000; | ||
// Compute a feasible point | ||
std::tie(x, std::ignore, converged) = max_inscribed_ball(A, b, max_iters, 1e-08, feasibility_only); | ||
if (!converged || ((A * x).array() > b.array()).any()) | ||
{ | ||
std::runtime_error("The computation of a feasible point failed."); | ||
} | ||
return x; | ||
} | ||
|
||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better
to consume only 2 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done