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

Added sparse_factors function #5

Merged
merged 1 commit into from
Dec 20, 2015
Merged

Added sparse_factors function #5

merged 1 commit into from
Dec 20, 2015

Conversation

sglyon
Copy link
Collaborator

@sglyon sglyon commented Dec 15, 2015

Hi @timholy this is the spec builder function from over at Interpolations.jl

I've opened a PR to give you a chance to give feedback, especially regarding the name and whether or not to export the function.

Thanks!

```

"""
function _build_woodbury_specs{T}(::Type{T}, n::Int, args::Tuple{Int, Int, Any}...)
Copy link
Member

Choose a reason for hiding this comment

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

The code is fine---it's not high-performance, but this function doesn't need to be, if we don't export it, because you're using it only for small problems.

The help text is a little hard to follow: what is args? (it's clear if you read the code, but...). You might want to mention that rowspec, valspec, and colspec are all sparse matrices.

@timholy
Copy link
Member

timholy commented Dec 15, 2015

If we don't export it, the name isn't crucial, but somehow the name seems like it could be a little better. woodbury probably doesn't need to be in the name anymore, since this is what the package is about. What does the specs part of the name mean?

Maybe call it sparse_factors, in honor of the sparse function and the output?

@sglyon
Copy link
Collaborator Author

sglyon commented Dec 15, 2015

Thanks for the comments. I definitely agree that woodbury should be taken out of the name.

The specs part was just inherited from the Interpolations code where we were calling these matrices rowspec, colspec, valspec.

I like the factor idea much better. Right now the valspec matrix is dense, but it really just needs to be a Diagonal. If we made that change, would it make sense to use sparse_factors still? I think so as diagonal is just a special case of sparse in my mind

@timholy
Copy link
Member

timholy commented Dec 15, 2015

Sure, that's still sparse, even if not a SparseMatrixCSC (which is an implementation detail, in my opinion).

@sglyon
Copy link
Collaborator Author

sglyon commented Dec 15, 2015

So I tried allowing the vals part be a Diagonal, but there is no method *(::SparseMatrixCSC, ::Diagonal) (ref JuliaLang/julia#14416)

For now it is also just a SparseMatrixCSC

@sglyon sglyon changed the title Added _build_woodbury_spec function Added sparse_factors function Dec 15, 2015
timholy added a commit that referenced this pull request Dec 20, 2015
Added sparse_factors function
@timholy timholy merged commit be3a696 into master Dec 20, 2015
@timholy
Copy link
Member

timholy commented Dec 20, 2015

Sorry I didn't notice this was ready. Thanks!

See also #6.

@sglyon
Copy link
Collaborator Author

sglyon commented Dec 21, 2015

No problem, thanks!

```

"""
function sparse_factors{T}(::Type{T}, n::Int, args::Tuple{Int, Int, Any}...)
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs Compat

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.

3 participants