Re: forall and do loop



On Jul 27, 3:45 pm, Tim Prince <timothypri...@xxxxxxxxxxxxx> wrote:
highegg wrote:
Use the one that appears more clear to you - easier to read and/or
write.

That appears to be the biggest advantage of forall when a mask condition
is appropriate; it's clearer than the alternatives.

Even the automatic copy (if lhs and rhs alias) is sometimes useful:

! transpose 2D array of vectors
forall(i=1:size(a,2),j=1:size(a,3)) a(:,i,j) = a(:,j,i)

.



Relevant Pages

  • Re: Help check my proof please?
    ... Your last couple of messages quoted old posts, ... clearer how I got that in the last one. ... LHS>= 1 * sqrt ... doing _any_ simplification. ...
    (sci.math)
  • Re: forall and do loop
    ... That appears to be the biggest advantage of forall when a mask condition is appropriate; it's clearer than the alternatives. ... I don't see any reason to use forall rather than array section assignments in the example given at the top of the thread. ... any reasonable alternative ought to give the same performance. ...
    (comp.lang.fortran)
  • Re: Help check my proof please?
    ... I don't know the difference between an equation and inequality, ... Your last couple of messages quoted old posts, ... clearer how I got that in the last one. ... LHS>= 1 * sqrt ...
    (sci.math)
  • Re: Help check my proof please?
    ... Isn't this correct for the RHS ... LHS>= 1 * sqrt ... is it clearer now that I'm working on the right side? ...
    (sci.math)