How do you make a view drop dimensions?

Chris Rackauckas

This is best illustrated by a simple example on v0.5-rc0:

julia> view(zeros(4,2),:,2)
4-element SubArray{Float64,1,Array{Float64,2},Tuple{Colon,Int64},true}:
 0.0
 0.0
 0.0
 0.0

julia> zeros(4,2)[:,2]
4-element Array{Float64,1}:
 0.0
 0.0
 0.0
 0.0

The first returns a SubArray of Array{Float64,2} with only 1 column, but v0.5 drops dimensions. Is there a way to make the SubArray/View drop the unused dimension?

Fengyang Wang

As Tasos mentioned, it's a view of an Array{Float64, 2}, but the view itself is one-dimensional already. In fact,

julia> T = SubArray{Float64,1,Array{Float64,2},Tuple{Colon,Int64},true};
julia> T <: AbstractVector{Float64}
true

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to move a view when you don't know its dimensions?

From Dev

How to make a view report different dimensions to layout than it actually is?

From Java

How do you make a calculator?

From Dev

How do you find the dimensions of a "display: none" element?

From Dev

How do you make a table row scroll into view when the table is in a scrollable div with jquery?

From Dev

How do you make a table row scroll into view when the table is in a scrollable div with jquery?

From Dev

How do you do dynamic / dependent drop downs in Google Sheets?

From Dev

How do you do dynamic / dependent drop downs in Google Sheets?

From Dev

(Mobile View) How to make UI tabs heading to work as a drop down

From Dev

How do you drop a mysql table if the table name is stored as a variable?

From Dev

How do you disallow Drag and Drop between two JTables?

From Dev

How do you drop a PostgreSQL database with a carriage return in the name?

From Dev

How do you view a numpy broadcast object?

From Dev

How do you set canBecomeFocused for a custom view

From Dev

how do you access the values in a couchbase view?

From Dev

How do you set the height of a view programmatically?

From Java

Flutter: How do you make a card clickable?

From Dev

How do you make a static class in swift?

From Dev

How do you make speech bubble with Tooltipsy?

From Dev

How do you make a circle from origin

From Dev

How do you make a changing background in rails?

From Dev

How do you join a 'Collection' to make a string

From Dev

How do you make an email go to spam

From Dev

How do you make a UIWebView content editable?

From Dev

How do you make a clickable sprite in SFML?

From Dev

How do you make relative references in R?

From Dev

How do you make this plist file programmatically?

From Dev

How do you make a class flatMappable?

From Dev

How do you make "infoboxes" in mediawiki?

Related Related

  1. 1

    How to move a view when you don't know its dimensions?

  2. 2

    How to make a view report different dimensions to layout than it actually is?

  3. 3

    How do you make a calculator?

  4. 4

    How do you find the dimensions of a "display: none" element?

  5. 5

    How do you make a table row scroll into view when the table is in a scrollable div with jquery?

  6. 6

    How do you make a table row scroll into view when the table is in a scrollable div with jquery?

  7. 7

    How do you do dynamic / dependent drop downs in Google Sheets?

  8. 8

    How do you do dynamic / dependent drop downs in Google Sheets?

  9. 9

    (Mobile View) How to make UI tabs heading to work as a drop down

  10. 10

    How do you drop a mysql table if the table name is stored as a variable?

  11. 11

    How do you disallow Drag and Drop between two JTables?

  12. 12

    How do you drop a PostgreSQL database with a carriage return in the name?

  13. 13

    How do you view a numpy broadcast object?

  14. 14

    How do you set canBecomeFocused for a custom view

  15. 15

    how do you access the values in a couchbase view?

  16. 16

    How do you set the height of a view programmatically?

  17. 17

    Flutter: How do you make a card clickable?

  18. 18

    How do you make a static class in swift?

  19. 19

    How do you make speech bubble with Tooltipsy?

  20. 20

    How do you make a circle from origin

  21. 21

    How do you make a changing background in rails?

  22. 22

    How do you join a 'Collection' to make a string

  23. 23

    How do you make an email go to spam

  24. 24

    How do you make a UIWebView content editable?

  25. 25

    How do you make a clickable sprite in SFML?

  26. 26

    How do you make relative references in R?

  27. 27

    How do you make this plist file programmatically?

  28. 28

    How do you make a class flatMappable?

  29. 29

    How do you make "infoboxes" in mediawiki?

HotTag

Archive