Hi, I'm a beginner with Java, can anyone tell me where my error is, I'm sure there's something I'm missing here with the array logic:
public void scalarMultiplication(int c) {
for( int i=0; i <values.length - 1;i++){
for(int j=0; j < values.length - 1;j++){
values[i][j] = values[i][j] * c;
}
main:
Matrix n = new Matrix(new int[][] { { 1, 0, -1 }, { 1, 3, 3 },
{ -2, -4, 1 }, { 0, 0, 1 } });
n.scalarMultiplication(-1);
my output:
[-1, 0, 1]
[-1, -3, -3]
[2, 4, -1]
[0, 0, 1]
*The lost row of the matrix is not multiplied by -1
Any suggestions would be appreciated.