/*@ BSsparse.h - Include fle for the sparse solver package.  
    This is the include file for public use.
 @*/

/* ****************************************************************** */
/* NOTICE:  BlockSolve95 is copyrighted.  See the file ../COPYRIGHT   */
/*          for details.                                              */
/*                                                                    */
/* Authors: Mark Jones and Paul Plassmann                             */
/*                                                                    */
/* Version: 3.0                                                       */
/*                                                                    */
/* Last Modified: 1/96                                                */
/*                                                                    */
/* ****************************************************************** */

#ifndef __BSsparseh
#define __BSsparseh

/* The following is a global definition of the variable for error handling. */
/* It is statically defined in BScontext.c and initialized to 0 there */
extern	int	__BSERROR_STATUS;

/* include the "system" dependent routines */
#include "BSdepend.h"

/* include the special message passing stuff that I wrote */
#include "BMmsg.h"

/* the usual system stuff */
#include <stdio.h>
#include <limits.h>
#include <math.h>

/* ****************************************************************** */
/* Definitions of double/single precision stuff */
/* ****************************************************************** */
#if defined(PARCH_cray) || defined(PARCH_t3d)
#define dgemm_ SGEMM
#define dtrmm_ STRMM
#define dcopy_ SCOPY
#define daxpy_ SAXPY
#define dgemv_ SGEMV
#define dtrmv_ STRMV
#define dpotrf_ SPOTRF
#define dtrtri_ STRTRI
#define dlamch_ SLAMCH
#define dgetrf_ SGETRF 
#define dgetri_ SGETRI 
#define sdot_ SDOT
#define sgemm_ SGEMM
#define strmm_ STRMM
#define scopy_ SCOPY
#define saxpy_ SAXPY
#define sgemv_ SGEMV
#define strmv_ STRMV
#define spotrf_ SPOTRF
#define strtri_ STRTRI
#define slamch_ SLAMCH
#define sgetrf_ SGETRF 
#define sgetri_ SGETRI 
#elif defined(FORTRANCAPS)
#define dgemm_ DGEMM
#define dtrmm_ DTRMM
#define dcopy_ DCOPY
#define daxpy_ DAXPY
#define dgemv_ DGEMV
#define dtrmv_ DTRMV
#define dpotrf_ DPOTRF
#define dtrtri_ DTRTRI
#define dlamch_ DLAMCH
#define dgetrf_ DGETRF 
#define dgetri_ DGETRI 
#define sdot_ SDOT
#define sgemm_ SGEMM
#define strmm_ STRMM
#define scopy_ SCOPY
#define saxpy_ SAXPY
#define sgemv_ SGEMV
#define strmv_ STRMV
#define spotrf_ SPOTRF
#define strtri_ STRTRI
#define slamch_ SLAMCH
#define sgetrf_ SGETRF 
#define sgetri_ SGETRI 
#elif !defined(FORTRANUNDERSCORE)
#define dgemm_ dgemm
#define dtrmm_ dtrmm
#define dcopy_ dcopy
#define daxpy_ daxpy
#define dgemv_ dgemv
#define dtrmv_ dtrmv
#define dpotrf_ dpotrf
#define dtrtri_ dtrtri
#define dlamch_ dlamch
#define dgetrf_ dgetrf
#define dgetri_ dgetri
#define sdot_ sdot
#define sgemm_ sgemm
#define strmm_ strmm
#define scopy_ scopy
#define saxpy_ saxpy
#define sgemv_ sgemv
#define strmv_ strmv
#define spotrf_ spotrf
#define strtri_ strtri
#define slamch_ slamch
#define slamch_ slamch
#define sgetrf_ sgetrf
#define sgetri_ sgetri
#endif

/* turn on compilation of the double precision version if */
/* BSDOUBLE is defined, otherwise single precision */
#if defined(PARCH_cray) || defined(PARCH_t3d)
#else
#define BSDOUBLE
#endif

