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

WIP:Make LinAlg more type stable #8796

Closed
wants to merge 1 commit into from
Closed

Conversation

andreasnoack
Copy link
Member

This is a followup on JuliaLang/LinearAlgebra.jl#144. This is a first attempt to make the code in LinAlg a bit more type stable. It is very convenient to dispatch on whether a matrix is upper or lower triangular, e.g. Triangular{:U}+Triangular{:U} = Triangular{:U} but Triangular{:U}+Triangular{:L} = Matrix. Unfortunately, it makes it them a bit more complicated to construct because the two first parameters are the element matrix types which is inferred from the input matrix whereas the last two determines if the matrix is upper or lower and if it has unit diagonal. The last two are useful to provide as a user, such that a non-triangular matrix can be interpreted as triangular.

As a consequence, the present convenience constructor is not type stable, which can cause significant allocation. To solve the problem, I have introduced a parametric type with the only purpose of wrapping the arguments of the convenience constructor, such that they are types instead of value. For now, I have named the type Token, because we couldn't really find a good name in JuliaLang/LinearAlgebra.jl#144. Hopefully, we can avoid the new type and just wrap a value in curly brackets and have it interpreted as a type.

@andreasnoack
Copy link
Member Author

superseded by #9779

@andreasnoack andreasnoack deleted the anj/typestable branch March 6, 2015 15:38
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.

1 participant