Skip to content

Commit b015d9f

Browse files
committed
Update specification
1 parent 7ddcbcc commit b015d9f

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

doc/specs/stdlib_array.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ Turn a logical mask into an index array by selecting all true values.
2525

2626
#### Syntax
2727

28-
`call [[trueloc(function)]] (array[, lbound])`
28+
`loc = [[trueloc(function)]] (array[, lbound])`
29+
30+
#### Class
31+
32+
Pure function.
2933

3034
#### Arguments
3135

@@ -40,14 +44,14 @@ Returns an array of default integer size, with a maximum length of `size(array)`
4044
#### Examples
4145

4246
```fortran
43-
program demo
47+
program demo_trueloc
4448
use stdlib_array, only : trueloc
4549
implicit none
4650
real, allocatable :: array(:)
4751
allocate(array(500))
4852
call random_number(array)
4953
array(trueloc(array > 0.5)) = 0.0
50-
end program demo
54+
end program demo_trueloc
5155
```
5256

5357

@@ -63,7 +67,11 @@ Turn a logical mask into an index array by selecting all false values.
6367

6468
#### Syntax
6569

66-
`call [[falseloc(function)]] (array[, lbound])`
70+
`loc = [[falseloc(function)]] (array[, lbound])`
71+
72+
#### Class
73+
74+
Pure function.
6775

6876
#### Arguments
6977

@@ -78,12 +86,12 @@ Returns an array of default integer size, with a maximum length of `size(array)`
7886
#### Examples
7987

8088
```fortran
81-
program demo
89+
program demo_falseloc
8290
use stdlib_array, only : falseloc
8391
implicit none
8492
real, allocatable :: array(:)
8593
allocate(array(-200:200))
8694
call random_number(array)
8795
array(falseloc(array < 0.5), lbound(array)) = 0.0
88-
end program demo
96+
end program demo_falseloc
8997
```

src/stdlib_array.f90

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
! SPDX-Identifier: MIT
22

33
!> Module for index manipulation and general array handling
4+
!>
5+
!> The specification of this module is available [here](../page/specs/stdlib_array.html).
46
module stdlib_array
57
implicit none
68
private
@@ -9,7 +11,10 @@ module stdlib_array
911

1012
contains
1113

12-
!> Return the positions of the true elements in array
14+
!> Version: experimental
15+
!>
16+
!> Return the positions of the true elements in array.
17+
!> [Specification](../page/specs/stdlib_array.html#trueloc)
1318
pure function trueloc(array, lbound) result(loc)
1419
!> Mask of logicals
1520
logical, intent(in) :: array(:)
@@ -21,7 +26,10 @@ pure function trueloc(array, lbound) result(loc)
2126
call logicalloc(loc, array, .true., lbound)
2227
end function trueloc
2328

24-
!> Return the positions of the false elements in array
29+
!> Version: experimental
30+
!>
31+
!> Return the positions of the false elements in array.
32+
!> [Specification](../page/specs/stdlib_array.html#falseloc)
2533
pure function falseloc(array, lbound) result(loc)
2634
!> Mask of logicals
2735
logical, intent(in) :: array(:)

0 commit comments

Comments
 (0)