java - Simple iterator looping gives unexpected result -


I'm sure this is a clear error with my argument, but I guess what I'm doing is wrong work Has been doing. I just have an array list of security codes, I want to count the relations between each combination of security code. My code is as follows:

  Private zero crossCorr (ArrayList & quot; string> code, HashMap & lt; string, stock & gt; stockMap) {// via code list Iterates and all cross-correlation: Iterator is  

I get output -

----- GOOG - GOOG - GOOG - correlation is 1.0000000000000002
GOOG - YHOO - MSFT - - correlation .6986623807707519
GOOG is CSCO - - correlation .7275411317567286
GOOG is AAPL - - correlation .8122979333663799
GOOG is ADBE - - correlation .8217785260604609
is GOOG correlation .6102679356472099 GOOG
- dish - NSOL - - correlation .644852624453125
GOOG is SBUX - - correlation .11600387177879072
GOOG is PSFT - - correlation .6694306410719489
GOOG correlation is -0.09921822861087544
GOOG - XOM - correlation .6728272039489009 GOOG
is - WMT - IBM - - Correlation .4004364090315347
GOOG is JPM - - Correlation .7559988282095168
GOOG correlation .7085525367336528 GOOG
is - DNA - HPQ - - Correlation .13628949379947575
GOOG is KO - correlation .7819350018750656 GOOG
is - correlation is 0.5700932682157461 | GOOG - VZ - correlation is 0.737881573641585
G OOG - INTC - Spy - - correlation .7654127298771953
.8042488406758052 GOOG correlation GOOG
the - PEP - WFC - - correlation .6297924741882344
GOOG is ABT - - correlation .5064491351161948
GOOG correlation .238752389446595
is GOOG - QCOM - correlation .726356709262025 GOOG
- COP - Delhi Corporation - - Correlation.5706049 81251932
GOOG is the correlation .5434872575410538

but I never get it

YHOO is - GOOG - is the correlation .... etc etc

I am sure this is a simple error and for some reason I am not picking it up.

I know that I am doing the calculation of correlation twice, I will fix it when I want to work this part.

Please tell me that I need to provide more information.

A quick test application has removed the code references that we know is not working for me is.

Is it possible that you dally not be an unsolicited exception? If you can post a short but full program that demonstrates the problem, copy your whole project to be extremely helpful and just remove the bits (like hard-coding data and return value) when Until you remove the problem, you can not take anything else. At that time you may well get the problem for yourself.

By the way, if you are using Java 1.5 or greater, then obviously an iterator for the extended use for the loop. You will do this:

 For  (string code 1: code) {// ... (string code 2: code) {// ...}}  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -