GNU Octave
6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-sparse.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2017-2021 The Octave Project Developers
4
//
5
// See the file COPYRIGHT.md in the top-level directory of this
6
// distribution or <https://octave.org/copyright/>.
7
//
8
// This file is part of Octave.
9
//
10
// Octave is free software: you can redistribute it and/or modify it
11
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
14
//
15
// Octave is distributed in the hope that it will be useful, but
16
// WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU General Public License for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with Octave; see the file COPYING. If not, see
22
// <https://www.gnu.org/licenses/>.
23
//
24
////////////////////////////////////////////////////////////////////////
25
26
#if defined (HAVE_CONFIG_H)
27
# include "config.h"
28
#endif
29
30
#include "
lo-error.h
"
31
#include "
oct-sparse.h
"
32
33
#if (defined (HAVE_AMD) || defined (HAVE_CCOLAMD) \
34
|| defined (HAVE_CHOLMOD) || defined (HAVE_COLAMD) \
35
|| defined (HAVE_CXSPARSE) || defined (HAVE_UMFPACK))
36
37
namespace
octave
38
{
39
static
inline
void
40
check_suitesparse_integer_size
(
void
)
41
{
42
// FIXME: maybe it would be better to make this a configure check and
43
// disable suitesparse if it fails?
44
45
if
(
sizeof
(
suitesparse_integer
) !=
sizeof
(
octave_idx_type
))
46
(*current_liboctave_error_handler)
47
(
"size of suitesparse integer does not match octave_idx_type!"
);
48
}
49
50
suitesparse_integer
*
51
to_suitesparse_intptr
(
octave_idx_type
*i)
52
{
53
check_suitesparse_integer_size
();
54
55
return
reinterpret_cast<
suitesparse_integer
*
>
(i);
56
}
57
58
const
suitesparse_integer
*
59
to_suitesparse_intptr
(
const
octave_idx_type
*i)
60
{
61
check_suitesparse_integer_size
();
62
63
return
reinterpret_cast<
const
suitesparse_integer
*
>
(i);
64
}
65
66
octave_idx_type
*
67
to_octave_idx_type_ptr
(
suitesparse_integer
*i)
68
{
69
check_suitesparse_integer_size
();
70
71
return
reinterpret_cast<
octave_idx_type
*
>
(i);
72
}
73
74
const
octave_idx_type
*
75
to_octave_idx_type_ptr
(
const
suitesparse_integer
*i)
76
{
77
check_suitesparse_integer_size
();
78
79
return
reinterpret_cast<
const
octave_idx_type
*
>
(i);
80
}
81
}
82
83
#endif
octave_idx_type
lo-error.h
octave
Definition:
aepbalance.cc:41
octave::check_suitesparse_integer_size
static void check_suitesparse_integer_size(void)
Definition:
oct-sparse.cc:40
octave::suitesparse_integer
int suitesparse_integer
Definition:
oct-sparse.h:171
octave::to_octave_idx_type_ptr
octave_idx_type * to_octave_idx_type_ptr(suitesparse_integer *i)
Definition:
oct-sparse.cc:67
octave::to_suitesparse_intptr
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)
Definition:
oct-sparse.cc:51
oct-sparse.h
liboctave
util
oct-sparse.cc
Generated on Tue Apr 13 2021 15:27:51 for GNU Octave by
1.9.1