Number unstableness..static problem?

Joined
Jul 7, 2009
Messages
1
Reaction score
0
Hi, I'm relatively new to the world of java, but recently I've been working on a project which requires as final step the implementation of an algorithm.First of all I want to say that I only have to use this programme for this one application so I dont need it to be re used or called from some other class or anything else.
So:
I have created a class with some static class instances and a series of methods(all static) which i use in main that basically,starting from a matrix of values(which I initialize to values at the start of the main), "work" there way step by step (using among others the Floyd-Warshall algorithm that some of you may know)selecting the value that has to be eliminated and substituting it with another(following some criteria that I avoid to mention) and so on until the final matrix is accomplished. Now to avoid to bore you I wont explain in detail the whole process of data-using, being the whole thing long and quite complicated(as much as I'd love to post the whole programme here and hope for someones help!:)). So I'll stick to the subject of the topic.
I have realized in my debug that after a certain number of iterations the values in the matrix start going crazy, changing from a certain value in memory to another value completely. Now the complexity of the the algorithm is n^3+ (being composed of three cycles plus a lot of other operations )and in this case n is 109.
Considering that everytime the algorithm substitues a value it restarts from the beginning, overriding the old value in the matrix with the new one, could it be for some absurd reason that the Java Machine cannot handle these kind of numbers using static methods? or more likely does someone have any idea whats going on?

Thanks for your time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,117
Latest member
Matilda564
Top