矩阵相加(减)

///
//矩阵相加(减)

void Matrix_add(double* a, double* b, double* c, double coe, int row_mm, int col_nn)
{
	int i = 0, j = 0;

	for (i = 0; i < row_mm; i++)
	{
		for (j = 0; j < col_nn; j++)
		{
			c[i * row_mm + j] = b[i * row_mm + j] + coe * a[i * row_mm + j];
		}
	}
}

你可能感兴趣的:(矩阵,算法,数据结构)