0

I trying to replace a single row using Jama .

I tried it by using setMatrix like this -

double[][] myArray = { { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 },
                { 1, 1, 1, 1 } }; // all the matrix '1'
        Matrix myMatrix = new Matrix(myArray);

        myMatrix.setMatrix(2, 2, new int[] { 1, 2, 3, 4 }, new Matrix(
                new double[][] { { 3, 3, 3, 3 } })); // replace 2nd row to [3,3,3,3]
        System.out.println((Arrays.deepToString(myMatrix.getArray())));

but it throw java.lang.ArrayIndexOutOfBoundsException , how to make that correctly ?

4

1 に答える 1

0

私は管理しました-インデックス0から開始するだけです-に変更します{0,1,2,3}

于 2013-05-26T06:42:00.173 に答える