#if defined(PARCH_t3d)
#include <fortran.h>
#define	MY_MPI_FLT	MPI_DOUBLE
#define FLOAT double
#define DLAMCH(a) SLAMCH(_cptofcd((a),1))
#define DGEMM(a,b,c,d,e,f,g,h,i,j,k,l,m) SGEMM(_cptofcd((a),1),_cptofcd((b),1),\
        (c),(d),(e),(f),(g),(h),(i),(j),(k),(l),(m))
#define DTRMM(a,b,c,d,e,f,g,h,i,j,k)  STRMM(_cptofcd((a),1),_cptofcd((b),1),\
        _cptofcd((c),1),_cptofcd((d),1),(e),(f),(g),(h),(i),(j),(k))
#define DCOPY SCOPY
#define DAXPY SAXPY
#define DGEMV(a,b,c,d,e,f,g,h,i,j,k) SGEMV(_cptofcd((a),1),(b),(c),(d),(e),\
                                 (f),(g),(h),(i),(j),(k))
#define DTRMV(a,b,c,d,e,f,g,h)  STRMV(_cptofcd((a),1),\
             _cptofcd((b),1),_cptofcd((c),1),(d),(e),(f),(g),(h))
#define DPOTRF(a,b,c,d,e)  SPOTRF(_cptofcd((a),1),(b),(c),(d),(e))
#define DTRTRI(a,b,c,d,e,f)  STRTRI(_cptofcd((a),1),_cptofcd((b),1),\
                                  (c),(d),(e),(f))
#define GFLSUM GDSUM
#define DGETRF SGETRF
#define DGETRI SGETRI
#elif defined(BSDOUBLE)
#define	MY_MPI_FLT	MPI_DOUBLE
#define FLOAT double
#define DGEMM dgemm_
#define DTRMM dtrmm_
#define DCOPY dcopy_
#define DAXPY daxpy_
#define DGEMV dgemv_
#define DTRMV dtrmv_
#define DPOTRF dpotrf_
#define DTRTRI dtrtri_
#define DLAMCH dlamch_
#define GFLSUM GDSUM
#define DGETRF dgetrf_
#define DGETRI dgetri_
#else
#define	MY_MPI_FLT	MPI_FLOAT
#define FLOAT float
#define DGEMM sgemm_
#define DTRMM strmm_
#define DCOPY scopy_
#define DAXPY saxpy_
#define DGEMV sgemv_
#define DTRMV strmv_
#define DPOTRF spotrf_
#define DTRTRI strtri_
#define DLAMCH slamch_
#define GFLSUM GFSUM
#define DGETRF sgetrf_
#define DGETRI sgetri_
#endif

#if defined(__cplusplus)
extern "C" {
#endif

/* note that BLdot cannot be used with COMPLEX because it cannot
   handle returing a double complex!!
*/
extern void   DCOPY(int*,FLOAT*,int*,FLOAT*,int*);
extern void   DAXPY(int*,FLOAT*,FLOAT*,int*,FLOAT*,int*);
extern void   DGETRF(int*,int*,FLOAT*,int*,int*,int*);
extern void   DGETRI(int*,FLOAT*,int*,int*,FLOAT *,int*,int*);

#if defined(PARCH_t3d)
extern FLOAT  SLAMCH(_fcd);
extern void   STRMM(_fcd,_fcd,_fcd,_fcd,int*,int*,
				 FLOAT*,FLOAT*,int*,FLOAT*,int*);
extern void   SPOTRF(_fcd,int*,FLOAT*,int*,int*);
extern void   STRTRI(_fcd,_fcd,int*,FLOAT*,int*,int*);
extern void   SGEMV(_fcd,int*,int*,FLOAT*,FLOAT*,int*,FLOAT *,int*,
                    FLOAT*,FLOAT*,int*);
extern void   STRMV(_fcd,_fcd,_fcd,int*,FLOAT*,int*,FLOAT *,int*);
extern void   SGEMM(_fcd,_fcd,int*,int*,int*,FLOAT*,FLOAT*,int*,
					FLOAT *,int*,FLOAT*,FLOAT*,int*);
#else
extern FLOAT  DLAMCH(char*);
extern void   DTRMM(char*,char*,char*,char*,int*,int*,
				 FLOAT*,FLOAT*,int*,FLOAT*,int*);
extern void   DPOTRF(char*,int*,FLOAT*,int*,int*);
extern void   DTRTRI(char*,char*,int*,FLOAT*,int*,int*);
extern void   DGEMV(char*,int*,int*,FLOAT*,FLOAT*,int*,FLOAT *,int*,
                    FLOAT*,FLOAT*,int*);
extern void   DTRMV(char*,char*,char*,int*,FLOAT*,int*,FLOAT *,int*);
extern void   DGEMM(char*,char*,int*,int*,int*,FLOAT*,FLOAT*,int*,
					FLOAT *,int*,FLOAT*,FLOAT*,int*);
#endif

#if defined(__cplusplus)
}
#endif

