Print

Print


I apoplogize that my previous reply was not copied to the mailbase.

Yes, the reverse can also be done. But you need to be careful while you
check the results, as the way Fortran 90 might be different from what you
expect.

Cheers,
Mahmood.

> -----Original Message-----
> From:	varadharajan [SMTP:[log in to unmask]]
> Sent:	Monday, August 07, 2000 6:43 PM
> To:	Ahmad Mr M
> Subject:	RE: Array addition!
> 
> Thanks! It is exactly the thing I was looking for. Can I do the reverse
> also : a(i,:) = b? 
> 
> Varadharajan S
> 
> **************************************************************************
> *****
> '"It is not bad", he thought with a perhaps justifiable sense
> of bitterness,"that life is like a chasm over which you have
> to walk blindfolded. Bad, but not bad enough. SOMETIMES YOU
> ALSO GET PUSHED"'
>               - The Library Policeman, Stephen King
> **************************************************************************
> *****
> 
> On Mon, 7 Aug 2000, Ahmad Mr M wrote:
> 
> > Hi,
> > AFAIT, if you have a matrix A of nx3 (n rows and 3 columns), you can
> access
> > each row (having 3 elements) in Fortran 90 by writing:
> >  B = A(i, 1:3) or 
> >  B = A(i, :) - for whole ith row
> > You can add the vector V = (x1,y1,z1) to B each time the loop runs for i
> = 1
> > to n.
> > 
> > Of course, there could be other ways. This seems to me the simplest one.
> > Cheers.
> > 
> > > -----Original Message-----
> > > From:	varadharajan [SMTP:[log in to unmask]]
> > > Sent:	Monday, August 07, 2000 6:15 PM
> > > To:	[log in to unmask]
> > > Subject:	Array addition!
> > > 
> > > Hello.
> > > I needed to know if there is a way of adding arrays of different
> shapes
> > > directly without having to use a do loop. What I want to do is I have
> a
> > > set of coordinates and I want to increase each point(x,y,z) by a
> constant
> > > vector(x1,y1,z1). Can I do this in some way similar to a = a + b? If
> yes
> > > how?
> > > 
> > > Varadharajan S
> > > 
> > >
> **************************************************************************
> > > *****
> > > '"It is not bad", he thought with a perhaps justifiable sense
> > > of bitterness,"that life is like a chasm over which you have
> > > to walk blindfolded. Bad, but not bad enough. SOMETIMES YOU
> > > ALSO GET PUSHED"'
> > >               - The Library Policeman, Stephen King
> > >
> **************************************************************************
> > > *****
> > 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%