25.2: Code Review
- Page ID
- 69407
In the next in-class assignment, we are going to avoid some of the more advanced libraries (i.e. no numpy
or scipy
or sympy
) to try to get a better understanding about what is going on in the math. The following code implements some common linear algebra functions:
Write a quick test to compare the output of the above dot
function with the numpy
dot function.
Write a quick test to compare the output of the above multiply
function with the numpy
multiply function.
What is the big-O complexity of the above multiply
function?
Line 11 in the provided multiply
code initializes a matrix of the size of the output matrix as a list of lists with zeros. What is the big-O complexity of line 11?
Write a quick test to compare the outputs of the above norm
function with the numpy
norm function.
Write a quick test to compare the output of the above transpose
function with the numpy
transpose function.
What is the big-O complexity of the above transpose
function?
Explain any differences in results between the provided functions and their numpy
counterparts.