/* include special blas stuff */
#include "BSmy_blas.h"

/* ****************************************************************** */
/* End of Definitions */
/* ****************************************************************** */

/* ****************************************************************** */
/* Definitions of misc. constants */
/* ****************************************************************** */

#define	MEM_ERROR -25
#define	FILE_ERROR -26
#define	BB_ERROR -27
#define	COLOR1_ERROR -28
#define	COLOR2_ERROR -29
#define	INODE_ERROR -30
#define	MSG_ERROR -30
#define CG_NEG_ERROR -31
#define	COLOR_ERROR -32
#define	FACTOR_ERROR -33
#define	MATRIX_ERROR0 -50
#define	MATRIX_ERROR1 -51
#define	MATRIX_ERROR2 -52
#define	MATRIX_ERROR3 -53
#define	MATRIX_ERROR4 -54
#define	MATRIX_ERROR5 -55
#define	MATRIX_ERROR6 -56
#define	MATRIX_ERROR7 -57
#define	MATRIX_ERROR8 -58
#define	MATRIX_ERROR9 -59
#define	MATRIX_ERROR10 -60
#define	MATRIX_ERROR11 -61
#define	MATRIX_ERROR12 -62
#define	MATRIX_ERROR13 -63
#define	MATRIX_ERROR14 -64
#define	MATRIX_ERROR15 -65
#define	MATRIX_ERROR16 -66
#define	MATRIX_ERROR17 -67
#define	REPERM_ERROR -68
#define	SYM_ERROR -69
#define	TRI_SOLVE_ERROR -70
#define	PAR_SOLVE_ERROR -71
#define	SCALING_ERROR -72
#define	MLOG_ERROR -73

/* type of coloring */
#define IDO 10
#define SDO 20

/* kinds of preconditioners */
#define PRE_DIAG 0
#define PRE_ICC 1
#define PRE_ILU 2
#define PRE_SSOR 3
#define PRE_BJACOBI 3

/* kinds of iterative methods */
#define CG    100
#define SSOR  200
#define GMRES 300
#define SYMMLQ 400

/* ****************************************************************** */
/* End of section */
/* ****************************************************************** */


/* ****************************************************************** */
/* Definitions of data structures */
/* ****************************************************************** */

/* store a local dense matrix */
typedef struct __BSdense {
	int	size;          /* size of the dense matrix */
	int	local_ind;     /* local index of first element of dense matrix */
	FLOAT	*matrix;   /* the matrix itself */
} BSdense;

/* shows which inodes belong to each clique */
/* the arrays are one element longer than num_cols for ease of use */
typedef struct __BScl_2_inode {
	int	num_cols;      /* number of columns */
	int	*g_offset;     /* global number of beginning of each clique */
	int	*proc;         /* processor who owns clique */
	int	*inode_index;  /* index into inode structure */
	BSdense *d_mats;   /* array of pointers to dense matrices */
} BScl_2_inode;

