-
Notifications
You must be signed in to change notification settings - Fork 370
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
RFC: Sparse ModelMatrix support #1040
Changes from 1 commit
c61a0ec
d46fc37
288552c
e1b068e
4a9a65f
fd12a5d
ff6f706
f94dd83
dd0ae91
db58318
25935c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,12 +374,11 @@ end | |
expandcols(trm::Vector) | ||
Create pairwise products of columns from a vector of matrices | ||
""" | ||
function expandcols(trm::Vector) | ||
function expandcols{T<:ModelMatrixContainer}(trm::Vector{T}) | ||
if length(trm) == 1 | ||
asmatrix(Matrix{Float64}, convert(Array{Float64}, trm[1])) | ||
trm[1] | ||
else | ||
a = convert(Array{Float64}, trm[1]) | ||
b = expandcols(trm[2 : end]) | ||
a, b = trm[1], expandcols(trm[2 : end]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, the conversions here (and just above) are redundant since elements of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the assignments on two lines. |
||
reduce(hcat, [broadcast(*, a, Compat.view(b, :, j)) for j in 1 : size(b, 2)]) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This signature should also be updated to mention the restriction on the element type.