Link to home
Start Free TrialLog in
Avatar of Mad_Angel
Mad_Angel

asked on

Help with Fortran to C++ conversion

Hello, i have this in fortran:

       LOGICAL LMASK(6)

       DO 110 J=1,6
 110      LMASK(J) = .TRUE.

         DO 130 K=1,6
  130       IF(LMASK(K)
     &     .AND.( (.NOT.LMASK(1)) .OR. (ABSA(K).GE.ABSA(1)) )
     &     .AND.( (.NOT.LMASK(2)) .OR. (ABSA(K).GE.ABSA(2)) )
     &     .AND.( (.NOT.LMASK(3)) .OR. (ABSA(K).GE.ABSA(3)) )
     &     .AND.( (.NOT.LMASK(4)) .OR. (ABSA(K).GE.ABSA(4)) )
     &     .AND.( (.NOT.LMASK(5)) .OR. (ABSA(K).GE.ABSA(5)) )
     &     .AND.( (.NOT.LMASK(6)) .OR. (ABSA(K).GE.ABSA(6)) )  )
     &                          IPIV = K

         LMASK(IPIV) = .FALSE.

I don't know how would you express that if statement in C++.

Thank You
ASKER CERTIFIED SOLUTION
Avatar of bcladd
bcladd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bcladd
bcladd

Oh, yeah, declare

int ipiv;

before the second loop starts.

-bcl
And the last line of the code should read

LMask[ipiv] = false;

-bcl