Skip to content

Commit 9e020a8

Browse files
committed
move get_norm before norm
1 parent f271688 commit 9e020a8

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

doc/specs/stdlib_linalg.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,25 +1382,31 @@ If `err` is not present, exceptions trigger an `error stop`.
13821382
{!example/linalg/example_inverse_function.f90!}
13831383
```
13841384

1385-
## `norm` - Computes the vector norm of a generic-rank array.
1385+
## `get_norm` - Computes the vector norm of a generic-rank array.
13861386

13871387
### Status
13881388

13891389
Experimental
13901390

13911391
### Description
13921392

1393-
This function computes one of several vector norms of `real` or `complex` array \( A \), depending on
1393+
This `pure subroutine` interface computes one of several vector norms of `real` or `complex` array \( A \), depending on
13941394
the value of the `order` input argument. \( A \) may be an array of any rank.
13951395

1396+
Result `nrm` returns a `real`, scalar norm value for the whole array; if `dim` is specified, `nrm` is a rank n-1
1397+
array with the same shape as \(A \) and dimension `dim` dropped, containing all norms evaluated along `dim`.
1398+
13961399
### Syntax
13971400

1398-
`x = ` [[stdlib_linalg(module):norm(interface)]] `(a, order, [, dim, err])`
1401+
`call ` [[stdlib_linalg(module):get_norm(interface)]] `(a, nrm, order, [, dim, err])`
13991402

14001403
### Arguments
14011404

14021405
`a`: Shall be a rank-n `real` or `complex` array containing the data. It is an `intent(in)` argument.
14031406

1407+
`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
1408+
to that of `a` with dimension `dim` dropped.
1409+
14041410
`order`: Shall be an `integer` value or a `character` flag that specifies the norm type, as follows. It is an `intent(in)` argument.
14051411

14061412
| Integer input | Character Input | Norm type |
@@ -1417,9 +1423,9 @@ the value of the `order` input argument. \( A \) may be an array of any rank.
14171423

14181424
### Return value
14191425

1420-
By default, the return value `x` is a scalar, and contains the norm as evaluated over all elements of the generic-rank array \( A \).
1421-
If the optional `dim` argument is present, `x` is a rank `n-1` array with the same shape as \( A \) except
1422-
for dimension `dim`, that is dropped. Each element of `x` contains the 1D norm of the elements of \( A \),
1426+
By default, the return value `nrm` is a scalar, and contains the norm as evaluated over all elements of the generic-rank array \( A \).
1427+
If the optional `dim` argument is present, `nrm` is a rank `n-1` array with the same shape as \( A \) except
1428+
for dimension `dim`, that is collapsed. Each element of `nrm` contains the 1D norm of the elements of \( A \),
14231429
evaluated along dimension `dim` only.
14241430

14251431
Raises `LINALG_ERROR` if the requested norm type is invalid.
@@ -1429,34 +1435,28 @@ If `err` is not present, exceptions trigger an `error stop`.
14291435
### Example
14301436

14311437
```fortran
1432-
{!example/linalg/example_norm.f90!}
1438+
{!example/linalg/example_get_norm.f90!}
14331439
```
14341440

1435-
## `get_norm` - Computes the vector norm of a generic-rank array.
1441+
## `norm` - Computes the vector norm of a generic-rank array.
14361442

14371443
### Status
14381444

14391445
Experimental
14401446

14411447
### Description
14421448

1443-
This `pure subroutine` interface computes one of several vector norms of `real` or `complex` array \( A \), depending on
1449+
This function computes one of several vector norms of `real` or `complex` array \( A \), depending on
14441450
the value of the `order` input argument. \( A \) may be an array of any rank.
14451451

1446-
Result `nrm` returns a `real`, scalar norm value for the whole array; if `dim` is specified, `nrm` is a rank n-1
1447-
array with the same shape as \(A \) and dimension `dim` dropped, containing all norms evaluated along `dim`.
1448-
14491452
### Syntax
14501453

1451-
`call ` [[stdlib_linalg(module):get_norm(interface)]] `(a, nrm, order, [, dim, err])`
1454+
`x = ` [[stdlib_linalg(module):norm(interface)]] `(a, order, [, dim, err])`
14521455

14531456
### Arguments
14541457

14551458
`a`: Shall be a rank-n `real` or `complex` array containing the data. It is an `intent(in)` argument.
14561459

1457-
`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
1458-
to that of `a` with dimension `dim` dropped.
1459-
14601460
`order`: Shall be an `integer` value or a `character` flag that specifies the norm type, as follows. It is an `intent(in)` argument.
14611461

14621462
| Integer input | Character Input | Norm type |
@@ -1473,9 +1473,9 @@ to that of `a` with dimension `dim` dropped.
14731473

14741474
### Return value
14751475

1476-
By default, the return value `nrm` is a scalar, and contains the norm as evaluated over all elements of the generic-rank array \( A \).
1477-
If the optional `dim` argument is present, `nrm` is a rank `n-1` array with the same shape as \( A \) except
1478-
for dimension `dim`, that is collapsed. Each element of `nrm` contains the 1D norm of the elements of \( A \),
1476+
By default, the return value `x` is a scalar, and contains the norm as evaluated over all elements of the generic-rank array \( A \).
1477+
If the optional `dim` argument is present, `x` is a rank `n-1` array with the same shape as \( A \) except
1478+
for dimension `dim`, that is dropped. Each element of `x` contains the 1D norm of the elements of \( A \),
14791479
evaluated along dimension `dim` only.
14801480

14811481
Raises `LINALG_ERROR` if the requested norm type is invalid.
@@ -1485,5 +1485,7 @@ If `err` is not present, exceptions trigger an `error stop`.
14851485
### Example
14861486

14871487
```fortran
1488-
{!example/linalg/example_get_norm.f90!}
1488+
{!example/linalg/example_norm.f90!}
14891489
```
1490+
1491+

0 commit comments

Comments
 (0)