You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element
53
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element
The function has the following additional parameters:
94
94
95
-
-**offset**: starting index.
95
+
-**offsetX**: starting index.
96
96
97
-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array
97
+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array
var discreteUniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
130
-
var filledarrayBy =require( '@stdlib/array/filled-by' );
129
+
var discreteUniform =require( '@stdlib/random/array/discrete-uniform' );
131
130
var dapx =require( '@stdlib/blas/ext/base/dapx' );
132
131
133
-
var x =filledarrayBy( 10, 'float64', discreteUniform( -100, 100 ) );
132
+
var x =discreteUniform( 10, -100, 100, {
133
+
'dtype':'float64'
134
+
});
134
135
console.log( x );
135
136
136
137
dapx( x.length, 5.0, x, 1 );
@@ -141,6 +142,126 @@ console.log( x );
141
142
142
143
<!-- /.examples -->
143
144
145
+
<!-- C interface documentation. -->
146
+
147
+
* * *
148
+
149
+
<sectionclass="c">
150
+
151
+
## C APIs
152
+
153
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
154
+
155
+
<sectionclass="intro">
156
+
157
+
</section>
158
+
159
+
<!-- /.intro -->
160
+
161
+
<!-- C usage documentation. -->
162
+
163
+
<sectionclass="usage">
164
+
165
+
### Usage
166
+
167
+
```c
168
+
#include"stdlib/blas/ext/base/dapx.h"
169
+
```
170
+
171
+
#### c_dapx( N, alpha, \*X, strideX )
172
+
173
+
Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array.
174
+
175
+
```c
176
+
double x[] = { 1.0, 2.0, 3.0, 4.0 };
177
+
178
+
c_dapx( 4, 5.0, x, 1 );
179
+
180
+
```
181
+
182
+
The function accepts the following arguments:
183
+
184
+
- **N**: `[in] CBLAS_INT` number of indexed elements.
185
+
- **alpha**: `[in] double` scalar constant.
186
+
- **X**: `[inout] double*` input array.
187
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
0 commit comments