/* i_node structure keeps several identical rows/cols in place */
/* we are storing on the half of the symmetric matrix, in addition */
/* the diagonal portions are stored with the clique structure */
typedef struct __BSinode {
	int	num_cols;    /* number of cols in i_node */
	int	gcol_num;    /* global column number of first row of i_node */
	                 /* global column numbers are consecutive */
	int	*o_gcol_num; /* original global column number of each row of i_node */
	                 /* original global column numbers are NOT consecutive */
	int	length;      /* the length of each col */
	int	below_diag;	 /* a pointer to where row entries below the diag start (ILU only) */
	int	*row_num;    /* the row numbers (we store local, not global #'s */
	FLOAT	*nz;     /* the nz values */
} BSinode;

/* list of inodes */
/* the array is one element longer than length for ease of use */
typedef struct __BSinode_list {
	int	 length; /* the number of i_nodes */
	BSinode	*list; /* array of i_nodes */
} BSinode_list;

/* permutation of rows/cols of a matrix */
typedef	struct __BSpermutation {
	int	length;
	int	*perm;
} BSpermutation;

/* distribution of a numbering */
/* i.e. how many 0's, how many 1's, etc. */
typedef struct __BSdistribution {
	int	max;
	int	*distribution;
} BSdistribution;

/* numbering of rows/cols of a matrix */
typedef	struct __BSnumbering {
	int	length;
	int	*numbers;
} BSnumbering;

/* processor information and execution time information */
typedef struct __BSprocinfo {
	int	my_id;			/* processor id */
	int	nprocs;			/* number of processors */
	MPI_Comm procset;	/* set of processors to operate on */
	int	max_clique_size; /* the maximum clique size to allow */
	int	max_inode_size; /* the maximum i-node size to allow */
	int	coloring_type;  /* the type of coloring to do */
	int	error_check;    /* if TRUE, then do error checking */
	int	retain;         /* if TRUE, then keep around some extra */
	                    /* information to allow for fast permutation */
	                    /* for a matrix with the same structure */
	int	print;			/* if TRUE, then print reordering information */
	int	print_log;		/* if TRUE, then print logging information when requested */
	int	single;			/* if TRUE, the no cliques or i-nodes are found */
	int	preconditioner;	/* type of preconditioner to be used */
	int	method;         /* iterative method to be used */
	int	scaling;        /* if true, scale linear systems for solution */
	int	num_rhs;        /* number of RHSs to be solved for */
	int	num_rhs_comm;   /* number of RHSs for which the communication */
	                    /* data structure is set up */
	int	max_iterations; /* the max number of iterations allowed solver */
	int	guess;          /* if TRUE, use x-values as starting vector for solver */
	int	restart;        /* GMRES restart parameter */
	FLOAT residual_tol; /* residual error tolerance requested from solver */
} BSprocinfo;

/* global/local mapping */
#if defined(__cplusplus)
typedef struct __BSmapping {
	/* not all of these members may be present, some may be NULL */
	/* we are trying to define a flexible structure */
	void	*vlocal2global; /* data for mapping local to global */
	/* a function for mapping local to global */
	void (*flocal2global)(int,int *,int *,BSprocinfo *,__BSmapping *);
	void (*free_l2g)(void *); /* a function for free'ing the l2g data */
	void	*vglobal2local; /* data for mapping global to local */
	/* a function mapping global to local */
	void (*fglobal2local)(int,int *,int *,BSprocinfo *,__BSmapping *);
	void (*free_g2l)(void *); /* a function for free'ing the g2l data */
	void	*vglobal2proc; /* data for mapping global to proc */
	/* a function mapping global to proc */
	void (*fglobal2proc)(int,int *,int *,BSprocinfo *,__BSmapping *);
	void (*free_g2p)(void *); /* a function for free'ing the g2p data */
} BSmapping;
#else
typedef struct __BSmapping {
	/* not all of these members may be present, some may be NULL */
	/* we are trying to define a flexible structure */
	void	*vlocal2global; /* data for mapping local to global */
	void (*flocal2global)(); /* a function for mapping local to global */
	void (*free_l2g)(); /* a function for free'ing the l2g data */
	void	*vglobal2local; /* data for mapping global to local */
	void (*fglobal2local)(); /* a function mapping global to local */
	void (*free_g2l)(); /* a function for free'ing the g2l data */
	void	*vglobal2proc; /* data for mapping global to proc */
	void (*fglobal2proc)(); /* a function mapping global to proc */
	void (*free_g2p)(); /* a function for free'ing the g2p data */
} BSmapping;
#endif

