[NumCS] ++ Code Examples

This commit is contained in:
RobinB27
2025-10-06 15:09:48 +02:00
parent 573ee05077
commit 5634009e6b
4 changed files with 21 additions and 16 deletions

View File

@@ -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.