Return the gradient of the quadratic function f(x)=21x⊤Ax+b⊤x. The matrix A does not have to be symmetric.
Implement solve(A, x, b).
Returns. Return a NumPy array of length n.
Example 1
Input:
solve([[2.0, 0.0], [0.0, 2.0]], [1.0, 1.0], [0.0, 0.0])
Output:
[2.0, 2.0]
Example 2
Input:
solve([[0.0, 1.0], [0.0, 0.0]], [1.0, 2.0], [0.0, 0.0])
Output:
[1.0, 0.5]
No results yet
Run your code to check it against the examples, or submit to run every test.