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 vcat and hcat for two LinearOperators and testing. #1

Closed
wants to merge 2 commits into from
Closed

Conversation

lruthotto
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.04%) to 62.63% when pulling 7979c4b on lruthotto:master into fb7e5b2 on dpo:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+2.04%) to 62.63% when pulling 7979c4b on lruthotto:master into fb7e5b2 on dpo:master.

@dpo
Copy link
Member

dpo commented Apr 2, 2015

Many thanks! hcat and vcat have been on my list for a while. I really want to pull this but I have a few comments (I will also insert some in the code). Would you mind trying to imitate the coding style of the rest of the module? In particular:

  • two spaces for indentation
  • a space after a comma in an argument list (function declaration or call)
  • spaces around ::

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
Copy link
Member

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.

@dpo
Copy link
Member

dpo commented Apr 2, 2015

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)

@lruthotto
Copy link
Contributor Author

Thanks for your comments, @dpo. See revised version now.

@coveralls
Copy link

Coverage Status

Coverage increased (+4.21%) to 64.8% when pulling 1b8faa6 on lruthotto:master into fb7e5b2 on dpo:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+4.21%) to 64.8% when pulling 1b8faa6 on lruthotto:master into fb7e5b2 on dpo:master.

@dpo dpo closed this in e942fc0 Apr 3, 2015
@dpo
Copy link
Member

dpo commented Apr 3, 2015

Many thanks! This is great.

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.

None yet

3 participants