|
| 1 | +<!-- |
| 2 | +
|
| 3 | +@license Apache-2.0 |
| 4 | +
|
| 5 | +Copyright (c) 2024 The Stdlib Authors. |
| 6 | +
|
| 7 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +you may not use this file except in compliance with the License. |
| 9 | +You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | +Unless required by applicable law or agreed to in writing, software |
| 14 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +See the License for the specific language governing permissions and |
| 17 | +limitations under the License. |
| 18 | +
|
| 19 | +--> |
| 20 | + |
| 21 | +# resolve |
| 22 | + |
| 23 | +> Return the enumeration constant associated with a supported BLAS memory layout value. |
| 24 | +
|
| 25 | +<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> |
| 26 | + |
| 27 | +<section class="intro"> |
| 28 | + |
| 29 | +</section> |
| 30 | + |
| 31 | +<!-- /.intro --> |
| 32 | + |
| 33 | +<!-- Package usage documentation. --> |
| 34 | + |
| 35 | +<section class="usage"> |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +```javascript |
| 40 | +var resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); |
| 41 | +``` |
| 42 | + |
| 43 | +#### resolve( layout ) |
| 44 | + |
| 45 | +Returns the enumeration constant associated with a BLAS memory layout value. |
| 46 | + |
| 47 | +```javascript |
| 48 | +var str2enum = require( '@stdlib/blas/base/layout-str2enum' ); |
| 49 | + |
| 50 | +var v = resolve( 'row-major' ); |
| 51 | +// returns <number> |
| 52 | + |
| 53 | +v = resolve( str2enum( 'row-major' ) ); |
| 54 | +// returns <number> |
| 55 | +``` |
| 56 | + |
| 57 | +If unable to resolve an enumeration constant, the function returns `null`. |
| 58 | + |
| 59 | +```javascript |
| 60 | +var v = resolve( 'beep' ); |
| 61 | +// returns null |
| 62 | +``` |
| 63 | + |
| 64 | +</section> |
| 65 | + |
| 66 | +<!-- /.usage --> |
| 67 | + |
| 68 | +<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 69 | + |
| 70 | +<section class="notes"> |
| 71 | + |
| 72 | +## Notes |
| 73 | + |
| 74 | +- Downstream consumers of this function should **not** rely on specific integer values (e.g., `ROW_MAJOR == 0`). Instead, the function should be used in an opaque manner. |
| 75 | + |
| 76 | +</section> |
| 77 | + |
| 78 | +<!-- /.notes --> |
| 79 | + |
| 80 | +<!-- Package usage examples. --> |
| 81 | + |
| 82 | +<section class="examples"> |
| 83 | + |
| 84 | +## Examples |
| 85 | + |
| 86 | +<!-- eslint no-undef: "error" --> |
| 87 | + |
| 88 | +```javascript |
| 89 | +var resolve = require( '@stdlib/blas/base/layout-resolve-enum' ); |
| 90 | + |
| 91 | +var v = resolve( 'row-major' ); |
| 92 | +// returns <number> |
| 93 | + |
| 94 | +v = resolve( 'column-major' ); |
| 95 | +// returns <number> |
| 96 | +``` |
| 97 | + |
| 98 | +</section> |
| 99 | + |
| 100 | +<!-- /.examples --> |
| 101 | + |
| 102 | +<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 103 | + |
| 104 | +<section class="references"> |
| 105 | + |
| 106 | +</section> |
| 107 | + |
| 108 | +<!-- /.references --> |
| 109 | + |
| 110 | +<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> |
| 111 | + |
| 112 | +<section class="related"> |
| 113 | + |
| 114 | +</section> |
| 115 | + |
| 116 | +<!-- /.related --> |
| 117 | + |
| 118 | +<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
| 119 | + |
| 120 | +<section class="links"> |
| 121 | + |
| 122 | +</section> |
| 123 | + |
| 124 | +<!-- /.links --> |
0 commit comments