Advertisement
Korotkodul

Часть 2. Полиномы

Feb 17th, 2025
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. import numpy as np
  2.  
  3. def f(x):
  4.     return 3 * x**2 + 2 * x + 1
  5.  
  6. def compute_poly_vectorized(abscissa: np.ndarray) -> np.ndarray:
  7.     return f(abscissa)
  8.  
  9. a = np.array([1, 2, 3, 4, 5])
  10. res = compute_poly_vectorized(a)
  11. print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement