Skip to content
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

ReHMC support for spectrahedra and general convex bodies with refactored Spectrahedra classes #194

Merged
merged 69 commits into from
Jan 4, 2022

Conversation

papachristoumarios
Copy link
Collaborator

@codecov
Copy link

codecov bot commented Dec 12, 2021

Codecov Report

Merging #194 (b7f7c3a) into develop (c9cc0ec) will decrease coverage by 0.39%.
The diff coverage is 2.32%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #194      +/-   ##
===========================================
- Coverage    55.83%   55.44%   -0.40%     
===========================================
  Files           64       85      +21     
  Lines         3845     4801     +956     
  Branches      1687     2107     +420     
===========================================
+ Hits          2147     2662     +515     
- Misses         732      889     +157     
- Partials       966     1250     +284     
Impacted Files Coverage Δ
include/SDPAFormatManager.h 0.00% <0.00%> (ø)
include/convex_bodies/convex_body.h 0.00% <0.00%> (ø)
include/convex_bodies/spectrahedra/LMI.h 0.00% <0.00%> (ø)
include/convex_bodies/spectrahedra/spectrahedron.h 0.00% <0.00%> (ø)
include/convex_bodies/vpolyintersectvpoly.h 70.66% <ø> (ø)
include/convex_bodies/vpolytope.h 56.54% <ø> (ø)
include/convex_bodies/zpolytope.h 50.00% <ø> (ø)
include/diagnostics/print_diagnostics.hpp 0.00% <0.00%> (ø)
include/generators/convex_bodies_generator.h 0.00% <0.00%> (ø)
include/matrix_operations/EigenvaluesProblems.h 0.00% <0.00%> (ø)
... and 35 more

Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! I have some comments.

Regarding coverage I think you should ask more tests to cover your code, then codecov will not complain.

Also, do you agree to merge #190 before this PR? Then your examples here could be simplified.


// get the minimum positive eigenvalue of At^2 + Bt + C
EigenvaluesProblems<NT, MT, VT> quadraticEigenvaluesProblem;
NT distance = quadraticEigenvaluesProblem.minPosQuadraticEigenvalue(precomputedValues.A, precomputedValues.B,
NT distance = EigenvaluesProblem.minPosQuadraticEigenvalue(precomputedValues.A, precomputedValues.B,
precomputedValues.C, precomputedValues.X,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation seems wrong after this

struct PrecomputationOfValues {

/// These flags indicate whether the corresponding matrices are computed
/// if yes, we can use them and not compute them fro scratch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I understand that the use of flags is not the intent of this PR but why not including a TODO in the comments to avoid the use of flags in the future?

@@ -28,6 +28,8 @@ void print_diagnostics(MT const& samples, unsigned int &min_ess, StreamType &str
VT ess = effective_sample_size<NT, VT, MT>(samples, min_ess);
VT intv_psrf = interval_psrf<VT, NT, MT>(samples);

//std::cout << "interval_psrf = " << intv_psrf.maxCoeff() << "us" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?


#include <../../external/arpack++/include/arssym.h>
//#include <../../external/arpack++/include/arssym.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

/// ARPACK++ standard eigenvalues solver
#define ARPACK_EIGENVALUES_SOLVER
//#define ARPACK_EIGENVALUES_SOLVER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

/// Samples random points from the spectrahedron from the Boltzmann distribution
/// \param[in] spectrahedron A spectrahedron
/// \param[in] interiorPoint A point in the interior of the spectrahedron
/// \param[in] pointsNum The number of points to sample
/// \param[out] points The list of the sampled points
/// \tparam Point class Point with NT and VT as declared above in this class
template <typename Point>
void apply(SPECTRAHEDRON &spectrahedron, Point const & interiorPoint, const unsigned int pointsNum,
void apply(ConvexBody &spectrahedron, Point const & interiorPoint, const unsigned int pointsNum,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parameter name should be renamed as well, right? From spectahedron to convexbody

/// \tparam Point
template <typename Point>
void getNextPoint(SPECTRAHEDRON &spectrahedron, VT &p, PrecomputedValues &precomputedValues) {
void getNextPoint(ConvexBody &spectrahedron, VT &p) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as above

@@ -0,0 +1,41 @@
function(GetLpSolve)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this lpsolve related change needed in the tests?

typedef Eigen::Matrix <NT, Eigen::Dynamic, Eigen::Dynamic> MT;
typedef Cartesian<NT> Kernel;
typedef typename Kernel::Point Point;
typedef Spectrahedron <Point> SPECTRAHEDRON;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to inline with the current writing typedef Spectrahedron<Point> Spectrahedron

void call_test_benchmark_spectrahedra_grid_search() {

typedef Eigen::Matrix<NT, Eigen::Dynamic, 1> VT;
typedef Eigen::Matrix <NT, Eigen::Dynamic, Eigen::Dynamic> MT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no space needed after Matrix

@TolisChal TolisChal merged commit 584af91 into GeomScale:develop Jan 4, 2022
Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I am OK with merging. Coverage can be improved, but in a future PR that will handle spectahedra better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants