Re: Allocatable arrays in derived types



glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:

Richard Maine wrote:

Another way to get an array of stride other than 1 is to start with a
rank 2 array and take a slice that is a row. For example, if xx is an n
by n array and you take the slice x(i,:) for some particular value of i,
that slice will have stride n-1. Note that this is a case that
Yugoslav's description doesn't catch.

Won't the stride be n?

Oops. Yes, of course. I guess I was thinking about the gaps instead of
the stride... or something.

Also, if you have N by N array x, with N greater than 3, and
take, for example, x(2:3,:) the element spacing isn't uniform.

That's just an application of the same principle to higher ranks. The
spacing of the columns is uniform, and the spacing of the elements in
each columnn is uniform. I figured I had blathered along for long enough
without going into the elaboration for higher rank. Besides, the average
user doesn't need that elaboration detailed. He just needs to understand
the general concept. That's even more so with someone struggling with
the basic concept in rank 1. There seems little benefit in throwing in
the extra stuff for higher ranks until the rank 1 case is thoroughly
understood. We are *NOT* talking to "people designing computer memory
hardware" here.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: reading HDF5 dataset subset
    ... space to be rank 3,, the output is only one value. ... The way you've defined start, stride and count, you should have ended up with a 1x3 vector. ... I need to be able to subset, say, a slice of data. ... Count is the number of data points along that specific dimension. ...
    (comp.soft-sys.matlab)
  • Part 4 of Short Steps Toward Generic Programming: KIND Genericity
    ... In this part I will again be discussing a feature that has been ... KIND and select the appropriate instance at compile-time in the ... Assumed Rank Arrays ... argument that don't require knowledge of the rank of the array. ...
    (comp.lang.fortran)
  • can this code be improved
    ... // the new array containing unique numbers only ... int number = 0; ... boolean dupLocated=false; ... Rank 1 number is 43 ...
    (comp.lang.java.programmer)
  • Re: Ranking Without Sorting
    ... you have just reinvented the rank sort. ... >> 'rank' array you want. ... >> Doing a 'heap sort', for example, where the heap holds the index into ...
    (comp.programming)
  • Re: Display the max, then the next down, then the next down, etc.
    ... > I just had to fix a couple of cell references. ... > the ROWwill give you the second lowest rank, and so on down the line. ... > The IF/ROW functions will return an array to feed into LARGE. ... The COUNTIF will count only one ...
    (microsoft.public.excel.misc)