[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# Help with Fortran to C++ conversion

Posted on 2004-08-27
Medium Priority
317 Views
Hello, i have this in fortran:

DO 110 J=1,6

DO 130 K=1,6
&     .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

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

Thank You
0
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3

LVL 11

Accepted Solution

ID: 11917679
for (int k = 0; k != 6; ++i)

for (int k = 0; k != 6; ++i)
&& (!LMask[0] || (Absa[k] >= Absa[0]))
&& (!LMask[1] || (Absa[k] >= Absa[1]))
&& (!LMask[2] || (Absa[k] >= Absa[2]))
&& (!LMask[3] || (Absa[k] >= Absa[3]))
&& (!LMask[4] || (Absa[k] >= Absa[4]))
&& (!LMask[5] || (Absa[k] >= Absa[5])))
ipiv = k;

This assumes that ABSA is another array and that you have it defined in your C++; that that out of context I could have otherthings that are not quite right but the basics should be there.
0

LVL 11

Expert Comment

ID: 11917688
Oh, yeah, declare

int ipiv;

before the second loop starts.

-bcl
0

LVL 11

Expert Comment

ID: 11917692
And the last line of the code should read

-bcl
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
###### Suggested Courses
Course of the Month13 days, 4 hours left to enroll