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 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 sfill =require( '@stdlib/blas/ext/base/sfill' );
132
131
133
-
varrand=discreteUniform( -100, 100 );
134
-
135
-
var x =filledarrayBy( 10, 'float32', rand );
132
+
varx=discreteUniform( 10, -100, 100, {
133
+
'dtype':'float32'
134
+
});
136
135
console.log( x );
137
136
138
137
sfill( x.length, 5.0, x, 1 );
@@ -143,6 +142,126 @@ console.log( x );
143
142
144
143
<!-- /.examples -->
145
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/sfill.h"
169
+
```
170
+
171
+
#### c_sfill( N, alpha, \*X, strideX )
172
+
173
+
Fills a single-precision floating-point strided array `X` with a specified scalar constant `alpha`.
174
+
175
+
```c
176
+
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };
177
+
178
+
c_sfill( 4, 5.0f, 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] float` scalar constant.
186
+
- **X**: `[out] float*` input array.
187
+
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
0 commit comments