GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-re-sparse.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1998-2025 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 (octave_ov_re_sparse_h)
27#define octave_ov_re_sparse_h 1
28
29#include "octave-config.h"
30
31#include <cstdlib>
32
33#include <iosfwd>
34#include <string>
35
36#include "mx-base.h"
37#include "str-vec.h"
38
39#include "error.h"
40#include "oct-stream.h"
41#include "ov-base.h"
42#include "ov-typeinfo.h"
43
44#include "dSparse.h"
45#include "MatrixType.h"
46#include "ov-base-sparse.h"
47#include "ov-cx-sparse.h"
48
50
51extern template class OCTINTERP_EXTERN_TEMPLATE_API
53
55{
56public:
57
60
63
66
69
72
75
78
81
84
87
89
91 { return new octave_sparse_matrix (*this); }
93 { return new octave_sparse_matrix (); }
94
95 octave::idx_vector index_vector (bool require_integers = false) const;
96
98
99 bool is_real_matrix () const { return true; }
100
101 bool isreal () const { return true; }
102
103 bool is_double_type () const { return true; }
104
105 bool isfloat () const { return true; }
106
107 double double_value (bool = false) const;
108
109 double scalar_value (bool frc_str_conv = false) const
110 { return double_value (frc_str_conv); }
111
112 Matrix matrix_value (bool = false) const;
113
114 Complex complex_value (bool = false) const;
115
116 boolNDArray bool_array_value (bool warn = false) const;
117
118 charNDArray char_array_value (bool = false) const;
119
120 ComplexMatrix complex_matrix_value (bool = false) const;
121
122 ComplexNDArray complex_array_value (bool = false) const;
123
124 NDArray array_value (bool = false) const;
125
127 { return matrix; }
128
130 { return SparseComplexMatrix (matrix); }
131
132 SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const;
133
134 octave_value convert_to_str_internal (bool pad, bool force, char type) const;
135
136 octave_value as_double () const;
137
138 bool save_binary (std::ostream& os, bool save_as_floats);
139
140 bool load_binary (std::istream& is, bool swap,
141 octave::mach_info::float_format fmt);
142
143 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats);
144
145 bool load_hdf5 (octave_hdf5_id loc_id, const char *name);
146
147 mxArray * as_mxArray (bool interleaved) const;
148
149 octave_value map (unary_mapper_t umap) const;
150
151private:
152 octave_value map (double (*fcn) (double)) const;
153
155};
156
157#endif
octave_sparse_matrix(const Sparse< double > &m)
bool is_real_matrix() const
octave_sparse_matrix(const SparseMatrix &m)
octave_base_value * empty_clone() const
octave_sparse_matrix(const Matrix &m)
octave_sparse_matrix(const Sparse< double > &m, const MatrixType &t)
bool is_double_type() const
octave_sparse_matrix(const MSparse< double > &m)
builtin_type_t builtin_type() const
octave_sparse_matrix(const NDArray &m)
~octave_sparse_matrix()=default
octave_sparse_matrix(const octave_sparse_matrix &m)
SparseMatrix sparse_matrix_value(bool=false) const
octave_sparse_matrix(const SparseMatrix &m, const MatrixType &t)
octave_base_value * clone() const
double scalar_value(bool frc_str_conv=false) const
SparseComplexMatrix sparse_complex_matrix_value(bool=false) const
octave_sparse_matrix(const MSparse< double > &m, const MatrixType &t)
Array< octave_value > array_value() const
Definition ovl.h:88
std::complex< double > Complex
Definition oct-cmplx.h:33
int64_t octave_hdf5_id
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition ov-base.h:185
builtin_type_t
Definition ov-base.h:83
@ btyp_double
Definition ov-base.h:84