[...] The innermost loop is an iteration over the number of rows or number of columns of matrix (or vector). The innermost loop is an iteration that adds, multiplies, or accumulates some quantity. In either case, try to replace that loop with an equivalent matrix operation or a function call. …