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
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 {
49  {
51 
52  return reinterpret_cast<suitesparse_integer *> (i);
53  }
54 
55  const suitesparse_integer *
57  {
59 
60  return reinterpret_cast<const suitesparse_integer *> (i);
61  }
62 
65  {
67 
68  return reinterpret_cast<octave_idx_type *> (i);
69  }
70 
71  const octave_idx_type*
73  {
75 
76  return reinterpret_cast<const octave_idx_type *> (i);
77  }
78 }
79 
80 #endif
static void check_suitesparse_integer_size(void)
Definition: oct-sparse.cc:35
octave_idx_type * to_octave_idx_type_ptr(suitesparse_integer *i)
Definition: oct-sparse.cc:64
int suitesparse_integer
Definition: oct-sparse.h:168
for i
Definition: data.cc:5264
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)
Definition: oct-sparse.cc:48