Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Update Julia Arrays #28

Merged
merged 1 commit into from
Aug 28, 2018
Merged

Update Julia Arrays #28

merged 1 commit into from
Aug 28, 2018

Conversation

Nosferican
Copy link
Collaborator

No description provided.

@Nosferican Nosferican added this to the Update to 0.7/1.0 syntax milestone Aug 28, 2018
@Nosferican Nosferican self-assigned this Aug 28, 2018
@Nosferican Nosferican requested a review from arnavs August 28, 2018 02:05
@arnavs arnavs mentioned this pull request Aug 28, 2018
53 tasks
eye(2)


Matrix{Float64}(I, 2, 2)
Copy link
Member

Choose a reason for hiding this comment

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

I think using Matrix{Float64} as a function would be confusing (especially since it takes 3 arguments). I think ones(3, 3) could work here as a different example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is important to teach the current way of getting an identity matrix.

I # best case scenario
diagm(0 => ones(n))
Matrix{T}(I, n, n)
Diagonal(ones(n))

The I is covered, but we could choose ones of the other ones.

You can create an empty array using the ``Array()`` constructor

.. code-block:: julia

x = Array{Float64}(2, 2)
x = Array{Float64}(undef, 2, 2)
Copy link
Member

Choose a reason for hiding this comment

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

This is a direct port of the relevant QuantEcon...but I still think it could be confusing. Will defer to @jlperla.

Copy link
Member

Choose a reason for hiding this comment

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

I think we can hold off on most stylistic changes for now.

Copy link
Member

Choose a reason for hiding this comment

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

OK, got it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I kept that one since it is teaching how to use the constructor. The next lines go about how those are garbage values, etc.

@arnavs arnavs merged commit aad0ecd into master Aug 28, 2018
@arnavs arnavs deleted the Update-Julia_Arrays branch August 29, 2018 03:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants