comparison libinterp/octave-value/ov-cx-sparse.h @ 15195:2fc554ffbc28

split libinterp from src * libinterp: New directory. Move all files from src directory here except Makefile.am, main.cc, main-cli.cc, mkoctfile.in.cc, mkoctfilr.in.sh, octave-config.in.cc, octave-config.in.sh. * libinterp/Makefile.am: New file, extracted from src/Makefile.am. * src/Makefile.am: Delete everything except targets and definitions needed to build and link main and utility programs. * Makefile.am (SUBDIRS): Include libinterp in the list. * autogen.sh: Run config-module.sh in libinterp/dldfcn directory, not src/dldfcn directory. * configure.ac (AC_CONFIG_SRCDIR): Use libinterp/octave.cc, not src/octave.cc. (DL_LDFLAGS, LIBOCTINTERP): Use libinterp, not src. (AC_CONFIG_FILES): Include libinterp/Makefile in the list. * find-docstring-files.sh: Look in libinterp, not src. * gui/src/Makefile.am (liboctgui_la_CPPFLAGS): Find header files in libinterp, not src.
author John W. Eaton <jwe@octave.org>
date Sat, 18 Aug 2012 16:23:39 -0400
parents src/octave-value/ov-cx-sparse.h@46b19589b593
children
comparison
equal deleted inserted replaced
15194:0f0b795044c3 15195:2fc554ffbc28
1 /*
2
3 Copyright (C) 2004-2012 David Bateman
4 Copyright (C) 1998-2004 Andy Adler
5
6 This file is part of Octave.
7
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21
22 */
23
24 #if !defined (octave_sparse_complex_matrix_h)
25 #define octave_sparse_complex_matrix_h 1
26
27 #include <cstdlib>
28
29 #include <iosfwd>
30 #include <string>
31
32 #include "mx-base.h"
33 #include "oct-alloc.h"
34 #include "str-vec.h"
35
36 #include "error.h"
37 #include "oct-stream.h"
38 #include "ov-base.h"
39 #include "ov-typeinfo.h"
40
41 #include "CSparse.h"
42 #include "ov-base-sparse.h"
43 #include "ov-re-sparse.h"
44
45 class octave_value_list;
46
47 class tree_walker;
48
49 class
50 OCTINTERP_API
51 octave_sparse_complex_matrix : public octave_base_sparse<SparseComplexMatrix>
52 {
53 public:
54
55 octave_sparse_complex_matrix (void)
56 : octave_base_sparse<SparseComplexMatrix> () { }
57
58 octave_sparse_complex_matrix (const ComplexNDArray& m)
59 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { }
60
61 octave_sparse_complex_matrix (const ComplexMatrix& m)
62 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { }
63
64 octave_sparse_complex_matrix (const SparseComplexMatrix& m)
65 : octave_base_sparse<SparseComplexMatrix> (m) { }
66
67 octave_sparse_complex_matrix (const SparseComplexMatrix& m,
68 const MatrixType &t)
69 : octave_base_sparse<SparseComplexMatrix> (m, t) { }
70
71 octave_sparse_complex_matrix (const MSparse<Complex>& m)
72 : octave_base_sparse<SparseComplexMatrix> (m) { }
73
74 octave_sparse_complex_matrix (const MSparse<Complex>& m,
75 const MatrixType &t)
76 : octave_base_sparse<SparseComplexMatrix> (m, t) { }
77
78 octave_sparse_complex_matrix (const Sparse<Complex>& m,
79 const MatrixType &t)
80 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m), t) { }
81
82 octave_sparse_complex_matrix (const Sparse<Complex>& m)
83 : octave_base_sparse<SparseComplexMatrix> (SparseComplexMatrix (m)) { }
84
85 octave_sparse_complex_matrix (const octave_sparse_complex_matrix& cm)
86 : octave_base_sparse<SparseComplexMatrix> (cm) { }
87
88 ~octave_sparse_complex_matrix (void) { }
89
90 octave_base_value *clone (void) const { return new octave_sparse_complex_matrix (*this); }
91 octave_base_value *empty_clone (void) const { return new octave_sparse_complex_matrix (); }
92
93 octave_base_value *try_narrowing_conversion (void);
94
95 builtin_type_t builtin_type (void) const { return btyp_complex; }
96
97 bool is_complex_matrix (void) const { return true; }
98
99 bool is_complex_type (void) const { return true; }
100
101 bool is_double_type (void) const { return true; }
102
103 bool is_float_type (void) const { return true; }
104
105 double double_value (bool = false) const;
106
107 double scalar_value (bool frc_str_conv = false) const
108 { return double_value (frc_str_conv); }
109
110 Matrix matrix_value (bool = false) const;
111
112 Complex complex_value (bool = false) const;
113
114 ComplexMatrix complex_matrix_value (bool = false) const;
115
116 ComplexNDArray complex_array_value (bool = false) const;
117
118 charNDArray char_array_value (bool frc_str_conv = false) const;
119
120 SparseMatrix sparse_matrix_value (bool = false) const;
121
122 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const
123 { return matrix; }
124
125 SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const;
126
127 #if 0
128 int write (octave_stream& os, int block_size,
129 oct_data_conv::data_type output_type, int skip,
130 oct_mach_info::float_format flt_fmt) const
131 {
132 // Yes, for compatibility, we drop the imaginary part here.
133 return os.write (matrix_value (true), block_size, output_type,
134 skip, flt_fmt);
135 }
136 #endif
137
138 bool save_binary (std::ostream& os, bool& save_as_floats);
139
140 bool load_binary (std::istream& is, bool swap,
141 oct_mach_info::float_format fmt);
142
143 #if defined (HAVE_HDF5)
144 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats);
145
146 bool load_hdf5 (hid_t loc_id, const char *name);
147 #endif
148
149 mxArray *as_mxArray (void) const;
150
151 octave_value map (unary_mapper_t umap) const;
152
153 private:
154
155 DECLARE_OCTAVE_ALLOCATOR
156
157 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
158 };
159
160 #endif