我要评分
获取效率
正确性
完整性
易理解

?gerc

That is, . alpha is a multiplication coefficient, A is a general m*n matrix, x is a vector including m elements, and y is a vector including n elements.

Interface Definition

C interface:

void cblas_cgerc(const enum CBLAS_ORDER order, const BLASINT M, const BLASINT N, const void *alpha, const void *X, const BLASINT incX, const void *Y, const BLASINT incY, void *A, const BLASINT lda);

void cblas_zgerc(const enum CBLAS_ORDER order, const BLASINT M, const BLASINT N, const void *alpha, const void *X, const BLASINT incX, const void *Y, const BLASINT incY, void *A, const BLASINT lda);

Fortran interface:

CALL CGERC(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)

CALL ZGERC(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)

Parameters

Parameter

Type

Description

Input/Output

order

Enumeration type CBLAS_ORDER

Indicates whether the matrix is in row- or column-major order.

Input

M

Integer

Number of rows in matrix A.

Input

N

Integer

Number of columns in matrix A.

Input

alpha

  • Single-precision complex type for cgerc
  • Double-precision complex type for zgerc

Multiplication coefficient.

Input

X

  • Single-precision complex type for cgerc
  • Double-precision complex type for zgerc

Matrix X. The vector scale is at least 1+(m-1)*abs(incX).

Input

incX

Integer

Increment for elements in vector X. The value cannot be 0.

Input

Y

  • Single-precision complex type for cgerc
  • Double-precision complex type for zgerc

Matrix Y. The vector scale is at least 1+(n-1)*abs(incY).

Input

incY

Integer

Increment for elements in vector Y. The value cannot be 0.

Input

A

  • Single-precision complex type for cgerc
  • Double-precision complex type for zgerc

Matrix A(lda, n).

Output

lda

Integer

Length of the leading dimension in matrix A. If A is a column-store matrix, lda must be greater than or equal to max(1, m). Otherwise, lda must be greater than or equal to max(1, n).

Input

Dependency

#include "kblas.h"

Examples

C interface:

    int m = 2, n = 2, lda = 2; 
    float alpha[2] = {1.0, 2.0}; 
    int incx = 1, incy = 1; 
    float x[4] = {1.0, 2.0, 3.0, 4.0}; 
    float y[4] = {2.0, 3.0, 4.0, 2.0}; 
    float a[8] = {-1.0, 2.0, 2.0, 2.0, 3.0, 4.0, 5.0, 6.0}; 
 
    cblas_cgerc(CblasColMajor, m, n, alpha, x, incx, y, incy, a, lda); 
    /** 
     *  Output A: 
     *            (5.000000, 19.000000), (-1.000000, 26.000000) 
     *            (22.000000, 37.000000), (5.000000, 56.000000) 
     */

Fortran interface:

      INTEGER :: M=2 
      INTEGER :: N=2 
      INTEGER :: LDA=2 
      INTEGER :: INCX=1 
      INTEGER :: INCY=1 
      COMPLEX(4) :: ALPHA=(1.0, 2.0) 
      COMPLEX(4) :: A(2, 2) 
      DATA A/(-1.0, 2.0), (2.0, 2.0), 
     $       (3.0, 4.0), (5.0, 6.0)/ 
      COMPLEX(4) :: X(2) 
      DATA X/(1.0, 2.0), (3.0, 4.0)/ 
      COMPLEX(4) :: Y(2) 
      DATA Y/(2.0, 3.0), (4.0, 2.0)/ 
      EXTERNAL CGERC 
      CALL CGERC(M, N, ALPHA, X, INCX, Y, INCY, A, LDA) 
 
*     Output A: 
*             (5.000000, 19.000000), (-1.000000, 26.000000) 
*             (22.000000, 37.000000), (5.000000, 56.000000)