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