81 lines
2.7 KiB
C
81 lines
2.7 KiB
C
/*BHEADER**********************************************************************
|
|
* (c) 1996 The Regents of the University of California
|
|
*
|
|
* See the file COPYRIGHT_and_DISCLAIMER for a complete copyright
|
|
* notice, contact person, and disclaimer.
|
|
*
|
|
* $Revision$
|
|
*********************************************************************EHEADER*/
|
|
|
|
/******************************************************************************
|
|
*
|
|
* Header info for CSR Matrix data structures
|
|
*
|
|
* Note: this matrix currently uses 0-based indexing.
|
|
*
|
|
*****************************************************************************/
|
|
|
|
#ifndef hypre_CSR_MATRIX_HEADER
|
|
#define hypre_CSR_MATRIX_HEADER
|
|
|
|
/*--------------------------------------------------------------------------
|
|
* CSR Matrix
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
typedef struct
|
|
{
|
|
double *data;
|
|
int *i;
|
|
int *j;
|
|
int num_rows;
|
|
int num_cols;
|
|
int num_nonzeros;
|
|
|
|
/* Does the CSRMatrix create/destroy `data', `i', `j'? */
|
|
int owns_data;
|
|
|
|
} hypre_CSRMatrix;
|
|
|
|
/*--------------------------------------------------------------------------
|
|
* Accessor functions for the CSR Matrix structure
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#define hypre_CSRMatrixData(matrix) ((matrix) -> data)
|
|
#define hypre_CSRMatrixI(matrix) ((matrix) -> i)
|
|
#define hypre_CSRMatrixJ(matrix) ((matrix) -> j)
|
|
#define hypre_CSRMatrixNumRows(matrix) ((matrix) -> num_rows)
|
|
#define hypre_CSRMatrixNumCols(matrix) ((matrix) -> num_cols)
|
|
#define hypre_CSRMatrixNumNonzeros(matrix) ((matrix) -> num_nonzeros)
|
|
#define hypre_CSRMatrixOwnsData(matrix) ((matrix) -> owns_data)
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
* CSR Boolean Matrix
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
typedef struct
|
|
{
|
|
int *i;
|
|
int *j;
|
|
int num_rows;
|
|
int num_cols;
|
|
int num_nonzeros;
|
|
int owns_data;
|
|
|
|
} hypre_CSRBooleanMatrix;
|
|
|
|
/*--------------------------------------------------------------------------
|
|
* Accessor functions for the CSR Boolean Matrix structure
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
#define hypre_CSRBooleanMatrix_Get_I(matrix) ((matrix)->i)
|
|
#define hypre_CSRBooleanMatrix_Get_J(matrix) ((matrix)->j)
|
|
#define hypre_CSRBooleanMatrix_Get_NRows(matrix) ((matrix)->num_rows)
|
|
#define hypre_CSRBooleanMatrix_Get_NCols(matrix) ((matrix)->num_cols)
|
|
#define hypre_CSRBooleanMatrix_Get_NNZ(matrix) ((matrix)->num_nonzeros)
|
|
#define hypre_CSRBooleanMatrix_Get_OwnsData(matrix) ((matrix)->owns_data)
|
|
|
|
#endif
|
|
|