cupyx.scipy.sparse.linalg.matrix_power#
- cupyx.scipy.sparse.linalg.matrix_power(A, power)[source]#
Raise a square matrix to the integer power
power.For non-negative integers,
A**poweris computed using repeated matrix multiplications. Negative integers are not supported.- Parameters:
A (cupyx.scipy.sparse.spmatrix or cupyx.scipy.sparse.sparray) – Square sparse array or matrix to raise to the power.
power (int) – Non-negative integer exponent.
- Returns:
Araised topower. Forpower >= 1the result has the same shape and class asA(its sparse format may differ).power == 0returns the identity built byeye_array()– acsr_array(scipy returns adia_array); like scipy this is an array even whenAis a matrix.- Return type:
cupyx.scipy.sparse.spmatrix or cupyx.scipy.sparse.sparray
See also