-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
eye(2) | ||
|
||
|
||
Matrix{Float64}(I, 2, 2) |
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.
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.
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.
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) |
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.
This is a direct port of the relevant QuantEcon...but I still think it could be confusing. Will defer to @jlperla.
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.
I think we can hold off on most stylistic changes for now.
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.
OK, got it.
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.
I kept that one since it is teaching how to use the constructor. The next lines go about how those are garbage values, etc.
No description provided.