Question: /** * multiply a scalar value (constant) into a matrix. * IMPORTANT: the matrix passed should NOT be modified. * @param m: matrix from which
/**
* multiply a scalar value (constant) into a matrix.
* IMPORTANT: the matrix passed should NOT be modified.
* @param m: matrix from which scalar is to be subtracted
* @param b: scalar to be subtracted
* @return resulting Matrix
*/
public static Matrix multiply(Matrix m, double b)
{
Matrix result = new Matrix();
return result; //to be completed
}
/**
* add to matrices.
* IMPORTANT: neither of the passed matrices should be modified
* @param m: matrix 1
* @param n: matrix 2
* @return if m and n have the same dimensions, return
* result of adding the two matrices, otherwise return null
*/
public static Matrix add(Matrix m, Matrix n)
{
Matrix result = new Matrix();
return result; //to be completed
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
