Hai Bo HB Lin <li...@cn.ibm.com> wrote on 06/07/2010 05:42:51 AM:
>
>
> I have a 2-D array like:
> val a = new Array[double]([0..N-1,0..N-1], (Point) => 0.0);
>
> and a quick sort function like:
> private final def qSort1(C:Rail[double]!, lo:int, hi:int));
>
> Can I pass one row of array a as the parameter of type Rail?
>

Not reliably, because Array is implemented with a single backing Rail
[double], not as a Rail[Rail[double]].  That implementation isn't actually
part of the specification, it just happens to be true in the current
implementation.

If the portion you want to sort happens to be laid out in a contiguous
portion of the array's backing rail, then you could do it by breaking
through some abstraction barriers, but there's no promise that such code
would work in the future.  The layout of the array into backing storage
isn't something that we've specified or committed to keeping stable from
one release to another.

--dave
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to