Re: question about using array intrinsic functions



Yes, things like this:
if (all(b(j,:) < a)) then
Now I know what to do !
Thank you very much!!


Steven G. Kargl wrote:
In article <1151696861.234227.325110@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"PCAT" <pcatchen@xxxxxxxxx> writes:
HI,
I have an array a(i), i=1,3
I also have another array b(j,i), j=1,5, i=1,3
If I would like to compare the each element of a(i) with b(j,i), j=1,5.
For example
If i can find one set of b(j,i) from j=1, 5 that all corresponding
element of a(i) is less than b(j,i)
then I would like to do something further.

Then How can I use the "all " funciton in this case? Because the a and
b are not in the same dimension.
Thank you very much.

Do you mean something like this

program g
integer j, b(5,3), a(3)
a = (/2, 2, 3/)
b = 10
b(1,:) = 1
b(2,:) = 2
b(3,:) = 3
do j = 1, 5
if (all(b(j,:) < a)) then
print *, j
end if
end do
end program g

--
Steve
http://troutmask.apl.washington.edu/~kargl/

.



Relevant Pages

  • Re: internal procedure cant use array of derived type from main
    ... Steven G. Kargl wrote: ... >> derived type from the main prohram. ... > but not the array of states 8 ...
    (comp.lang.fortran)
  • Re: question about using array intrinsic functions
    ... I have an array a, i=1,3 ... If I would like to compare the each element of awith b, j=1,5. ... Then How can I use the "all " funciton in this case? ... b are not in the same dimension. ...
    (comp.lang.fortran)
  • question about using array intrinsic functions
    ... I have an array a, i=1,3 ... If I would like to compare the each element of awith b, j=1,5. ... Then How can I use the "all " funciton in this case? ... b are not in the same dimension. ...
    (comp.lang.fortran)
  • Re: Error on UBound with Dynamic Array
    ... ReDim Preserve arrSplit+ 1) ... is that arrSplit has not yet been dimmed as having any dimension. ... need to use a dynamic array and may be checking the boundries, ... Public Function Split(csvString As String) As Variant ...
    (microsoft.public.access.modulesdaovba)
  • Re: Array of pointer Vs Pointer to Array
    ... that points to an array. ... Now 'pa' is a pointer form of accessing the values in 'matrix'. ... that depends on a variety of things - the size of the other dimension, ... the regular indexing style is a good first guess, ...
    (comp.lang.c)