GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bincrs.h
Go to the documentation of this file.
1 
6 #ifndef GHOST_BINCRS_H
7 #define GHOST_BINCRS_H
8 
9 #include "config.h"
10 #include "types.h"
11 #include "error.h"
12 #include "context.h"
13 #include "sparsemat.h"
14 
15 #include <stdio.h>
16 
20 #define GHOST_BINCRS_SIZE_HEADER 44
21 
24 #define GHOST_BINCRS_SIZE_RPT_EL 8
25 
28 #define GHOST_BINCRS_SIZE_COL_EL 8
29 
32 #define GHOST_BINCRS_LITTLE_ENDIAN 0
33 
34 #define GHOST_BINCRS_SYMM_GENERAL GHOST_SPARSEMAT_SYMM_GENERAL
35 #define GHOST_BINCRS_SYMM_SYMMETRIC GHOST_SPARSEMAT_SYMM_SYMMETRIC
36 #define GHOST_BINCRS_SYMM_SKEW_SYMMETRIC GHOST_SPARSEMAT_SYMM_SKEW_SYMMETRIC
37 #define GHOST_BINCRS_SYMM_HERMITIAN GHOST_SPARSEMAT_SYMM_HERMITIAN
38 
39 #define GHOST_BINCRS_DT_FLOAT GHOST_DT_FLOAT
40 #define GHOST_BINCRS_DT_DOUBLE GHOST_DT_DOUBLE
41 #define GHOST_BINCRS_DT_REAL GHOST_DT_REAL
42 #define GHOST_BINCRS_DT_COMPLEX GHOST_DT_COMPLEX
43 
44 #define GHOST_SPARSEMAT_ROWFUNC_BINCRS_ROW_GETDIM -4
45 
49 typedef struct {
53  int32_t endianess;
57  int32_t version;
61  int32_t base;
65  int32_t symmetry;
69  int32_t datatype;
73  int64_t nrows;
77  int64_t ncols;
81  int64_t nnz;
83 
84 #ifdef __cplusplus
85 template<typename m_t, typename f_t> void ghost_castarray_tmpl(void *out, void *in, int nEnts);
86 extern "C" {
87 #endif
88 
103 int ghost_sparsemat_rowfunc_bincrs(ghost_gidx row, ghost_lidx *rowlen, ghost_gidx *col, void *val, void *arg);
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 #endif
110 
Header file for type definitions.
Types and functions related to GHOST contexts.
int32_t ghost_gidx
Type for global indices.
Definition: types.h:443
ghost_error ghost_bincrs_header_read(ghost_bincrs_header_t *header, char *path)
Definition: bincrs_func.c:156
void ghost_castarray_tmpl(void *out, void *in, int nEnts)
Definition: bincrs.cpp:4
int ghost_sparsemat_rowfunc_bincrs(ghost_gidx row, ghost_lidx *rowlen, ghost_gidx *col, void *val, void *arg)
Definition: bincrs_func.c:31
int32_t ghost_lidx
Definition: types.h:503
Types, functions and macros for error handling.
int64_t nrows
The number of matrix rows.
Definition: bincrs.h:73
ghost_error
Error return type.
Definition: error.h:23
The header of a sparse matrix file.
Definition: bincrs.h:49
int32_t symmetry
Matrix symmetry information.
Definition: bincrs.h:65
int32_t endianess
The endianess of the machine on which the file has been written.
Definition: bincrs.h:53
int64_t ncols
The number of matrix columns.
Definition: bincrs.h:77
int32_t version
Version of the file format.
Definition: bincrs.h:57
Types and functions related to sparse matrices.
int32_t datatype
The data type of the matrix data.
Definition: bincrs.h:69
int32_t base
Base index. 0 for C, 1 for Fortran.
Definition: bincrs.h:61
int64_t nnz
The number of nonzeros in the matrix.
Definition: bincrs.h:81