fix windows compilation 89/10189/1
Antoine ELIAS [Thu, 10 Jan 2013 19:17:17 +0000 (20:17 +0100)]
Change-Id: I92446b3856be5ee9796f6e7990ecf1af03ff535b

scilab/modules/arnoldi/src/c/eigs.c
scilab/modules/arnoldi/src/c/eigs_dependencies.c
scilab/modules/commons/src/c/core_Import.def

index e42e9c5..13830b3 100644 (file)
 /*--------------------------------------------------------------------------*/
 
 /*--------------------------------------------------------------------------*/
-// dgemm performs one of the matrix-matrix operations
-extern int C2F(dgemm)(char* transa, char* transb, int* m, int* n, int* k,
-                      double* alpha, double* A, int* lda, double* B, int* ldb,
-                      double* beta, double* C, int* ldc);
-// zgemm performs one of the matrix-matrix operations
-extern int C2F(zgemm)(char* transa, char* transb, int* m, int* n, int* k,
-                      doublecomplex* alpha, doublecomplex* A, int* lda, doublecomplex* B,
-                      int* ldb, doublecomplex* beta, doublecomplex* C, int* ldc);
-
 // dgemv performs matrix-vector operations
 extern int C2F(dgemv) (char* trans, int* m, int* n, double* alpha, double* A, int* lda,
                        double* x, int* incx, double* beta, double* y, int* incy);
@@ -121,6 +112,18 @@ extern int C2F(zneupd)(int * rvec, char * howmny, int * select,
                        int * lworkl, double * rwork, int * info);
 /*--------------------------------------------------------------------------*/
 
+/*--------------------------------------------------------------------------*/
+extern int C2F(dsymv)(char* UPLO, int* N, double* ALPHA, double* A, int* LDA, double* X, int* INCX, double* BETA, double* Y, int* INCY);
+/*--------------------------------------------------------------------------*/
+
+/*--------------------------------------------------------------------------*/
+extern int C2F(daxpy)(int* N, double* DA, double* DX, int* INCX, double* DY, int* INCY);
+/*--------------------------------------------------------------------------*/
+
+/*--------------------------------------------------------------------------*/
+extern int C2F(zaxpy)(int* N, doublecomplex* ZA, doublecomplex* ZX, int* INCX, doublecomplex* ZY, int* INCY);
+/*--------------------------------------------------------------------------*/
+
 static double alpha = 1.;
 static double beta = 0.;
 
@@ -181,7 +184,7 @@ int eigs(double *AR, doublecomplex *AC, int N, int Acomplex, int Asym,
     double* WORKEV                     = NULL;
     doublecomplex* WORKEVC     = NULL;
 
-    doublecomplex mSIGMA = {.r = -SIGMA.r, .i = -SIGMA.i };
+    doublecomplex mSIGMA = { -SIGMA.r, -SIGMA.i };
 
     double* R         = NULL;
     doublecomplex* RC = NULL;
index 419def3..f4695c7 100644 (file)
@@ -45,10 +45,8 @@ void process_dneupd_data(double* DR, double* DI, double* Z, int N, int nev, doub
             if (DI[i] == 0)
             {
                 C2F(dgemv) ("n", &N, &N, &alpha, AR, &N, Z + N * i, &iOne, &beta, temp1, &iOne);
-                eigenvalue[i] = (doublecomplex)
-                {
-                    C2F(ddot) (&N, Z + N * i, &iOne, temp1, &iOne), 0
-                };
+                eigenvalue[i].r = C2F(ddot) (&N, Z + N * i, &iOne, temp1, &iOne);
+                eigenvalue[i].i = 0;
                 i = i + 1;
             }
             else
@@ -59,14 +57,10 @@ void process_dneupd_data(double* DR, double* DI, double* Z, int N, int nev, doub
                             C2F(ddot) (&N, Z + N * (i + 1), &iOne, temp2, &iOne);
                 imag_part = C2F(ddot) (&N, Z + N * i, &iOne, temp2, &iOne) - \
                             C2F(ddot) (&N, Z + N * (i + 1), &iOne, temp1, &iOne);
-                eigenvalue[i] = (doublecomplex)
-                {
-                    real_part, imag_part
-                };
-                eigenvalue[i + 1] = (doublecomplex)
-                {
-                    real_part, -imag_part
-                };
+                eigenvalue[i].r = real_part;
+                eigenvalue[i].i = imag_part;
+                eigenvalue[i + 1].r = real_part;
+                eigenvalue[i + 1].i = -imag_part;
                 i = i + 2;
             }
         }
@@ -77,10 +71,8 @@ void process_dneupd_data(double* DR, double* DI, double* Z, int N, int nev, doub
     {
         for (i = 0; i < nev + 1; i++)
         {
-            eigenvalue[i] = (doublecomplex)
-            {
-                DR[i], DI[i]
-            };
+            eigenvalue[i].r = DR[i];
+            eigenvalue[i].i = DI[i];
         }
     }
 
@@ -94,26 +86,22 @@ void process_dneupd_data(double* DR, double* DI, double* Z, int N, int nev, doub
             {
                 for (j = 0; j < N; j++)
                 {
-                    eigenvector[i * N + j] = (doublecomplex)
-                    {
-                        Z[i * N + j], Z[(i + 1) * N + j]
-                    };
-                    eigenvector[(i + 1) * N + j] = (doublecomplex)
-                    {
-                        Z[i * N + j], -Z[(i + 1) * N + j]
-                    };
+                    eigenvector[i * N + j].r = Z[i * N + j];
+                    eigenvector[i * N + j].i = Z[(i + 1) * N + j];
+                    eigenvector[(i + 1) * N + j].r = Z[i * N + j];
+                    eigenvector[(i + 1) * N + j].i = -Z[(i + 1) * N + j];
                 }
+
                 i = i + 2;
             }
             else
             {
                 for (j = 0; j < N; j++)
                 {
-                    eigenvector[i * N + j] = (doublecomplex)
-                    {
-                        Z[i * N + j], 0
-                    };
+                    eigenvector[i * N + j].r = Z[i * N + j];
+                    eigenvector[i * N + j].i = 0;
                 }
+
                 i = i + 1;
             }
         }
index ca969c4..bea1cb6 100644 (file)
@@ -16,3 +16,4 @@ getScilabVersionMajor
 getScilabVersionMinor
 getScilabVersionMaintenance
 getScilabVersionTimestamp
+getScilabVersionAsString
\ No newline at end of file