cmatrix.Matrix.triangle

Matrix.triangle()

Get the triangle (respectively up or down) of the self matrix

Parameters

type

Description

mode

int

Mode mean : 1 sup, 0 inf

Returns
Matrix

The triangle matrix from self matrix

See also

clone()
set_ij()

Examples

>>> t=gaussian(5,0,0)
>>> t.triangle(0) # inferior profile
>>> Print(t)
| +1.000 | +0.000 | +0.000 | +0.000 | +0.000 |
| +4.000 | +16.000 | +0.000 | +0.000 | +0.000 |
| +6.000 | +24.000 | +36.000 | +0.000 | +0.000 |
| +4.000 | +16.000 | +24.000 | +16.000 | +0.000 |
| +1.000 | +4.000 | +6.000 | +4.000 | +1.000 |
printed
>>> t=gaussian(5,0,0)
>>> t.triangle(1) # superior profile
>>> Print(t)
| +0.000 | +4.000 | +6.000 | +4.000 | +1.000 |
| +0.000 | +0.000 | +24.000 | +16.000 | +4.000 |
| +0.000 | +0.000 | +0.000 | +24.000 | +6.000 |
| +0.000 | +0.000 | +0.000 | +0.000 | +4.000 |
| +0.000 | +0.000 | +0.000 | +0.000 | +0.000 |
printed