> Date: Wed, 23 Aug 2000 09:34:37 +0200
> From: "Jürgen v.Hagen"
> <[log in to unmask]>
> robin wrote:
> >
> > > Date: Tue, 22 Aug 2000 10:25:55 +0200
> > > From: "Jürgen v.Hagen"
> > > <[log in to unmask]>
> >
> > > Hello,
> > >
> > > For some filtering of matrices I need to act on the real and the
> > > imaginary part seperately (the filter is real). For now, I copy
> > > the real (and imaginary) part into a temporary matrix, and act
> > > on these like:
> > > temp(1:N,1:N) = real(mat(1:N,1:N)
> > > call filter(filtercoefs, temp)
> > > erg(1:N,1:N) = temp(1:N,1:N)
> > >
> > > temp(1:N,1:N) = real(mat(1:N,1:N)
> > ==============^^^^
> > Do you mean aimag?
> yep
> >
> > > call filter(filtercoefs, temp)
> > > erg(1:N,1:N) = erg(1:N,1:N) + cmplx(0.0, temp(1:N,1:N))
> >
> > Why not erg(...) = cmplx(erg(1:N,1:N), temp(1:N,1:N)) ?
> >
> I guess the two versions must be compared on a macine basis.
> My version needs one type conversion and one add per element.
> Your version would need two type conversions.
My suggested version requires no additions and no type conversions.
It's a straight assignment.
Yours requires two additions for each complex element.
> cheers juergen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|