Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include "cblas.h"
00011 #include "cblas_f77.h"
00012 void cblas_zgerc(const enum CBLAS_ORDER order, const int M, const int N,
00013 const void *alpha, const void *X, const int incX,
00014 const void *Y, const int incY, void *A, const int lda)
00015 {
00016 #ifdef F77_INT
00017 F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_incX=incX, F77_incY=incY;
00018 #else
00019 #define F77_M M
00020 #define F77_N N
00021 #define F77_incX incX
00022 #define F77_incY incy
00023 #define F77_lda lda
00024 #endif
00025
00026 int n, i, tincy, incy=incY;
00027 double *y=(double *)Y, *yy=(double *)Y, *ty, *st;
00028
00029 extern int CBLAS_CallFromC;
00030 extern int RowMajorStrg;
00031 RowMajorStrg = 0;
00032
00033 CBLAS_CallFromC = 1;
00034 if (order == CblasColMajor)
00035 {
00036 F77_zgerc( &F77_M, &F77_N, alpha, X, &F77_incX, Y, &F77_incY, A,
00037 &F77_lda);
00038 } else if (order == CblasRowMajor)
00039 {
00040 RowMajorStrg = 1;
00041 if (N > 0)
00042 {
00043 n = N << 1;
00044 y = malloc(n*sizeof(double));
00045
00046 ty = y;
00047 if( incY > 0 ) {
00048 i = incY << 1;
00049 tincy = 2;
00050 st= y+n;
00051 } else {
00052 i = incY *(-2);
00053 tincy = -2;
00054 st = y-2;
00055 y +=(n-2);
00056 }
00057 do
00058 {
00059 *y = *yy;
00060 y[1] = -yy[1];
00061 y += tincy ;
00062 yy += i;
00063 }
00064 while (y != st);
00065 y = ty;
00066
00067 #ifdef F77_INT
00068 F77_incY = 1;
00069 #else
00070 incy = 1;
00071 #endif
00072 }
00073 else y = (double *) Y;
00074
00075 F77_zgeru( &F77_N, &F77_M, alpha, y, &F77_incY, X, &F77_incX, A,
00076 &F77_lda);
00077 if(Y!=y)
00078 free(y);
00079
00080 } else cblas_xerbla(1, "cblas_zgerc", "Illegal Order setting, %d\n", order);
00081 CBLAS_CallFromC = 0;
00082 RowMajorStrg = 0;
00083 return;
00084 }