-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
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)`. |
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.
1-column matrix
@@ -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)`. |
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.
1-column matrix. a vector is already a vector.
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.
Oh my bad. Fixed.
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.
the "nx1-sized" part was fine, it was saying "To create a ... vector out of a vector" that I was commenting on
How's that? |
For what it's worth, this is one of the reasons I did #19919 — this could be |
is there anything to do here or should this be closed? |
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.