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

Replace magic constant test for linear solve on triangular matrices #5726

Merged
merged 3 commits into from
Feb 8, 2014

Conversation

jiahao
Copy link
Member

@jiahao jiahao commented Feb 8, 2014

@jiahao
Copy link
Member Author

jiahao commented Feb 8, 2014

cc: @staticfloat @mschauer

@staticfloat
Copy link
Member

This passes all tests on OSX with OpenBLAS and Accelerate.

@mschauer
Copy link
Contributor

mschauer commented Feb 8, 2014

After running the test and subsequently commenting out lines 52, 54, 69, 156, 522, 523 etc.

#        @test_approx_eq apd * inv(capd) eye(n)
...
#        @test_approx_eq det(capd) det(apd)
...
#            @test_approx_eq apd * inv(cpapd) eye(n)
...
#        @test_approx_eq_eps prod(f[:values]) prod(eigvals(a[1:5,1:5]/a[6:10,6:1 
...
#    @test_approx_eq W\v iFv
#    @test_approx_eq W\v iFv
#    @test_approx_eq det(W) det(F)
...
#        @test_approx_eq iWv iFv

the test still fail. This is unrelated to your change but there is no point to proceed further testing on 32 bit with matrices that close to singularity.

@mschauer
Copy link
Contributor

mschauer commented Feb 8, 2014

Anyway, I gave it a last try: No specific 32 bit issues with your PR. 👍

- New export `condskeel`
- Documentation with mathematical definition
- Other minor documentation fixes to linalg
- Add automatic promotion of integers to floats for condskeel
- Ref. #5605, #5705
jiahao added a commit that referenced this pull request Feb 8, 2014
Replace magic constant test for linear solve on triangular matrices
@jiahao jiahao merged commit 596d5c4 into master Feb 8, 2014
@jiahao
Copy link
Member Author

jiahao commented Feb 8, 2014

Thanks for cross-checking.

@jiahao jiahao deleted the cjh/fix-5705 branch February 8, 2014 16:23
condskeel(A::AbstractMatrix, p::Real=Inf) = norm(abs(inv(A))*abs(A), p)
condskeel{T<:Integer}(A::AbstractMatrix{T}, p::Real=Inf) = norm(abs(inv(float(A)))*abs(A), p)
condskeel(A::AbstractMatrix, x::AbstractVector, p::Real=Inf) = norm(abs(inv(A))*abs(A)*abs(x), p)
condskeel{T<:Integer}(A::AbstractMatrix{T}, x::AbstractVector, p::Real=Inf) = norm(abs(inv(float(A)))*abs(A)*abs(x), p)
Copy link
Member

Choose a reason for hiding this comment

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

@jiahao, why were the Integer versions needed, since inv(A) already converts to float?

Note also that abs(inv(A))*abs(A)*abs(x) should be abs(inv(A))*(abs(A)*abs(x)) in order to perform matvec and not matmul operations.

See also the discussion in #17302.

Copy link
Member

Choose a reason for hiding this comment

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

cc @Sacha0

@kshyatt kshyatt added test This change adds or pertains to unit tests linear algebra Linear algebra labels Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants