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

Add reshape command to news on RowVector #20216

Closed
wants to merge 5 commits into from

Conversation

ChrisRackauckas
Copy link
Member

From the chats it sounds like a lot of people used to use double transpose to turn a vector into an nx1 column vector. This helps users find the command which recovers that behavior.

From the chats it sounds like a lot of people used to use double transpose to turn a vector into an nx1 column vector. This helps users find the command which recovers that behavior.
@@ -118,7 +118,8 @@ This section lists changes that do not have deprecation warnings.

* `transpose(::AbstractVector)` now always returns a `RowVector` view of the input (which is a
special 1×n-sized `AbstractMatrix`), not a `Matrix`, etc. In particular, for
`v::AbstractVector` we now have `(v.').' === v` and `v.' * v` is a scalar. ([#19670])
`v::AbstractVector` we now have `(v.').' === v` and `v.' * v` is a scalar. ([#19670]).
To create a nx1-sized column vector out of a vector, use `reshape(v,length(v),1)`.
Copy link
Contributor

Choose a reason for hiding this comment

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

1-column matrix

@ChrisRackauckas ChrisRackauckas changed the title Add reshape command Add reshape command to news on RowVector Jan 24, 2017
@@ -119,7 +119,7 @@ This section lists changes that do not have deprecation warnings.
* `transpose(::AbstractVector)` now always returns a `RowVector` view of the input (which is a
special 1×n-sized `AbstractMatrix`), not a `Matrix`, etc. In particular, for
`v::AbstractVector` we now have `(v.').' === v` and `v.' * v` is a scalar. ([#19670]).
To create a nx1-sized column vector out of a vector, use `reshape(v,length(v),1)`.
To create a 1-column vector out of a vector, use `reshape(v,length(v),1)`.
Copy link
Contributor

Choose a reason for hiding this comment

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

1-column matrix. a vector is already a vector.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh my bad. Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

the "nx1-sized" part was fine, it was saying "To create a ... vector out of a vector" that I was commenting on

@ChrisRackauckas
Copy link
Member Author

How's that?

@mbauman
Copy link
Member

mbauman commented Jan 24, 2017

For what it's worth, this is one of the reasons I did #19919 — this could be reshape(v, :, 1). It would be a little bit slower since it calls the slow div instruction, but we could add a fast-path to avoid the divrem(x, 1)… a branch should be faster than a division+modulus.

@kshyatt kshyatt added the needs news A NEWS entry is required for this change label Jan 24, 2017
@musm
Copy link
Contributor

musm commented Jul 3, 2017

is there anything to do here or should this be closed?

@KristofferC KristofferC removed the needs news A NEWS entry is required for this change label Nov 13, 2018
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.

6 participants