File: stdlib_array.md

package info (click to toggle)
fortran-stdlib 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,008 kB
  • sloc: f90: 24,178; ansic: 1,244; cpp: 623; python: 119; makefile: 13
file content (87 lines) | stat: -rw-r--r-- 1,840 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
title: array
---

# The `stdlib_array` module

[TOC]

## Introduction

Module for index manipulation and array handling tasks.

## Procedures and methods provided


### `trueloc`

#### Status

Experimental

#### Description

Turn a logical mask into an index array by selecting all true values.
Provides similar functionality like the built-in `where` or the intrinsic procedures `merge` and `pack` when working with logical mask.
The built-in / intrinsics are usually preferable to `trueloc`, unless the access to the index array is required.

#### Syntax

`loc =` [[trueloc(function)]] `(array[, lbound])`

#### Class

Pure function.

#### Arguments

`array`: List of default logical arrays. This argument is `intent(in)`.

`lbound`: Lower bound of the array to index. This argument is `optional` and `intent(in)`.

#### Return value

Returns an array of default integer size, with a maximum length of `size(array)` elements.

#### Examples

```fortran
{!example/array/example_trueloc.f90!}
```


### `falseloc`

#### Status

Experimental

#### Description

Turn a logical mask into an index array by selecting all false values.
Provides similar functionality like the built-in `where` or the intrinsic procedures `merge` and `pack` when working with logical mask.
The built-in / intrinsics are usually preferable to `falseloc`, unless the access to the index array is required.

#### Syntax

`loc =` [[falseloc(function)]] `(array[, lbound])`

#### Class

Pure function.

#### Arguments

`array`: List of default logical arrays. This argument is `intent(in)`.

`lbound`: Lower bound of the array to index. This argument is `optional` and `intent(in)`.

#### Return value

Returns an array of default integer size, with a maximum length of `size(array)` elements.

#### Examples

```fortran
{!example/array/example_falseloc.f90!}
```