/* row of a sparse matrix */
typedef struct __BSsprow {
	int	diag_ind;	/* index of diagonal in row */
	int	length;		/* num. of nz in row */
	int	*col;		/* col numbers */
	FLOAT	*nz;	/* nz values */
} BSsprow;

/* sparse matrix */
typedef struct __BSspmat {
	int	num_rows;		/* number of local rows */
	int	global_num_rows;/* number of global rows */
	int	symmetric;      /* if TRUE, the matrix should be symmetric */
	int	icc_storage;    /* if TRUE, storage scheme used for ICC preconditioner */
	                    /* if FALSE, ILU storage scheme used */
	BSmapping	*map;	/* mapping from local to global, etc */
	BSsprow	**rows;		/* the sparse rows */
} BSspmat;

/* offset mapping structure (keep track of who has what row, etc. */
typedef struct __BSoff_map {
	int	length;		/* length of the map (number of processors, usually) */
	int	my_ind;		/* my index into the map */
	int	*proc_id;	/* processor id's (sorted by offset) */
	int	*offset;	/* sorted list of offsets */
} BSoff_map;

/* information for quickly permuting a matrix with the same structure */
typedef struct __BSreperm {
	BSpermutation *inode_perm;    /* the original inode permutation */
	BSdistribution *inode_distr;  /* the original inode distribution */
} BSreperm;

/* Here is a very important data structure, this is the structure     */
/* returned by BSmain_perm.  It contains everything needed for        */
/* parallel matrix multiply, back solve, etc.  It also may or may not */
/* contain the information for quickly permuting a matrix with the    */
/* exact same structure again                                         */
/* IMPORTANT: the map pointer is only a copy, do not destroy          */
/* if the original is destroyed, we are in trouble                    */
typedef struct __BSpar_mat {
	int	num_rows;                /* number of local rows */
	int	global_num_rows;         /* number of global rows */
	int	local_nnz;               /* number of nonzeroes on this processor */
	int	local_num_inodes;        /* number of i-nodes on this processor */
	int	global_num_inodes;       /* number of global i-nodes */
	int	local_num_cliques;       /* number of cliques on this processor */
	int	global_num_cliques;      /* number of global cliques */
	int	num_colors;              /* number of colors used */
	int	max_local_row_length;    /* max length row on this processor */
	int	symmetric;               /* if TRUE, matrix should be symmetric */
	int	icc_storage;             /* if TRUE, storage scheme used for ICC preconditioner */
	                             /* if FALSE, ILU storage scheme used */
	BSpermutation *perm;         /* the local permutation of the columns */
	BSpermutation *inv_perm;     /* the inverse of perm */
	BSnumbering *global_row_num; /* the global numbers of the rows */
	BSnumbering *color2clique;   /* map from colors to cliques */
	BScl_2_inode *clique2inode;  /* map from cliques to inodes */
	BSinode_list *inodes;        /* the array of inodes */
	FLOAT	*diag;               /* a copy of the original permuted diagonal */
	FLOAT	*save_diag;          /* a copy of the current (scaled) diagonal */
	                             /* this is useful if we share cliques */
	                             /* it can be NULL (which means the diagonal */
	                             /* is all 1's */
	                             /* can legally be equal to diag */
	FLOAT	*scale_diag;         /* the diagonal the matrix was scaled by */
	                             /* if NULL, then no scaling was done */
	                             /* can legally be equal to diag */
	BSmapping *map;              /* a POINTER to the original mapping */
	BSreperm *reperm;            /* information for quick permutation (opt) */
} BSpar_mat;

