Amesos2 - Direct Sparse Solver Interfaces Version of the Day
basker_types.hpp
1// @HEADER
2// *****************************************************************************
3// Basker: A Direct Linear Solver package
4//
5// Copyright 2011 NTESS and the Basker contributors.
6// SPDX-License-Identifier: LGPL-2.1-or-later
7// *****************************************************************************
8// @HEADER
9
10
11#ifndef BASKER_TYPES_HPP
12#define BASKER_TYPES_HPP
13
14#ifdef MATLAB_MEX_FILE
15#include "matrix.h"
16#include "mex.h"
17
18#define BASKERASSERT(a) mxAssert(a,"")
19#define BASKERREALLOC(ptr,size) mxRealloc(ptr, size)
20#define BASKERCALLOC(num, size) mxCalloc(num, size)
21#define BASKERFREE(ptr)
22
23#else
24#include <cassert>
25#include <cstdlib>
26
27#define BASKERASSERT(a) assert(a)
28#define BASKERREALLOC(ptr, size) realloc(ptr, size)
29#define BASKERCALLOC(num, size) calloc(num,size)
30#define BASKERFREE(ptr) free(ptr)
31
32#endif
33
34
35
36template <class Int, class Entry>
37struct basker_matrix
38{
39 Int nrow, ncol, nnz;
40 Int *col_ptr, *row_idx;
41 Entry *val;
42
43};
44
45#endif