Brad,
On Sun, 18 Mar 2018, Brad Chamberlain wrote:
I will look at it over the next week. I can see where you are coming
from but, Hmmm. Need to think.
To be clear, I'm not saying what we have is right, and when it was first
pointed out to me, I had the same surprise you did. But I also haven't
figured out a way to make your interpretation work without having the
slice be something other than an array (that's what the issue explores).
I am also not saying what you are doing is wrong. What you have done is
clean. Just not what I am looking for.
To scale part of a row of a matrix, I type
a[j+1..n, j] /= ajj
I find this is easier to read and more concise than
[i in j+1..n] a[i, j] /= ajj
Both of these work in Chapel as it stands. The former has been in some
sort of Fortran for nearly 4 decades.
But then silly me wants to use arrays of arrays so I need
a[j+1..n][j] /= ajj
to mean the same as the first statement.
I was going to suggest that a multidimensional array might be more
appropriate for the kind of case you were writing,
Yes it is. Linear Algebra.
but then I saw your second thread touched on multidimensional arrays and
haven't had the chance to digest that yet (it being the weekend and
all).
Sorry. Monday down-under! Take Sunday off.
Even now, a Chapel n-dimensional array is a 2nd class object because
you cannot assign literals to it in a declaration.
Yeah, this is a known lack. There's no deep reason for the lack of a
multidimensional array initializer other than that we were slow to
support array literals at all, and didn't invent a syntax for the
multidimensional case when we did add them. There was a discussion
about this some time ago on chapel-developers:
https://sourceforge.net/p/chapel/mailman/message/31974940/
and I think we just need to find someone to motivate us to implement it.
This could be you -- feel free to open a GitHub issue requesting it.
Later this week. On the road for a few days.
(And frankly, for things that are more naturally multidimensional
arrays... as I believe your example seems to be...
Yes - Crout reduction of a Matrix.
this will result in nicer capabilities I believe. Also, implementing
multidimensional array literals will probably be far simpler than
unraveling the "slicing arrays of arrays" case.
I figured as much.
I use an array of an array for a matrix to let me initialize it. But I
have just seen that this now has other implications.
Maybe the trick is just to initialize the multidimensional case in
another way for now?
For now I am just messing about. I can spell it out element by element for
my tests. But that is messy, especially if I am trying to show my work and
evangelize Chapel to some of my colleagues/clients, too many of whom use
Fortran.
(assign it within a loop or read it in from a file?) But again, we
could fill this gap if it would help you.
I think initialization that is orthogonal and exists/works the same for
all things is a key feature that is needed, not just for me. I need to
go fish
Not sure my compiler skills are up to being much help though on this
topic.
Regards - Damian
P.S. I noticed that you were busy in January. Lots of work going on with
real(32)'s being made as capable as real(64)'s. #5122+#5922+#7688+#7692
Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers