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

define rank(::AbstractVector) #46169

Merged
merged 2 commits into from
Aug 1, 2022
Merged

define rank(::AbstractVector) #46169

merged 2 commits into from
Aug 1, 2022

Conversation

stevengj
Copy link
Member

Since we define svd(::Vector) and qr(::Vector), in both cases punning on a vector as a 1-column matrix, it seems like we should define rank as well.

It seems like there is only one sensible way to define LinearAlgebra.rank(::Vector) if you are going to define it at all, so I don't see much risk here.

(Came across this omission today in code by @eewing1 and @baddoo.)

@stevengj stevengj added the domain:linear algebra Linear algebra label Jul 25, 2022
@gbaraldi
Copy link
Member

Would it make sense to restrict it to AbstractVector{<:Number} or do you think the general AbstractVector is good enough.

@stevengj
Copy link
Member Author

stevengj commented Jul 26, 2022

Would it make sense to restrict it to AbstractVector{<:Number} or do you think the general AbstractVector is good enough.

It also makes sense for other vector spaces, e.g. vectors of matrices, so it seems better to me to duck-type here. (iszero will throw for non-arithmetic types, and anyway this is a function in LinearAlgebra.)

@stevengj
Copy link
Member Author

stevengj commented Jul 26, 2022

CI failures are unrelated "Error in testset Downloads"

@dkarrasch dkarrasch merged commit 0b9eda1 into master Aug 1, 2022
@dkarrasch dkarrasch deleted the stevengj-patch-1 branch August 1, 2022 14:27
ffucci pushed a commit to ffucci/julia that referenced this pull request Aug 11, 2022
pcjentsch pushed a commit to pcjentsch/julia that referenced this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants