Skip to content

Conversation

@PaulXiCao
Copy link
Contributor

Closes #1536.

Proper check for positive definite matrix by checking diagonal entries of intermediate matrix. Added mentioned example from issue as test.

Copy link
Collaborator

@alexhroom alexhroom 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 the contribution! just a small tidy-up, and it seems the CI is failing with creating some Nones that it isn't expecting.

Comment on lines +239 to +245
if !v.clone().imaginary().is_zero() {
return None;
}
v.try_sqrt()
let re = v.real();
if re <= T::RealField::zero() {
return None;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would be clearer to write this as something like

let re = v.real();
let im = v.imaginary();

if re <= T::RealField::zero() || !im.is_zero() {
    return None;
}

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.

Cholesky erroneously produces (wrong) results for non-positive-definite complex matrices

2 participants