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

Max inscribed ellipsoid sparse #166

Merged
merged 6 commits into from
Jul 28, 2021

Conversation

vaithak
Copy link
Collaborator

@vaithak vaithak commented Jun 30, 2021

  • Added test for max_inscribed_ellipsoid_rounding
  • Modified the Interior Point algorithm of max_inscribed_ellipsoid for polytopes with sparse A matrix (for ex. order polytopes).

E2.noalias() = (A_trans * Y * A).inverse();
Y = y.asDiagonal();

E2.noalias() = MT(A_trans * Y * A).inverse();
Copy link
Member

Choose a reason for hiding this comment

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

Since Y is a diagonal matrix, could this operation be further optimized?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Y is defined to be of type Diagonal Matrix, so Eigen will optimize the multiplication as expected.

@@ -84,7 +95,7 @@ std::pair<std::pair<MT, VT>, bool> max_inscribed_ellipsoid(MT A, VT b, VT const&
vec_iter3++;
}
Q *= (t * t);
Y *= (1.0 / (t * t));
Y = Y * (1.0 / (t * t));
Copy link
Member

Choose a reason for hiding this comment

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

Since Y is a diagonal matrix, could this operation be further optimized?

Copy link
Collaborator Author

@vaithak vaithak Jul 20, 2021

Choose a reason for hiding this comment

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

same here also, .asDiagonal() returns a diagonal matrix for which computations will be optimized.
I read about this from here: stackoverflow-answer

@@ -140,7 +151,7 @@ std::pair<std::pair<MT, VT>, bool> max_inscribed_ellipsoid(MT A, VT b, VT const&
YQ.noalias() = Y * Q;
G = YQ.cwiseProduct(YQ.transpose());
y2h = 2.0 * yh;
YA.noalias() = Y * A;
YA = Y * A;
Copy link
Member

Choose a reason for hiding this comment

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

Since Y is a diagonal matrix, could this operation be further optimized?

Copy link
Collaborator Author

@vaithak vaithak Jul 20, 2021

Choose a reason for hiding this comment

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

same as above, also A can be sparse here.

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 minor comments.

include/preprocess/max_inscribed_ellipsoid.hpp Outdated Show resolved Hide resolved
include/preprocess/max_inscribed_ellipsoid.hpp Outdated Show resolved Hide resolved
include/preprocess/max_inscribed_ellipsoid.hpp Outdated Show resolved Hide resolved
include/preprocess/max_inscribed_ellipsoid.hpp Outdated Show resolved Hide resolved
@vissarion vissarion merged commit 758d417 into GeomScale:develop Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants