Foundations-of-Applied-Mathematics / Labs

Labs for the Foundations of Applied Mathematics curriculum.
https://foundations-of-applied-mathematics.github.io/
211 stars 71 forks source link

Typo in profiling exercise #5

Closed rushtongarth closed 6 years ago

rushtongarth commented 6 years ago

There appears to be a typo in exercise 7 of Lab 08. In particular, there is a snippet of code which reads:

def matrix_power(A, n):
    """Compute A^n, the n-th power of the matrix A."""
    product = A.copy()
    temporary_array = np.empty_like(A[0])
    m = A.shape[0]
    for power in range(1, power):
        #...

I think that the for loop should be changed to:

     for power in range(1, n):

This can also be found on line 757 in the profiling.tex file

shanemcq18 commented 6 years ago

We've corrected this in our development version and the change will be merged in soon. Thanks for pointing this one out.

shanemcq18 commented 6 years ago

Corrected in 52144d52c7c1e5c867b1df1d565d3f0ff90e0059.