You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`huge(0)`|`'inf', 'Inf'`| Maximum absolute value \( \max_i{ \left|a_i\right| } \)|
1416
+
1417
+
`dim` (optional): Shall be a scalar `integer` value with a value in the range from `1` to `n`, where `n` is the rank of the array. It is an `intent(in)` argument.
1418
+
1419
+
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument. If `err` is not present, the function is `pure`.
1420
+
1421
+
### Return value
1422
+
1423
+
By default, the return value `x` is a scalar, and contains the norm as evaluated over all elements of the generic-rank array \( A \).
1424
+
If the optional `dim` argument is present, `x` is a rank `n-1` array with the same shape as \( A \) except
1425
+
for dimension `dim`, that is collapsed. Each element of `x` contains the 1D norm of the elements of \( A \),
1426
+
evaluated along dimension `dim` only.
1427
+
1428
+
Raises `LINALG_ERROR` if the requested norm type is invalid.
1429
+
Raises `LINALG_VALUE_ERROR` if any of the arguments has an invalid size.
1430
+
If `err` is not present, exceptions trigger an `error stop`.
1431
+
1432
+
### Example
1433
+
1434
+
```fortran
1435
+
{!example/linalg/example_norm.f90!}
1436
+
```
1437
+
1438
+
## `get_norm` - Computes the vector norm of a generic-rank array.
1439
+
1440
+
### Status
1441
+
1442
+
Experimental
1443
+
1444
+
### Description
1445
+
1446
+
This `pure subroutine` interface computes one of several vector norms of `real` or `complex` array \( A \), depending on
1447
+
the value of the `order` input argument. \( A \) may be an array of any rank.
1448
+
1449
+
Result `nrm` returns a `real`, scalar norm value for the whole array; if `dim` is specified, `nrm` is a rank-1
1450
+
array with the same shape as \(A \) and dimension `dim` collapsed, containing all norms evaluated along `dim`.
`a`: Shall be a rank-n `real` or `complex` array containing the data. It is an `intent(in)` argument.
1459
+
1460
+
`nrm`: if `dim` is absent, shall be a scalar with the norm evaluated over all the elements of the array. Otherwise, an array of rank `n-1`, and a shape similar
1461
+
to that of `a` with dimension `dim` dropped.
1462
+
1463
+
`order`: Shall be an `integer` value or a `character` flag that specifies the norm type, as follows. It is an `intent(in)` argument.
|`huge(0)`|`'inf', 'Inf'`| Maximum absolute value \( \max_i{ \left|a_i\right| } \)|
1472
+
1473
+
`dim` (optional): Shall be a scalar `integer` value with a value in the range from `1` to `n`, where `n` is the rank of the array. It is an `intent(in)` argument.
1474
+
1475
+
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument. If `err` is not present, the function is `pure`.
1476
+
1477
+
### Return value
1478
+
1479
+
By default, the return value `nrm` is a scalar, and contains the norm as evaluated over all elements of the generic-rank array \( A \).
1480
+
If the optional `dim` argument is present, `nrm` is a rank `n-1` array with the same shape as \( A \) except
1481
+
for dimension `dim`, that is collapsed. Each element of `nrm` contains the 1D norm of the elements of \( A \),
1482
+
evaluated along dimension `dim` only.
1483
+
1484
+
Raises `LINALG_ERROR` if the requested norm type is invalid.
1485
+
Raises `LINALG_VALUE_ERROR` if any of the arguments has an invalid size.
1486
+
If `err` is not present, exceptions trigger an `error stop`.
0 commit comments