Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException in AbstractPolychoricCorrelation #5

Open
pereferrera opened this issue May 1, 2015 · 2 comments
Open

Comments

@pereferrera
Copy link

When this piece of code is run, invalid offsets are accessed within the x2 array:

    //Eliminate rows and columns with nonzero sums
    if(validRowcount!=nrow || validColCount!=ncol){
        double[][] x2 = new double[validRowcount][validColCount];
        int r=0;
        int c=0;
        N=0;
        for(int i=0;i<nrow;i++){
            c=0;
            for(int j=0;j<ncol;j++){
                x2[r][c] = data[goodRow[i]][goodCol[j]];
                N+=x2[r][c];
                c++;
            }
            r++;
        }
        data=x2;
        nrow = data.length;
        ncol = data[0].length;
    }

As I'm not quite sure what is supposed to happen at this point, I didn't submit a pull request.

@meyerjp3
Copy link
Owner

There's more work to be done with the polychoric correlations. Would you post a test case that causes the error? Thanks.

pereferrera pushed a commit to pereferrera/psychometrics that referenced this issue May 11, 2015
@pereferrera
Copy link
Author

Done, see: #6

meyerjp3 added a commit that referenced this issue May 12, 2015
Added 3 test cases to show #5, ArrayIndexOutOfBoundsException in AbstractPolychoricCorrelation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants