Skip to content

Commit ff513b9

Browse files
authored
chore: minor clean-up
Signed-off-by: Shabareesh Shetty <[email protected]>
1 parent d71215a commit ff513b9

File tree

1 file changed

+22
-63
lines changed
  • lib/node_modules/@stdlib/blas/base/dgemv/include/stdlib/blas/base

1 file changed

+22
-63
lines changed

lib/node_modules/@stdlib/blas/base/dgemv/include/stdlib/blas/base/dgemv_cblas.h

Lines changed: 22 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,74 +16,33 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/blas/base/dgemv.h"
20-
#include "stdlib/blas/base/dgemv_cblas.h"
19+
/**
20+
* Header file containing function declarations for the C interface to the BLAS Level 2 routine `dgemv`.
21+
*/
22+
#ifndef DGEMV_H
23+
#define DGEMV_H
24+
2125
#include "stdlib/blas/base/shared.h"
22-
#include "stdlib/strided/base/min_view_buffer_index.h"
23-
#include "stdlib/ndarray/base/min_view_buffer_index.h"
26+
27+
/*
28+
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
29+
*/
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
2433

2534
/**
26-
* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix.
27-
*
28-
* @param order storage layout
29-
* @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed
30-
* @param M number of rows in the matrix `A`
31-
* @param N number of columns in the matrix `A`
32-
* @param alpha scalar constant
33-
* @param A input matrix
34-
* @param LDA stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
35-
* @param x first input vector
36-
* @param strideX `x` stride length
37-
* @param beta scalar constant
38-
* @param y second input vector
39-
* @param strideY `y` stride length
40-
* @return output value
35+
* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix.
4136
*/
42-
double API_SUFFIX(c_dgemv)( const CBLAS_LAYOUT order, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT LDA, const double *x, const CBLAS_INT strideX, const double beta, const double *y, const CBLAS_INT strideY ) {
43-
CBLAS_INT sx = strideX;
44-
CBLAS_INT sy = strideY;
45-
if ( sx < 0 ) {
46-
sx = -sx;
47-
}
48-
if ( sy < 0 ) {
49-
sy = -sy;
50-
}
51-
return API_SUFFIX(cblas_dgemv)( order, trans, M, N, alpha, A, LDA, x, sx, beta, y, sy );
52-
}
37+
void API_SUFFIX(c_dgemv)( const CBLAS_LAYOUT order, const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT LDA, const double *X, const CBLAS_INT strideX, const double beta, double *Y, const CBLAS_INT strideY );
5338

5439
/**
55-
* Performs one of the matrix-vector operations `y = α*A*x + β*y` or `y = α*A^T*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are vectors, and `A` is an `M` by `N` matrix.
56-
*
57-
* @param trans specifies whether `A` should be transposed, conjugate-transposed, or not transposed
58-
* @param M number of rows in the matrix `A`
59-
* @param N number of columns in the matrix `A`
60-
* @param alpha scalar constant
61-
* @param A input matrix
62-
* @param strideA1 stride of the first dimension of `A`
63-
* @param strideA1 stride of the second dimension of `A`
64-
* @param offsetA starting index for `A`
65-
* @param x first input vector
66-
* @param strideX `x` stride length
67-
* @param offsetX starting index for `x`
68-
* @param beta scalar constant
69-
* @param y second input vector
70-
* @param strideY `y` stride length
71-
* @param offsetY starting index for `Y`
72-
* @return output value
40+
* Performs one of the matrix-vector operations `Y = α*A*X + β*Y` or `Y = α*A^T*X + β*Y`, where `α` and `β` are scalars, `X` and `Y` are vectors, and `A` is an `M` by `N` matrix using alternative indexing semantics.
7341
*/
74-
double API_SUFFIX(c_dgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *x, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double beta, const double *y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
75-
CBLAS_INT sx = strideX;
76-
CBLAS_INT sy = strideY;
77-
if ( sx < 0 ) {
78-
sx = -sx;
79-
}
80-
if ( sy < 0 ) {
81-
sy = -sy;
82-
}
83-
x += stdlib_strided_min_view_buffer_index( N, strideX, offsetX ); // adjust array pointer
84-
y += stdlib_strided_min_view_buffer_index( N, strideY, offsetY ); // adjust array pointer
85-
const int64_t shape[] = { M, N };
86-
const int64_t strides[] = { strideA1, strideA2 };
87-
A += stdlib_ndarray_min_view_buffer_index( 2, shape, strides, offsetA ); // adjust array pointer
88-
return API_SUFFIX(cblas_dgemv)( order, trans, M, N, alpha, A, LDA, x, sx, beta, y, sy );
42+
void API_SUFFIX(c_dgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double beta, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
43+
44+
#ifdef __cplusplus
8945
}
46+
#endif
47+
48+
#endif // !DGEMV_H

0 commit comments

Comments
 (0)