Skip to content

Commit e55458e

Browse files
committed
Document C APIs
1 parent eaf3deb commit e55458e

File tree

1 file changed

+200
-0
lines changed
  • lib/node_modules/@stdlib/ndarray/ctor

1 file changed

+200
-0
lines changed

lib/node_modules/@stdlib/ndarray/ctor/README.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,206 @@ Notes
27052705
27062706
- The function returns `-1` if unable to set an element and `0` otherwise.
27072707
2708+
* * *
2709+
2710+
#### stdlib_ndarray_set_ptr_value( \*arr, \*idx, \*v )
2711+
2712+
Sets an ndarray data element specified by a byte array pointer.
2713+
2714+
```c
2715+
int8_t stdlib_ndarray_set_ptr_value( const struct ndarray *arr, uint8_t *idx, const void *v );
2716+
```
2717+
2718+
The function accepts the following arguments:
2719+
2720+
- **arr**: `[in] struct ndarray*` input ndarray.
2721+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2722+
- **v**: `[in] void*` value to set.
2723+
2724+
Notes:
2725+
2726+
- The function does **not** perform bounds checking, and, thus, the function does **not** prevent you from overwriting **unowned** memory. Accordingly, the function **assumes** you know what you are doing.
2727+
- The function returns `-1` if unable to set an element and `0` otherwise.
2728+
- The function requires a pointer to a data value `v` in order to provide a generic API supporting ndarrays having different data types.
2729+
2730+
#### stdlib_ndarray_set_ptr_float64( \*idx, v )
2731+
2732+
Sets a double-precision floating-point ndarray data element specified by a byte array pointer.
2733+
2734+
```c
2735+
int8_t stdlib_ndarray_set_ptr_float64( uint8_t *idx, const double v );
2736+
```
2737+
2738+
The function accepts the following arguments:
2739+
2740+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2741+
- **v**: `[in] double` value to set.
2742+
2743+
Notes:
2744+
2745+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2746+
- The function always returns `0`.
2747+
2748+
#### stdlib_ndarray_set_ptr_float32( \*idx, v )
2749+
2750+
Sets a single-precision floating-point ndarray data element specified by a byte array pointer.
2751+
2752+
```c
2753+
int8_t stdlib_ndarray_set_ptr_float32( uint8_t *idx, const float v );
2754+
```
2755+
2756+
The function accepts the following arguments:
2757+
2758+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2759+
- **v**: `[in] float` value to set.
2760+
2761+
Notes:
2762+
2763+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2764+
- The function always returns `0`.
2765+
2766+
#### stdlib_ndarray_set_ptr_uint64( \*idx, v )
2767+
2768+
Sets an unsigned 64-bit integer ndarray data element specified by a byte array pointer.
2769+
2770+
```c
2771+
int8_t stdlib_ndarray_set_ptr_uint64( uint8_t *idx, const uint64_t v );
2772+
```
2773+
2774+
The function accepts the following arguments:
2775+
2776+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2777+
- **v**: `[in] uint64_t` value to set.
2778+
2779+
Notes:
2780+
2781+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2782+
- The function always returns `0`.
2783+
2784+
#### stdlib_ndarray_set_ptr_int64( \*idx, v )
2785+
2786+
Sets a signed 64-bit integer ndarray data element specified by a byte array pointer.
2787+
2788+
```c
2789+
int8_t stdlib_ndarray_set_ptr_int64( uint8_t *idx, const int64_t v );
2790+
```
2791+
2792+
The function accepts the following arguments:
2793+
2794+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2795+
- **v**: `[in] int64_t` value to set.
2796+
2797+
Notes:
2798+
2799+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2800+
- The function always returns `0`.
2801+
2802+
#### stdlib_ndarray_set_ptr_uint32( \*idx, v )
2803+
2804+
Sets an unsigned 32-bit integer ndarray data element specified by a byte array pointer.
2805+
2806+
```c
2807+
int8_t stdlib_ndarray_set_ptr_uint32( uint8_t *idx, const uint32_t v );
2808+
```
2809+
2810+
The function accepts the following arguments:
2811+
2812+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2813+
- **v**: `[in] uint32_t` value to set.
2814+
2815+
Notes:
2816+
2817+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2818+
- The function always returns `0`.
2819+
2820+
#### stdlib_ndarray_set_ptr_int32( \*idx, v )
2821+
2822+
Sets a signed 32-bit integer ndarray data element specified by a byte array pointer.
2823+
2824+
```c
2825+
int8_t stdlib_ndarray_set_ptr_int32( uint8_t *idx, const int32_t v );
2826+
```
2827+
2828+
The function accepts the following arguments:
2829+
2830+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2831+
- **v**: `[in] int32_t` value to set.
2832+
2833+
Notes:
2834+
2835+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2836+
- The function always returns `0`.
2837+
2838+
#### stdlib_ndarray_set_ptr_uint16( \*idx, v )
2839+
2840+
Sets an unsigned 16-bit integer ndarray data element specified by a byte array pointer.
2841+
2842+
```c
2843+
int8_t stdlib_ndarray_set_ptr_uint16( uint8_t *idx, const uint16_t v );
2844+
```
2845+
2846+
The function accepts the following arguments:
2847+
2848+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2849+
- **v**: `[in] uint16_t` value to set.
2850+
2851+
Notes:
2852+
2853+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2854+
- The function always returns `0`.
2855+
2856+
#### stdlib_ndarray_set_ptr_int16( \*idx, v )
2857+
2858+
Sets a signed 16-bit integer ndarray data element specified by a byte array pointer.
2859+
2860+
```c
2861+
int8_t stdlib_ndarray_set_ptr_int16( uint8_t *idx, const int16_t v );
2862+
```
2863+
2864+
The function accepts the following arguments:
2865+
2866+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2867+
- **v**: `[in] int16_t` value to set.
2868+
2869+
Notes:
2870+
2871+
- The function has no way of determining whether `idx` actually points to a compatible memory address. Accordingly, overwriting **unowned** memory is possible, and this function **assumes** you know what you are doing.
2872+
- The function always returns `0`.
2873+
2874+
#### stdlib_ndarray_set_ptr_uint8( \*idx, v )
2875+
2876+
Sets an unsigned 8-bit integer ndarray data element specified by a byte array pointer.
2877+
2878+
```c
2879+
int8_t stdlib_ndarray_set_ptr_uint8( uint8_t *idx, const uint8_t v );
2880+
```
2881+
2882+
The function accepts the following arguments:
2883+
2884+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2885+
- **v**: `[in] uint8_t` value to set.
2886+
2887+
Notes:
2888+
2889+
- The function always returns `0`.
2890+
2891+
#### stdlib_ndarray_set_ptr_int8( \*idx, v )
2892+
2893+
Sets a signed 8-bit integer ndarray data element specified by a byte array pointer.
2894+
2895+
```c
2896+
int8_t stdlib_ndarray_set_ptr_int8( uint8_t *idx, const int8_t v );
2897+
```
2898+
2899+
The function accepts the following arguments:
2900+
2901+
- **idx**: `[in] uint8_t*` byte array pointer to an ndarray data element.
2902+
- **v**: `[in] int8_t` value to set.
2903+
2904+
Notes:
2905+
2906+
- The function always returns `0`.
2907+
27082908
</section>
27092909

27102910
<!-- /.usage -->

0 commit comments

Comments
 (0)