mirror of
https://github.com/janishutz/eth-summaries.git
synced 2025-11-25 18:44:24 +00:00
[NumCS] ++ Code Examples
This commit is contained in:
@@ -104,7 +104,7 @@ def fast_kron_vector_product(A: np.ndarray, B: np.ndarray, x: np.ndarray):
|
||||
# This will actually crash if x.shape[0] is not divisible by A.shape[0]
|
||||
bx = B * x.reshape(A.shape[0], round(x.shape[0] / A.shape[0]))
|
||||
# Then multiply a with the resulting vector
|
||||
y = A * bx
|
||||
y = A @ bx
|
||||
\end{code}
|
||||
|
||||
Um die oben erwähnte Laufzeit zu erreichen muss erst ein neuer Vektor berechnet werden, oben im Code \verb|bx| genannt, der eine Multiplikation von \verb|Bx_i| als Einträge hat.
|
||||
|
||||
Reference in New Issue
Block a user