Skip to content
Snippets Groups Projects
Select Git revision
  • cfcb0f51c8841044b8d3911344c5dbafc1fd95c2
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

List.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    fullMatrix.cpp 12.86 KiB
    // Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    
    #include <complex>
    #include <string.h>
    #include "GmshConfig.h"
    #include "fullMatrix.h"
    #include "GmshMessage.h"
    
    //#if defined(_MSC_VER)
    //#define F77NAME(x) (x)
    //#endif
    
    #if !defined(F77NAME)
    #define F77NAME(x) (x##_)
    #endif
    
    // Specialisation of fullVector/Matrix operations using BLAS and LAPACK
    
    #if defined(HAVE_BLAS)
    
    extern "C" {
      void F77NAME(daxpy)(int *n, double *alpha, double *x, int *incx, double *y, int *incy);
      void F77NAME(dgemm)(const char *transa, const char *transb, int *m, int *n, int *k,
                          double *alpha, double *a, int *lda,
                          double *b, int *ldb, double *beta,
                          double *c, int *ldc);
      void F77NAME(zgemm)(const char *transa, const char *transb, int *m, int *n, int *k,
                          std::complex<double> *alpha, std::complex<double> *a, int *lda,
                          std::complex<double> *b, int *ldb, std::complex<double> *beta,
                          std::complex<double> *c, int *ldc);
      void F77NAME(dgemv)(const char *trans, int *m, int *n,
                          double *alpha, double *a, int *lda,
                          double *x, int *incx, double *beta,
                          double *y, int *incy);
      void F77NAME(zgemv)(const char *trans, int *m, int *n,
                          std::complex<double> *alpha, std::complex<double> *a, int *lda,
                          std::complex<double> *x, int *incx, std::complex<double> *beta,
                          std::complex<double> *y, int *incy);
      void F77NAME(dscal)(int *n, double *alpha,double *x,  int *incx);
      void F77NAME(zscal)(int *n, std::complex<double> *alpha,std::complex<double> *x,  int *incx);
    }
    
    template<>
    void fullVector<double>::axpy(const fullVector<double> &x,double alpha)
    {
      int M = _r, INCX = 1, INCY = 1;
      F77NAME(daxpy)(&M, &alpha, x._data,&INCX, _data, &INCY);
    }
    
    template<>
    void fullMatrix<double>::scale(const double s)
    {
      int N = _r * _c;
      int stride = 1;
      double ss = s;
      F77NAME(dscal)(&N, &ss,_data, &stride);
    }
    
    template<>
    void fullMatrix<std::complex<double> >::scale(const double s)
    {
      int N = _r * _c;
      int stride = 1;
      std::complex<double> ss(s, 0.);
      F77NAME(zscal)(&N, &ss,_data, &stride);
    }