pyacs.lib.glinalg.odot
Scale block rows of G by vector a.
- pyacs.lib.glinalg.odot.odot(a, G)[source]
Scale block rows of G by vector a (element-wise then reshape).
G is treated as a stack of submatrices G_1,…,G_n; result is [a_1*G_1; …; a_n*G_n]. Implemented with numpy broadcasting. If G.shape = (n, m) and a.shape = (l,), then each block has n/l rows.
- Parameters:
a (numpy.ndarray) – 1D array of scalars (multipliers).
G (numpy.ndarray) – 2D array; number of rows must be divisible by len(a).
- Returns:
Matrix with same shape as G; each block of rows scaled by corresponding a[i].
- Return type:
numpy.ndarray