-
Notifications
You must be signed in to change notification settings - Fork 122
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
Max inscribed ellipsoid sparse #166
Conversation
E2.noalias() = (A_trans * Y * A).inverse(); | ||
Y = y.asDiagonal(); | ||
|
||
E2.noalias() = MT(A_trans * Y * A).inverse(); |
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.
Since Y is a diagonal matrix, could this operation be further optimized?
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.
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)); |
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.
Since Y is a diagonal matrix, could this operation be further optimized?
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.
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; |
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.
Since Y is a diagonal matrix, could this operation be further optimized?
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.
same as above, also A
can be sparse here.
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 for this PR, I have minor comments.
max_inscribed_ellipsoid_rounding
max_inscribed_ellipsoid
for polytopes with sparseA
matrix (for ex. order polytopes).