Skip to content

Commit

Permalink
Populate PR #151 to the other precisions;
Browse files Browse the repository at this point in the history
Revert some 'pointer to const' declaration, since it is inicompatible to Metis.
  • Loading branch information
xiaoyeli committed Nov 2, 2024
1 parent cc86934 commit 0bbd657
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 31 deletions.
6 changes: 3 additions & 3 deletions SRC/cgstrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ at the top-level directory.

void
cgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
int *perm_c, int *perm_r, SuperMatrix *B,
const int *perm_c, const int *perm_r, SuperMatrix *B,
SuperLUStat_t *stat, int *info)
{

Expand All @@ -113,7 +113,7 @@ cgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
int jcol, n, ldb, nrhs;
singlecomplex *work, *rhs_work, *soln;
flops_t solve_ops;
void cprint_soln(int n, int nrhs, singlecomplex *soln);
void cprint_soln(int n, int nrhs, const singlecomplex *soln);

/* Test input parameters ... */
*info = 0;
Expand Down Expand Up @@ -344,7 +344,7 @@ cgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
* Diagnostic print of the solution vector
*/
void
cprint_soln(int n, int nrhs, singlecomplex *soln)
cprint_soln(int n, int nrhs, const singlecomplex *soln)
{
int i;

Expand Down
4 changes: 2 additions & 2 deletions SRC/cutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void cinf_norm_error(int nrhs, SuperMatrix *X, singlecomplex *xtrue)
void
cPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage,
float rpg, float rcond, float *ferr,
float *berr, char *equed, SuperLUStat_t *stat)
const float *berr, const char *equed, SuperLUStat_t *stat)
{
SCformat *Lstore;
NCformat *Ustore;
Expand Down Expand Up @@ -474,7 +474,7 @@ cPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage,


int
print_singlecomplex_vec(char *what, int n, singlecomplex *vec)
print_singlecomplex_vec(const char *what, int n, const singlecomplex *vec)
{
int i;
printf("%s: n %d\n", what, n);
Expand Down
4 changes: 2 additions & 2 deletions SRC/dutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ void dinf_norm_error(int nrhs, SuperMatrix *X, double *xtrue)
void
dPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage,
double rpg, double rcond, double *ferr,
double *berr, char *equed, SuperLUStat_t *stat)
const double *berr, const char *equed, SuperLUStat_t *stat)
{
SCformat *Lstore;
NCformat *Ustore;
Expand Down Expand Up @@ -470,7 +470,7 @@ dPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage,


int
print_double_vec(char *what, int n, double *vec)
print_double_vec(const char *what, int n, const double *vec)
{
int i;
printf("%s: n %d\n", what, n);
Expand Down
4 changes: 2 additions & 2 deletions SRC/get_perm_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ void get_colamd(const int m, const int n, const int_t nnz,
* \param[in] b_rowind Row indices of size bnz for matrix B.
* \param[out] perm_c Column permutation vector.
*/
void get_metis(int n, int_t bnz, const int_t *b_colptr,
const int_t *b_rowind, const int *perm_c)
void get_metis(int n, int_t bnz, int_t *b_colptr,
int_t *b_rowind, int *perm_c)
{
#ifdef HAVE_METIS
/*#define METISOPTIONS 8*/
Expand Down
2 changes: 1 addition & 1 deletion SRC/scomplex.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ at the top-level directory.


/*! \brief Complex Division c = a/b */
void c_div(singlecomplex *c, singlecomplex *a, singlecomplex *b)
void c_div(singlecomplex *c, const singlecomplex *a, const singlecomplex *b)
{
float ratio, den;
float abr, abi, cr, ci;
Expand Down
6 changes: 3 additions & 3 deletions SRC/sgstrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ at the top-level directory.

void
sgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
int *perm_c, int *perm_r, SuperMatrix *B,
const int *perm_c, const int *perm_r, SuperMatrix *B,
SuperLUStat_t *stat, int *info)
{

Expand All @@ -112,7 +112,7 @@ sgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
int jcol, n, ldb, nrhs;
float *work, *rhs_work, *soln;
flops_t solve_ops;
void sprint_soln(int n, int nrhs, float *soln);
void sprint_soln(int n, int nrhs, const float *soln);

/* Test input parameters ... */
*info = 0;
Expand Down Expand Up @@ -331,7 +331,7 @@ sgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
* Diagnostic print of the solution vector
*/
void
sprint_soln(int n, int nrhs, float *soln)
sprint_soln(int n, int nrhs, const float *soln)
{
int i;

Expand Down
4 changes: 2 additions & 2 deletions SRC/slu_cdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ extern void creadmt (int *, int *, int_t *, singlecomplex **, int_t **, int_t
extern void cGenXtrue (int, int, singlecomplex *, int);
extern void cFillRHS (trans_t, int, singlecomplex *, int, SuperMatrix *,
SuperMatrix *);
extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, const int *, const int *,
SuperMatrix *, SuperLUStat_t*, int *);
/* ILU */
extern void cgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
Expand Down Expand Up @@ -259,7 +259,7 @@ extern void cPrint_CompCol_Matrix(char *, SuperMatrix *);
extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *);
extern void cPrint_Dense_Matrix(char *, SuperMatrix *);
extern void cprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
extern int print_double_vec(char *, int, double *);
extern int print_singlecomplex_vec(const char *, int, const singlecomplex *);
extern void ccheck_tempv(int, singlecomplex *);

/*! \brief BLAS */
Expand Down
2 changes: 1 addition & 1 deletion SRC/slu_ddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ extern void dPrint_CompCol_Matrix(char *, SuperMatrix *);
extern void dPrint_SuperNode_Matrix(char *, SuperMatrix *);
extern void dPrint_Dense_Matrix(char *, SuperMatrix *);
extern void dprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
extern int print_double_vec(char *, int, double *);
extern int print_double_vec(const char *, int, const double *);
extern void dcheck_tempv(int, double *);

/*! \brief BLAS */
Expand Down
7 changes: 1 addition & 6 deletions SRC/slu_scomplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ at the top-level directory.

typedef struct { float r, i; } singlecomplex;

#if defined(SUPERLU_TYPEDEF_COMPLEX) || DOXYGEN
//! \brief backward compatibility with older versions of SuperLU
//! Add -D enable_compatibility_complex=ON to your CMake call
typedef singlecomplex complex;
#endif

/* Macro definitions */

Expand Down Expand Up @@ -73,7 +68,7 @@ extern "C" {
#endif

/* Prototypes for functions in scomplex.c */
void c_div(singlecomplex *, singlecomplex *, singlecomplex *);
void c_div(singlecomplex *, const singlecomplex *, const singlecomplex *);
double c_abs(singlecomplex *); /* exact */
double c_abs1(singlecomplex *); /* approximate */
void c_exp(singlecomplex *, singlecomplex *);
Expand Down
4 changes: 2 additions & 2 deletions SRC/slu_sdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extern void sreadmt (int *, int *, int_t *, float **, int_t **, int_t **);
extern void sGenXtrue (int, int, float *, int);
extern void sFillRHS (trans_t, int, float *, int, SuperMatrix *,
SuperMatrix *);
extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, const int *, const int *,
SuperMatrix *, SuperLUStat_t*, int *);
/* ILU */
extern void sgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
Expand Down Expand Up @@ -256,7 +256,7 @@ extern void sPrint_CompCol_Matrix(char *, SuperMatrix *);
extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *);
extern void sPrint_Dense_Matrix(char *, SuperMatrix *);
extern void sprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
extern int print_double_vec(char *, int, double *);
extern int print_float_vec(const char *, int, const float *);
extern void scheck_tempv(int, float *);

/*! \brief BLAS */
Expand Down
4 changes: 2 additions & 2 deletions SRC/slu_zdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ extern void zreadmt (int *, int *, int_t *, doublecomplex **, int_t **, int_t
extern void zGenXtrue (int, int, doublecomplex *, int);
extern void zFillRHS (trans_t, int, doublecomplex *, int, SuperMatrix *,
SuperMatrix *);
extern void zgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *,
extern void zgstrs (trans_t, SuperMatrix *, SuperMatrix *, const int *, const int *,
SuperMatrix *, SuperLUStat_t*, int *);
/* ILU */
extern void zgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*,
Expand Down Expand Up @@ -259,7 +259,7 @@ extern void zPrint_CompCol_Matrix(char *, SuperMatrix *);
extern void zPrint_SuperNode_Matrix(char *, SuperMatrix *);
extern void zPrint_Dense_Matrix(char *, SuperMatrix *);
extern void zprint_lu_col(char *, int, int, int_t *, GlobalLU_t *);
extern int print_double_vec(char *, int, double *);
extern int print_doublecomplex_vec(const char *, int, const doublecomplex *);
extern void zcheck_tempv(int, doublecomplex *);

/*! \brief BLAS */
Expand Down
6 changes: 3 additions & 3 deletions SRC/zgstrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ at the top-level directory.

void
zgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
int *perm_c, int *perm_r, SuperMatrix *B,
const int *perm_c, const int *perm_r, SuperMatrix *B,
SuperLUStat_t *stat, int *info)
{

Expand All @@ -113,7 +113,7 @@ zgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
int jcol, n, ldb, nrhs;
doublecomplex *work, *rhs_work, *soln;
flops_t solve_ops;
void zprint_soln(int n, int nrhs, doublecomplex *soln);
void zprint_soln(int n, int nrhs, const doublecomplex *soln);

/* Test input parameters ... */
*info = 0;
Expand Down Expand Up @@ -344,7 +344,7 @@ zgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U,
* Diagnostic print of the solution vector
*/
void
zprint_soln(int n, int nrhs, doublecomplex *soln)
zprint_soln(int n, int nrhs, const doublecomplex *soln)
{
int i;

Expand Down
4 changes: 2 additions & 2 deletions SRC/zutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void zinf_norm_error(int nrhs, SuperMatrix *X, doublecomplex *xtrue)
void
zPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage,
double rpg, double rcond, double *ferr,
double *berr, char *equed, SuperLUStat_t *stat)
const double *berr, const char *equed, SuperLUStat_t *stat)
{
SCformat *Lstore;
NCformat *Ustore;
Expand Down Expand Up @@ -474,7 +474,7 @@ zPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage,


int
print_doublecomplex_vec(char *what, int n, doublecomplex *vec)
print_doublecomplex_vec(const char *what, int n, const doublecomplex *vec)
{
int i;
printf("%s: n %d\n", what, n);
Expand Down

0 comments on commit 0bbd657

Please sign in to comment.