Top.Mail.Ru
The C++ Community's Journal -- Day
? ?
The C++ Community's Journal -- Day [entries|friends|calendar]
The C++ Community

[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

C++ on Sun [08 Apr 2004|11:31am]
[ mood | Image annoyed ]

Hi all,

I'm currently working on a program in C++, compiling using Sun's Forte Developer 7 C++ compiler.

My program is combinatorial in nature and depends on certain parameters. For small parameters, it works flawlessly and has no problems. For larger parameters, my program will simply terminate with the message Abort. Obviously, this isn't particularly informative and I have no idea where the problem is.

I heard that it might be because of an uncaught exception, so in order to test this theory, I've enclosed my entire program (inside main) in a try...catch block that catches std::bad_alloc and std::exception, but I'm still getting the Abort, so I'm assuming that this isn't the problem.

My program is extremely recursive and for large parameters, I'm wondering if this could be causing a problem. Certainly, for large parameters, the amount of memory will increase (not dramatically), as will the depth of the recursion (fairly dramatically). I've been wasting a huge amount of time struggling to find out exactly what's going on but without any success. Anyone have any ideas of anything I could try? I can't use another compiler, because I'm linking with a set of third-party libraries (CPLEX) and this is the only compiler that seems to allow me to do this (g++ doesn't seem to be able to).

Thanks!
Seb

11 comments|post comment

Recursive vs. non-recursive? [08 Apr 2004|03:38pm]
[ mood | relief ]

As mentioned in my previous post, I'm writing a program with a method that is extremely recursive (i.e. it has a for loop inside of it and in each iteration of the for loop, it calls itself - the depth of recursion that I've observed so far has been between 400 and 500, but it could easily go higher for larger problems). I could implement this problem in a non-recursive fashion using an STL stack, but it would be rather difficult and annoying to do so.

My question: would it be worthwhile, in terms of memory or speed? Would overflowing the stack be a problem for higher depths of recursion that could be avoided by a non-recursive solution?

Note: Many thanks to everyone who replied to my last post. I did find a really hard-to-detect memory leak that I think *may* have been causing the problem (although why I wasn't getting a std::bad_alloc exception is beyond me if I was running out of memory, which is highly likely given the nature of the leak). Seems to be working now for a parameter that, beforehand, was guaranteed not to work :D:D:D. Thanks again! *heaves a sigh of relief*

Stupid Schreier-Sims group algorithms *grumble*.

13 comments|post comment

[08 Apr 2004|06:48pm]
[ mood | Image amused ]

I use bloodshed and whenever I execute the programs I write, a black screen pops up and disappears right away. Am I doing something wrong here? Should I post my code? Sorry I just started C++. Thanks in advance for your help in.

BTW. I'm a newbie to this community.

8 comments|post comment

navigation
[ viewing | April 8th, 2004 ]
[ go | previous day|next day ]
Image