#ifndef PSB_C_ZBASE_
#define PSB_C_ZBASE_
#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_zgeall(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_i_t    psb_c_zgeins(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_zgeins_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_zgeasb(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_i_t    psb_c_zgefree(psb_c_zvector *xh, psb_c_descriptor *cdh);

/* sparse matrices*/
psb_c_zspmat* psb_c_new_zspmat();
psb_i_t    psb_c_zspall(psb_c_zspmat *mh, psb_c_descriptor *cdh);
psb_i_t    psb_c_zspasb(psb_c_zspmat *mh, psb_c_descriptor *cdh);
psb_i_t    psb_c_zspfree(psb_c_zspmat *mh, psb_c_descriptor *cdh);
psb_i_t    psb_c_zspins(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_zmat_get_nrows(psb_c_zspmat *mh);
psb_i_t    psb_c_zmat_get_ncols(psb_c_zspmat *mh);

/* psb_i_t    psb_c_zspasb_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_zsprn(psb_c_zspmat *mh, psb_c_descriptor *cdh, _Bool clear);
psb_i_t    psb_c_zmat_name_print(psb_c_zspmat *mh, char *name); 

/* psblas computational routines */
psb_z_t psb_c_zgedot(psb_c_zvector *xh, psb_c_zvector *yh, psb_c_descriptor *cdh);
psb_d_t psb_c_zgenrm2(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_d_t psb_c_zgeamax(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_d_t psb_c_zgeasum(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_d_t psb_c_zspnrmi(psb_c_zspmat *ah, psb_c_descriptor *cdh);
psb_i_t psb_c_zgeaxpby(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_zspmm_opt(psb_z_t alpha, psb_c_zspmat *ah, psb_c_zvector *xh, 
			psb_z_t beta, psb_c_zvector *yh, psb_c_descriptor *cdh,
			char *trans, bool doswap);
psb_i_t psb_c_zspsm(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