/* data structure used to contain communication information */
typedef struct __BScomm {
	int         num_rhs;    /* number of RHSs BScomm set up to solve */
	BMcomp_msg *to_msg;		/* compiled message structure */
	BMcomp_msg *from_msg;	/* compiled message structure */
} BScomm;

/* ****************************************************************** */
/* End of section */
/* ****************************************************************** */

/* ****************************************************************** */
/* Declarations of my functions */
/* ****************************************************************** */

/* BSsparse functions */
extern BSpar_mat *BSmain_perm(BSprocinfo *,BSspmat *);
extern BSoff_map	*BSmake_off_map(int,BSprocinfo *,int);
extern void BSglob2loc(int,int *,int *,BSprocinfo *,BSmapping *);
extern void BSglob2proc(int,int *,int *,BSprocinfo *,BSmapping *);
extern void BSloc2glob(int,int *,int *,BSprocinfo *,BSmapping *);
extern void BSfree_spmat(BSspmat *);
extern void BSfree_easymat(BSspmat *);
extern void BSfree_off_map(BSoff_map *);
extern void BSfreel2g(void *data);
extern void BSfreeg2l(void *data);
extern void BSfree_par_mat(BSpar_mat *);
extern void BSfree_copy_par_mat(BSpar_mat *);
extern void BSmain_reperm(BSprocinfo *,BSspmat *,BSpar_mat *);
extern void BSget_diag(BSpar_mat *,FLOAT *,BSprocinfo *);
extern void BSscale_diag(BSpar_mat *,FLOAT *,BSprocinfo *);
extern BSpar_mat *BScopy_par_mat(BSpar_mat *);
extern void BScopy_nz(BSpar_mat *,BSpar_mat *);
extern void BSset_diag(BSpar_mat *,FLOAT,BSprocinfo *);
extern void BSset_diagv(BSpar_mat *,FLOAT *,BSprocinfo *);
extern void BSsetup_block(BSpar_mat *,BScomm *,int,BSprocinfo *);
extern BScomm *BSsetup_forward(BSpar_mat *,BSprocinfo *);
extern void BSforward(BSpar_mat *,FLOAT *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSforward1(BSpar_mat *,FLOAT *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSbackward(BSpar_mat *,FLOAT *,FLOAT *,BScomm *, BSprocinfo *);
extern void BSbackward1(BSpar_mat *,FLOAT *,FLOAT *,BScomm *, BSprocinfo *);
extern void BSb_forward(BSpar_mat *,FLOAT *,FLOAT *,BScomm *,int,BSprocinfo *);
extern void BSb_backward(BSpar_mat *,FLOAT *,FLOAT *,BScomm *,int,BSprocinfo *);
extern void BSfree_comm(BScomm *);
extern void BSfree_comm_data(int *);
extern int	BSpar_solve(BSpar_mat *,BSpar_mat *,BScomm *,FLOAT *,FLOAT *,
	FLOAT *,BSprocinfo *);
extern int	BSpar_sym_solve(int,BSpar_mat *,BSpar_mat *,BScomm *,FLOAT *,FLOAT *,
	int,FLOAT,int,FLOAT *,int,BSprocinfo *);
extern int BSpar_gmres(int,BSpar_mat *,BSpar_mat *,BScomm *,FLOAT *,
	FLOAT *,int,int,FLOAT,int,FLOAT *,int,BSprocinfo *);
extern int	BSpar_isolve(BSpar_mat *,BSpar_mat *,BScomm *,BSpar_mat *,BScomm *, 
	FLOAT *,FLOAT *,FLOAT,FLOAT *,BSprocinfo *);
extern void BSinv_diag_block(BSpar_mat *,BSprocinfo *);
extern int  BSinit(int *,char ***);
extern int  BSfinalize();
extern int  BSprint_log(BSprocinfo *);
extern void BSfor_solve1(BSpar_mat *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSfor_solve(BSpar_mat *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSb_for_solve(BSpar_mat *,FLOAT *,BScomm *,int,BSprocinfo *);
extern void BSback_solve1(BSpar_mat *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSback_solve(BSpar_mat *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSb_back_solve(BSpar_mat *,FLOAT *,BScomm *,int,BSprocinfo *);
extern int	BSfactor(BSpar_mat *,BScomm *,BSprocinfo *);
extern BScomm *BSsetup_factor(BSpar_mat *,BSprocinfo *);
extern void BStri_solve(BSpar_mat *,BSpar_mat *,BScomm *,FLOAT *,int,int,BSprocinfo *);
extern void BStri_mult(BSpar_mat *,BScomm *,BSpar_mat *,BScomm *,FLOAT *,FLOAT *,
	FLOAT *,FLOAT *,FLOAT,int,BSprocinfo *);
extern void BSsave_diag(BSpar_mat *,BSprocinfo *);
extern void BSbjacobi(BSpar_mat *,FLOAT *,BScomm *,BSprocinfo *);
extern void BSmat_subtract(BSspmat *,BSspmat *,FLOAT);
extern BSprocinfo *BScreate_ctx();
extern void BSctx_set_id(BSprocinfo *,int);
extern void BSctx_set_np(BSprocinfo *,int);
extern void BSctx_set_ps(BSprocinfo *,MPI_Comm);
extern void BSctx_set_cs(BSprocinfo *,int);
extern void BSctx_set_is(BSprocinfo *,int);
extern void BSctx_set_ct(BSprocinfo *,int);
extern void BSctx_set_err(BSprocinfo *,int);
extern void BSctx_set_rt(BSprocinfo *,int);
extern void BSctx_set_pr(BSprocinfo *,int);
extern void BSctx_set_print_log(BSprocinfo *,int);
extern void BSctx_set_si(BSprocinfo *,int);
extern void BSctx_set_sym(BSprocinfo *,int);
extern void BSctx_set_max_it(BSprocinfo *,int);
extern void BSctx_set_scaling(BSprocinfo *,int);
extern void BSctx_set_restart(BSprocinfo *,int);
extern void BSctx_set_guess(BSprocinfo *,int);
extern void BSctx_set_tol(BSprocinfo *,FLOAT);
extern void BSctx_set_num_rhs(BSprocinfo *,int);
extern void BSctx_set_bs_comm(BSprocinfo *,int);
extern void BSctx_set_pre(BSprocinfo *, int);
extern void BSctx_set_method(BSprocinfo *, int);
extern void BSctx_print(BSprocinfo *);
extern void BSfree_ctx(BSprocinfo *);
extern void BSset_mat_symmetric(BSspmat *,int);
extern void BSset_mat_icc_storage(BSspmat *,int);
extern double BSlocal_flops();
extern double BSglobal_flops(BSprocinfo *);
extern int BSlocal_nnz(BSpar_mat *);
extern int BSglobal_nnz(BSpar_mat *,BSprocinfo *);
extern int BSlocal_num_inodes(BSpar_mat *);
extern int BSglobal_num_inodes(BSpar_mat *);
extern int BSlocal_num_cliques(BSpar_mat *);
extern int BSglobal_num_cliques(BSpar_mat *);
extern int BSnum_colors(BSpar_mat *);
extern int	BSoffset(int,int *,int **,BSprocinfo *);
extern BSspmat	*BSeasy_A(int,int,int *,int *,FLOAT *,BSprocinfo *);

/* ****************************************************************** */
/* End of section */
/* ****************************************************************** */
#endif


syntax highlighted by Code2HTML, v. 0.9.1