-
Notifications
You must be signed in to change notification settings - Fork 31
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 vcat and hcat for two LinearOperators and testing. #1
Conversation
1 similar comment
Many thanks!
I know that that doesn't quite correspond to Base Julia, but I find it's more readable. Sorry for nitpicking. |
end | ||
if A.dtype != B.dtype | ||
error("data type must be the same") | ||
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.
Other operations with operators use promote_type()
to infer the smallest common type that can represent all operands. It would be best to do the same here.
Could we generalize this to an arbitrary number of arguments? Something like function hcat(ops...)
nrow = ops[1].nrow;
op0 = opZeros(nrow, 0, dtype=typeof(ops[1])); # Dummy operator to begin concatenating.
for (i, op) in enumerate(ops)
op0 = [op0 , op];
end
return op0
end (untested) |
- cosmetic changes
Thanks for your comments, @dpo. See revised version now. |
1 similar comment
Many thanks! This is great. |
No description provided.