Skip to content

ArrayIndexOutOfBoundsException in AbstractPolychoricCorrelation #5

@pereferrera

Description

@pereferrera

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions