/** * 矩阵的数乘,结果矩阵行列数不变 c[i][j] = num * a[i][j] * * @param num * @return */ public Matrix multiplyNum(double num) { int cRow = this.matrixData.length; int cColumn = this.matrixData[0].length; double[][] cData = new double[cRow][cColumn]; for (int i = 0; i < cRow; i++) { for (int j = 0; j < cColumn; j++) { cData[i][j] = num * this.matrixData[i][j]; } } return new Matrix(cData); }