jax_privacy.matrix_factorization.streaming_matrix.diagonal

jax_privacy.matrix_factorization.streaming_matrix.diagonal(diag)[source]

An implicit representation of a diagonal matrix.

The returned StreamingMatrix represents an infinitely large diagonal matrix. The diagonal elements are taken from the provided array diag up to row n = diag.size, and is equal to diag[-1] beyond that point.

Parameters:

diag (Array) – A 1D array of diagonal elements.

Return type:

StreamingMatrix

Returns:

A StreamingMatrix representing the corresponding diagonal matrix.