triu
Returns an array with all elements below the k-th diagonal set to zero.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
COO
|
The input array. |
required |
k
|
int
|
The diagonal below which elements are set to zero. The default is zero, which corresponds to the main diagonal. |
0
|
Returns:
Type | Description |
---|---|
COO
|
The output upper-triangular matrix. |
Raises:
Type | Description |
---|---|
ValueError
|
If |
See Also
numpy.triu
: NumPy equivalent function
Source code in sparse/numba_backend/_coo/common.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 |
|