Re: question about using array intrinsic functions
- From: "PCAT" <pcatchen@xxxxxxxxx>
- Date: 30 Jun 2006 13:20:46 -0700
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/
.
- References:
- question about using array intrinsic functions
- From: PCAT
- Re: question about using array intrinsic functions
- From: Steven G. Kargl
- question about using array intrinsic functions
- Prev by Date: Re: Allocatable attribute on derived type components
- Previous by thread: Re: question about using array intrinsic functions
- Index(es):
Relevant Pages
|