mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 05:05:58 +08:00
clean a bit SuperLU declarations
This commit is contained in:
parent
9195a224f3
commit
3345ea0ddd
@ -10,18 +10,6 @@ typedef int int_t;
|
|||||||
#include <supermatrix.h>
|
#include <supermatrix.h>
|
||||||
#include <slu_util.h>
|
#include <slu_util.h>
|
||||||
|
|
||||||
namespace SuperLU_S {
|
|
||||||
#include <slu_sdefs.h>
|
|
||||||
}
|
|
||||||
namespace SuperLU_D {
|
|
||||||
#include <slu_ddefs.h>
|
|
||||||
}
|
|
||||||
namespace SuperLU_C {
|
|
||||||
#include <slu_cdefs.h>
|
|
||||||
}
|
|
||||||
namespace SuperLU_Z {
|
|
||||||
#include <slu_zdefs.h>
|
|
||||||
}
|
|
||||||
namespace Eigen { struct SluMatrix; }
|
namespace Eigen { struct SluMatrix; }
|
||||||
|
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
|
@ -25,28 +25,34 @@
|
|||||||
#ifndef EIGEN_SUPERLUSUPPORT_H
|
#ifndef EIGEN_SUPERLUSUPPORT_H
|
||||||
#define EIGEN_SUPERLUSUPPORT_H
|
#define EIGEN_SUPERLUSUPPORT_H
|
||||||
|
|
||||||
// declaration of gssvx taken from GMM++
|
#define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE) \
|
||||||
#define DECL_GSSVX(NAMESPACE,FNAME,FLOATTYPE,KEYTYPE) \
|
extern "C" { \
|
||||||
inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, \
|
typedef struct { FLOATTYPE for_lu; FLOATTYPE total_needed; int expansions; } PREFIX##mem_usage_t; \
|
||||||
int *perm_c, int *perm_r, int *etree, char *equed, \
|
extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \
|
||||||
FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
|
char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \
|
||||||
SuperMatrix *U, void *work, int lwork, \
|
void *, int, SuperMatrix *, SuperMatrix *, \
|
||||||
SuperMatrix *B, SuperMatrix *X, \
|
FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, \
|
||||||
FLOATTYPE *recip_pivot_growth, \
|
PREFIX##mem_usage_t *, SuperLUStat_t *, int *); \
|
||||||
FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, \
|
} \
|
||||||
SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, \
|
||||||
using namespace NAMESPACE; \
|
int *perm_c, int *perm_r, int *etree, char *equed, \
|
||||||
mem_usage_t mem_usage; \
|
FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
|
||||||
NAMESPACE::FNAME(options, A, perm_c, perm_r, etree, equed, R, C, L, \
|
SuperMatrix *U, void *work, int lwork, \
|
||||||
U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
SuperMatrix *B, SuperMatrix *X, \
|
||||||
ferr, berr, &mem_usage, stats, info); \
|
FLOATTYPE *recip_pivot_growth, \
|
||||||
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, \
|
||||||
|
SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
||||||
|
PREFIX##mem_usage_t mem_usage; \
|
||||||
|
PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
|
||||||
|
U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
||||||
|
ferr, berr, &mem_usage, stats, info); \
|
||||||
|
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL_GSSVX(SuperLU_S,sgssvx,float,float)
|
DECL_GSSVX(s,float,float)
|
||||||
DECL_GSSVX(SuperLU_C,cgssvx,float,std::complex<float>)
|
DECL_GSSVX(c,float,std::complex<float>)
|
||||||
DECL_GSSVX(SuperLU_D,dgssvx,double,double)
|
DECL_GSSVX(d,double,double)
|
||||||
DECL_GSSVX(SuperLU_Z,zgssvx,double,std::complex<double>)
|
DECL_GSSVX(z,double,std::complex<double>)
|
||||||
|
|
||||||
#ifdef MILU_ALPHA
|
#ifdef MILU_ALPHA
|
||||||
#define EIGEN_SUPERLU_HAS_ILU
|
#define EIGEN_SUPERLU_HAS_ILU
|
||||||
@ -55,27 +61,32 @@ DECL_GSSVX(SuperLU_Z,zgssvx,double,std::complex<double>)
|
|||||||
#ifdef EIGEN_SUPERLU_HAS_ILU
|
#ifdef EIGEN_SUPERLU_HAS_ILU
|
||||||
|
|
||||||
// similarly for the incomplete factorization using gsisx
|
// similarly for the incomplete factorization using gsisx
|
||||||
#define DECL_GSISX(NAMESPACE,FNAME,FLOATTYPE,KEYTYPE) \
|
#define DECL_GSISX(PREFIX,FLOATTYPE,KEYTYPE) \
|
||||||
inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, \
|
extern "C" { \
|
||||||
int *perm_c, int *perm_r, int *etree, char *equed, \
|
extern void PREFIX##gsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \
|
||||||
FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
|
char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \
|
||||||
SuperMatrix *U, void *work, int lwork, \
|
void *, int, SuperMatrix *, SuperMatrix *, FLOATTYPE *, FLOATTYPE *, \
|
||||||
SuperMatrix *B, SuperMatrix *X, \
|
PREFIX##mem_usage_t *, SuperLUStat_t *, int *); \
|
||||||
FLOATTYPE *recip_pivot_growth, \
|
} \
|
||||||
FLOATTYPE *rcond, \
|
inline float SuperLU_gsisx(superlu_options_t *options, SuperMatrix *A, \
|
||||||
SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
int *perm_c, int *perm_r, int *etree, char *equed, \
|
||||||
using namespace NAMESPACE; \
|
FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \
|
||||||
mem_usage_t mem_usage; \
|
SuperMatrix *U, void *work, int lwork, \
|
||||||
NAMESPACE::FNAME(options, A, perm_c, perm_r, etree, equed, R, C, L, \
|
SuperMatrix *B, SuperMatrix *X, \
|
||||||
U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
FLOATTYPE *recip_pivot_growth, \
|
||||||
&mem_usage, stats, info); \
|
FLOATTYPE *rcond, \
|
||||||
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
SuperLUStat_t *stats, int *info, KEYTYPE) { \
|
||||||
|
PREFIX##mem_usage_t mem_usage; \
|
||||||
|
PREFIX##gsisx(options, A, perm_c, perm_r, etree, equed, R, C, L, \
|
||||||
|
U, work, lwork, B, X, recip_pivot_growth, rcond, \
|
||||||
|
&mem_usage, stats, info); \
|
||||||
|
return mem_usage.for_lu; /* bytes used by the factor storage */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL_GSISX(SuperLU_S,sgsisx,float,float)
|
DECL_GSISX(s,float,float)
|
||||||
DECL_GSISX(SuperLU_C,cgsisx,float,std::complex<float>)
|
DECL_GSISX(c,float,std::complex<float>)
|
||||||
DECL_GSISX(SuperLU_D,dgsisx,double,double)
|
DECL_GSISX(d,double,double)
|
||||||
DECL_GSISX(SuperLU_Z,zgsisx,double,std::complex<double>)
|
DECL_GSISX(z,double,std::complex<double>)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user