def matrix_multiply(self, other):
		"""Multiply the matrix by another matrix.

		This is a private function called by __mul__.
		"""
		# Take the product of two matricies.
		r = []
		assert(isinstance(other, Matrix))
		if not self.cols() == other.rows():
			raise Matrix_Multiplication_Error(self, other)
		for row in xrange(self.rows()):
			r.append([])
			for col in xrange(other.cols()):
				r[row].append( \
					self.vector_inner_product(self.row(row), other.col(col)))
		if len(r) == 1 and len(r[0]) == 1:
			# The result is a scalar.
			return r[0][0]
		else:
			# The result is a matrix.
			return Matrix(r)
Multiply the matrix by another matrix.

		This is a private function called by __mul__.
		
recipes/Python/189971_Basic_Linear_Algebra_Matrix/recipe-189971.py