psblas3-mcbind:
Makefile cbind/base/Makefile cbind/base/psb_base_cbind_mod.f90 cbind/base/psb_base_psblas_cbind_mod.f90 cbind/base/psb_c_base.h cbind/base/psb_c_cbase.c cbind/base/psb_c_cbase.h cbind/base/psb_c_sbase.c cbind/base/psb_c_sbase.h cbind/base/psb_c_zbase.c cbind/base/psb_c_zbase.h cbind/base/psb_cpenv_mod.f90 cbind/krylov cbind/prec cbind/test cbind/util Fixed C includes.psblas3-mcbind
parent
d536410cbe
commit
4734f19167
@ -1,6 +1,9 @@
|
|||||||
module psb_base_psblas_cbind_mod
|
module psb_base_psblas_cbind_mod
|
||||||
|
|
||||||
use iso_c_binding
|
use iso_c_binding
|
||||||
|
use psb_s_psblas_cbind_mod
|
||||||
use psb_d_psblas_cbind_mod
|
use psb_d_psblas_cbind_mod
|
||||||
|
use psb_c_psblas_cbind_mod
|
||||||
|
use psb_z_psblas_cbind_mod
|
||||||
|
|
||||||
end module psb_base_psblas_cbind_mod
|
end module psb_base_psblas_cbind_mod
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include "psb_c_cbase.h"
|
||||||
|
|
||||||
|
psb_c_cvector* psb_c_new_cvector()
|
||||||
|
{
|
||||||
|
psb_c_cvector* temp;
|
||||||
|
|
||||||
|
temp=(psb_c_cvector *) malloc(sizeof(psb_c_cvector));
|
||||||
|
temp->cvector=NULL;
|
||||||
|
return(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
psb_c_t* psb_c_cvect_get_cpy(psb_c_cvector *xh)
|
||||||
|
{
|
||||||
|
psb_c_t *temp=NULL;
|
||||||
|
psb_i_t vsize=0;
|
||||||
|
|
||||||
|
if ((vsize=psb_c_cvect_get_nrows(xh))<0)
|
||||||
|
return(temp);
|
||||||
|
|
||||||
|
if (vsize==0)
|
||||||
|
vsize=1;
|
||||||
|
|
||||||
|
if ((temp=(psb_c_t *)malloc(vsize*sizeof(psb_c_t)))!=NULL)
|
||||||
|
psb_c_cvect_f_get_cpy(temp,xh);
|
||||||
|
|
||||||
|
return(temp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
psb_c_cspmat* psb_c_new_cspmat()
|
||||||
|
{
|
||||||
|
psb_c_cspmat* temp;
|
||||||
|
|
||||||
|
temp=(psb_c_cspmat *) malloc(sizeof(psb_c_cspmat));
|
||||||
|
temp->cspmat=NULL;
|
||||||
|
return(temp);
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
#ifndef PSB_C_DBASE_
|
||||||
|
#define PSB_C_DBASE_
|
||||||
|
#include "psb_c_base.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct PSB_C_CVECTOR {
|
||||||
|
void *cvector;
|
||||||
|
} psb_c_cvector;
|
||||||
|
|
||||||
|
typedef struct PSB_C_CSPMAT {
|
||||||
|
void *cspmat;
|
||||||
|
} psb_c_cspmat;
|
||||||
|
|
||||||
|
|
||||||
|
/* dense vectors */
|
||||||
|
psb_c_cvector* psb_c_new_cvector();
|
||||||
|
psb_i_t psb_c_cvect_get_nrows(psb_c_cvector *xh);
|
||||||
|
psb_c_t *psb_c_cvect_get_cpy( psb_c_cvector *xh);
|
||||||
|
psb_i_t psb_c_cvect_f_get_cpy(psb_c_t *v, psb_c_cvector *xh);
|
||||||
|
psb_i_t psb_c_cvect_zero(psb_c_cvector *xh);
|
||||||
|
|
||||||
|
psb_i_t psb_c_dgeall(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeins(psb_i_t nz, const psb_i_t *irw, const psb_c_t *val,
|
||||||
|
psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeins_add(psb_i_t nz, const psb_i_t *irw, const psb_c_t *val,
|
||||||
|
psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeasb(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgefree(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
|
||||||
|
/* sparse matrices*/
|
||||||
|
psb_c_cspmat* psb_c_new_cspmat();
|
||||||
|
psb_i_t psb_c_dspall(psb_c_cspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspasb(psb_c_cspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspfree(psb_c_cspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspins(psb_i_t nz, const psb_i_t *irw, const psb_i_t *icl, const psb_c_t *val,
|
||||||
|
psb_c_cspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dmat_get_nrows(psb_c_cspmat *mh);
|
||||||
|
psb_i_t psb_c_dmat_get_ncols(psb_c_cspmat *mh);
|
||||||
|
|
||||||
|
/* psb_i_t psb_c_dspasb_opt(psb_c_cspmat *mh, psb_c_descriptor *cdh, */
|
||||||
|
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||||
|
psb_i_t psb_c_dsprn(psb_c_cspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||||
|
/* psb_i_t psb_c_dspprint(psb_c_cspmat *mh); */
|
||||||
|
|
||||||
|
/* psblas computational routines */
|
||||||
|
psb_c_t psb_c_dgedot(psb_c_cvector *xh, psb_c_cvector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dgenrm2(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dgeamax(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dgeasum(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dspnrmi(psb_c_cvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeaxpby(psb_c_t alpha, psb_c_cvector *xh,
|
||||||
|
psb_c_t beta, psb_c_cvector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_cspmm(psb_c_t alpha, psb_c_cspmat *ah, psb_c_cvector *xh,
|
||||||
|
psb_c_t beta, psb_c_cvector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspsm(psb_c_t alpha, psb_c_cspmat *th, psb_c_cvector *xh,
|
||||||
|
psb_c_t beta, psb_c_cvector *yh, psb_c_descriptor *cdh);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,39 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include "psb_c_sbase.h"
|
||||||
|
|
||||||
|
psb_c_svector* psb_c_new_svector()
|
||||||
|
{
|
||||||
|
psb_c_svector* temp;
|
||||||
|
|
||||||
|
temp=(psb_c_svector *) malloc(sizeof(psb_c_svector));
|
||||||
|
temp->svector=NULL;
|
||||||
|
return(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
psb_s_t* psb_c_svect_get_cpy(psb_c_svector *xh)
|
||||||
|
{
|
||||||
|
psb_s_t *temp=NULL;
|
||||||
|
psb_i_t vsize=0;
|
||||||
|
|
||||||
|
if ((vsize=psb_c_svect_get_nrows(xh))<0)
|
||||||
|
return(temp);
|
||||||
|
|
||||||
|
if (vsize==0)
|
||||||
|
vsize=1;
|
||||||
|
|
||||||
|
if ((temp=(psb_s_t *)malloc(vsize*sizeof(psb_s_t)))!=NULL)
|
||||||
|
psb_c_svect_f_get_cpy(temp,xh);
|
||||||
|
|
||||||
|
return(temp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
psb_c_sspmat* psb_c_new_sspmat()
|
||||||
|
{
|
||||||
|
psb_c_sspmat* temp;
|
||||||
|
|
||||||
|
temp=(psb_c_sspmat *) malloc(sizeof(psb_c_sspmat));
|
||||||
|
temp->sspmat=NULL;
|
||||||
|
return(temp);
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
#ifndef PSB_C_DBASE_
|
||||||
|
#define PSB_C_DBASE_
|
||||||
|
#include "psb_c_base.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct PSB_C_SVECTOR {
|
||||||
|
void *svector;
|
||||||
|
} psb_c_svector;
|
||||||
|
|
||||||
|
typedef struct PSB_C_SSPMAT {
|
||||||
|
void *sspmat;
|
||||||
|
} psb_c_sspmat;
|
||||||
|
|
||||||
|
|
||||||
|
/* dense vectors */
|
||||||
|
psb_c_svector* psb_c_new_svector();
|
||||||
|
psb_i_t psb_c_svect_get_nrows(psb_c_svector *xh);
|
||||||
|
psb_s_t *psb_c_svect_get_cpy( psb_c_svector *xh);
|
||||||
|
psb_i_t psb_c_svect_f_get_cpy(psb_s_t *v, psb_c_svector *xh);
|
||||||
|
psb_i_t psb_c_svect_zero(psb_c_svector *xh);
|
||||||
|
|
||||||
|
psb_i_t psb_c_dgeall(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeins(psb_i_t nz, const psb_i_t *irw, const psb_s_t *val,
|
||||||
|
psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeins_add(psb_i_t nz, const psb_i_t *irw, const psb_s_t *val,
|
||||||
|
psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeasb(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgefree(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
|
||||||
|
/* sparse matrices*/
|
||||||
|
psb_c_sspmat* psb_c_new_sspmat();
|
||||||
|
psb_i_t psb_c_dspall(psb_c_sspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspasb(psb_c_sspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspfree(psb_c_sspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspins(psb_i_t nz, const psb_i_t *irw, const psb_i_t *icl, const psb_s_t *val,
|
||||||
|
psb_c_sspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dmat_get_nrows(psb_c_sspmat *mh);
|
||||||
|
psb_i_t psb_c_dmat_get_ncols(psb_c_sspmat *mh);
|
||||||
|
|
||||||
|
/* psb_i_t psb_c_dspasb_opt(psb_c_sspmat *mh, psb_c_descriptor *cdh, */
|
||||||
|
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||||
|
psb_i_t psb_c_dsprn(psb_c_sspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||||
|
/* psb_i_t psb_c_dspprint(psb_c_sspmat *mh); */
|
||||||
|
|
||||||
|
/* psblas computational routines */
|
||||||
|
psb_s_t psb_c_dgedot(psb_c_svector *xh, psb_c_svector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dgenrm2(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dgeamax(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dgeasum(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_s_t psb_c_dspnrmi(psb_c_svector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeaxpby(psb_s_t alpha, psb_c_svector *xh,
|
||||||
|
psb_s_t beta, psb_c_svector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_sspmm(psb_s_t alpha, psb_c_sspmat *ah, psb_c_svector *xh,
|
||||||
|
psb_s_t beta, psb_c_svector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspsm(psb_s_t alpha, psb_c_sspmat *th, psb_c_svector *xh,
|
||||||
|
psb_s_t beta, psb_c_svector *yh, psb_c_descriptor *cdh);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,39 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include "psb_c_zbase.h"
|
||||||
|
|
||||||
|
psb_c_zvector* psb_c_new_zvector()
|
||||||
|
{
|
||||||
|
psb_c_zvector* temp;
|
||||||
|
|
||||||
|
temp=(psb_c_zvector *) malloc(sizeof(psb_c_zvector));
|
||||||
|
temp->zvector=NULL;
|
||||||
|
return(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
psb_z_t* psb_c_zvect_get_cpy(psb_c_zvector *xh)
|
||||||
|
{
|
||||||
|
psb_z_t *temp=NULL;
|
||||||
|
psb_i_t vsize=0;
|
||||||
|
|
||||||
|
if ((vsize=psb_c_zvect_get_nrows(xh))<0)
|
||||||
|
return(temp);
|
||||||
|
|
||||||
|
if (vsize==0)
|
||||||
|
vsize=1;
|
||||||
|
|
||||||
|
if ((temp=(psb_z_t *)malloc(vsize*sizeof(psb_z_t)))!=NULL)
|
||||||
|
psb_c_zvect_f_get_cpy(temp,xh);
|
||||||
|
|
||||||
|
return(temp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
psb_c_zspmat* psb_c_new_zspmat()
|
||||||
|
{
|
||||||
|
psb_c_zspmat* temp;
|
||||||
|
|
||||||
|
temp=(psb_c_zspmat *) malloc(sizeof(psb_c_zspmat));
|
||||||
|
temp->zspmat=NULL;
|
||||||
|
return(temp);
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
#ifndef PSB_C_DBASE_
|
||||||
|
#define PSB_C_DBASE_
|
||||||
|
#include "psb_c_base.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct PSB_C_ZVECTOR {
|
||||||
|
void *zvector;
|
||||||
|
} psb_c_zvector;
|
||||||
|
|
||||||
|
typedef struct PSB_C_ZSPMAT {
|
||||||
|
void *zspmat;
|
||||||
|
} psb_c_zspmat;
|
||||||
|
|
||||||
|
|
||||||
|
/* dense vectors */
|
||||||
|
psb_c_zvector* psb_c_new_zvector();
|
||||||
|
psb_i_t psb_c_zvect_get_nrows(psb_c_zvector *xh);
|
||||||
|
psb_z_t *psb_c_zvect_get_cpy( psb_c_zvector *xh);
|
||||||
|
psb_i_t psb_c_zvect_f_get_cpy(psb_z_t *v, psb_c_zvector *xh);
|
||||||
|
psb_i_t psb_c_zvect_zero(psb_c_zvector *xh);
|
||||||
|
|
||||||
|
psb_i_t psb_c_dgeall(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeins(psb_i_t nz, const psb_i_t *irw, const psb_z_t *val,
|
||||||
|
psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeins_add(psb_i_t nz, const psb_i_t *irw, const psb_z_t *val,
|
||||||
|
psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeasb(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgefree(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
|
||||||
|
/* sparse matrices*/
|
||||||
|
psb_c_zspmat* psb_c_new_zspmat();
|
||||||
|
psb_i_t psb_c_dspall(psb_c_zspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspasb(psb_c_zspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspfree(psb_c_zspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspins(psb_i_t nz, const psb_i_t *irw, const psb_i_t *icl, const psb_z_t *val,
|
||||||
|
psb_c_zspmat *mh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dmat_get_nrows(psb_c_zspmat *mh);
|
||||||
|
psb_i_t psb_c_dmat_get_ncols(psb_c_zspmat *mh);
|
||||||
|
|
||||||
|
/* psb_i_t psb_c_dspasb_opt(psb_c_zspmat *mh, psb_c_descriptor *cdh, */
|
||||||
|
/* const char *afmt, psb_i_t upd, psb_i_t dupl); */
|
||||||
|
psb_i_t psb_c_dsprn(psb_c_zspmat *mh, psb_c_descriptor *cdh, _Bool clear);
|
||||||
|
/* psb_i_t psb_c_dspprint(psb_c_zspmat *mh); */
|
||||||
|
|
||||||
|
/* psblas computational routines */
|
||||||
|
psb_z_t psb_c_dgedot(psb_c_zvector *xh, psb_c_zvector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_d_t psb_c_dgenrm2(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_d_t psb_c_dgeamax(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_d_t psb_c_dgeasum(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_d_t psb_c_dspnrmi(psb_c_zvector *xh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dgeaxpby(psb_z_t alpha, psb_c_zvector *xh,
|
||||||
|
psb_z_t beta, psb_c_zvector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_zspmm(psb_z_t alpha, psb_c_zspmat *ah, psb_c_zvector *xh,
|
||||||
|
psb_z_t beta, psb_c_zvector *yh, psb_c_descriptor *cdh);
|
||||||
|
psb_i_t psb_c_dspsm(psb_z_t alpha, psb_c_zspmat *th, psb_c_zvector *xh,
|
||||||
|
psb_z_t beta, psb_c_zvector *yh, psb_c_descriptor *cdh);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue