@@ -213,6 +213,32 @@ The function accepts the following arguments:
213
213
void c_daxpy( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
214
214
```
215
215
216
+ #### c_daxpy_ndarray( N, alpha, \* X, strideX, offsetX, \* Y, strideY, offsetY )
217
+
218
+ Multiplies a vector ` X ` by a constant and adds the result to ` Y ` using alternative indexing semantics.
219
+
220
+ ``` c
221
+ const double x[] = { 1.0, 2.0, 3.0, 4.0 };
222
+ double y[ ] = { 0.0, 0.0, 0.0, 0.0 };
223
+
224
+ c_daxpy ( 4, 5.0, x, 1, 0, y, 1, 0 );
225
+ ```
226
+
227
+ The function accepts the following arguments:
228
+
229
+ - **N**: `[in] CBLAS_INT` number of indexed elements.
230
+ - **alpha**: `[in] double` scalar constant.
231
+ - **X**: `[in] double*` input array.
232
+ - **strideX**: `[in] CBLAS_INT` index increment for `X`.
233
+ - **offsetX**: `[in] CBLAS_INT` starting index for `X`.
234
+ - **Y**: `[inout] double*` output array.
235
+ - **strideY**: `[in CBLAS_INT` index increment for `Y`.
236
+ - **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
237
+
238
+ ```c
239
+ void c_daxpy_ndarray( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
240
+ ```
241
+
216
242
</section >
217
243
218
244
<!-- /.usage -->
@@ -254,6 +280,14 @@ int main( void ) {
254
280
for ( int i = 0; i < 8; i++ ) {
255
281
printf( "y[ %i ] = %lf\n", i, y[ i ] );
256
282
}
283
+
284
+ // Compute `a*x + y`:
285
+ c_daxpy_ndarray( N, 5.0, x, strideX, 1, y, strideY, 7 );
286
+
287
+ // Print the result:
288
+ for ( int i = 0; i < 8; i++ ) {
289
+ printf( "y[ %i ] = %lf\n", i, y[ i ] );
290
+ }
257
291
}
258
292
```
259
293
0 commit comments