Compute norm of an array. Parameters ---------- X : array Data whose norm must be found. Returns ------- value : float Sum of squares of the input array X.
(X)
| 64 | |
| 65 | |
| 66 | def sum_squared(X): |
| 67 | """Compute norm of an array. |
| 68 | |
| 69 | Parameters |
| 70 | ---------- |
| 71 | X : array |
| 72 | Data whose norm must be found. |
| 73 | |
| 74 | Returns |
| 75 | ------- |
| 76 | value : float |
| 77 | Sum of squares of the input array X. |
| 78 | """ |
| 79 | X_flat = X.ravel(order="F" if np.isfortran(X) else "C") |
| 80 | return np.dot(X_flat, X_flat) |
| 81 | |
| 82 | |
| 83 | def _compute_row_norms(data): |
no outgoing calls