Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_sparse_bool_matrix_h)
00025 #define octave_sparse_bool_matrix_h 1
00026
00027 #include <cstdlib>
00028
00029 #include <iosfwd>
00030 #include <string>
00031
00032 #include "mx-base.h"
00033 #include "oct-alloc.h"
00034 #include "str-vec.h"
00035
00036 #include "error.h"
00037 #include "oct-stream.h"
00038 #include "ov-base.h"
00039 #include "ov-typeinfo.h"
00040
00041 #include "boolSparse.h"
00042 #include "ov-base-sparse.h"
00043 #include "ov-re-sparse.h"
00044
00045 class octave_value_list;
00046
00047 class tree_walker;
00048
00049 class
00050 OCTINTERP_API
00051 octave_sparse_bool_matrix : public octave_base_sparse<SparseBoolMatrix>
00052 {
00053 public:
00054
00055 octave_sparse_bool_matrix (void)
00056 : octave_base_sparse<SparseBoolMatrix> () { }
00057
00058 octave_sparse_bool_matrix (const SparseBoolMatrix& bnda)
00059 : octave_base_sparse<SparseBoolMatrix> (bnda) { }
00060
00061 octave_sparse_bool_matrix (const SparseBoolMatrix& bnda,
00062 const MatrixType& t)
00063 : octave_base_sparse<SparseBoolMatrix> (bnda, t) { }
00064
00065 octave_sparse_bool_matrix (const boolNDArray& m)
00066 : octave_base_sparse<SparseBoolMatrix> (SparseBoolMatrix (m)) { }
00067
00068 octave_sparse_bool_matrix (const boolMatrix& m)
00069 : octave_base_sparse<SparseBoolMatrix> (SparseBoolMatrix (m)) { }
00070
00071 octave_sparse_bool_matrix (const Sparse<bool>& a)
00072 : octave_base_sparse<SparseBoolMatrix> (a) { }
00073
00074 octave_sparse_bool_matrix (const octave_sparse_bool_matrix& bm)
00075 : octave_base_sparse<SparseBoolMatrix> (bm) { }
00076
00077 ~octave_sparse_bool_matrix (void) { }
00078
00079 octave_base_value *clone (void) const { return new octave_sparse_bool_matrix (*this); }
00080 octave_base_value *empty_clone (void) const { return new octave_sparse_bool_matrix (); }
00081
00082 type_conv_info numeric_conversion_function (void) const;
00083
00084 octave_base_value *try_narrowing_conversion (void);
00085
00086
00087 idx_vector index_vector (void) const
00088 { return idx_vector (bool_array_value ()); }
00089
00090 builtin_type_t builtin_type (void) const { return btyp_bool; }
00091
00092 bool is_bool_matrix (void) const { return true; }
00093
00094 bool is_bool_type (void) const { return true; }
00095
00096 bool is_real_type (void) const { return true; }
00097
00098 bool is_numeric_type (void) const { return false; }
00099
00100 double double_value (bool = false) const;
00101
00102 double scalar_value (bool frc_str_conv = false) const
00103 { return double_value (frc_str_conv); }
00104
00105 Matrix matrix_value (bool = false) const;
00106
00107 NDArray array_value (bool = false) const;
00108
00109 Complex complex_value (bool = false) const;
00110
00111 ComplexMatrix complex_matrix_value (bool = false) const;
00112
00113 ComplexNDArray complex_array_value (bool = false) const;
00114
00115 charNDArray char_array_value (bool = false) const;
00116
00117 boolMatrix bool_matrix_value (bool = false) const;
00118
00119 boolNDArray bool_array_value (bool = false) const;
00120
00121 SparseMatrix sparse_matrix_value (bool = false) const;
00122
00123 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const;
00124
00125 SparseBoolMatrix sparse_bool_matrix_value (bool = false) const
00126 { return matrix; }
00127
00128 octave_value convert_to_str_internal (bool pad, bool force, char type) const;
00129
00130 bool save_binary (std::ostream& os, bool& save_as_floats);
00131
00132 bool load_binary (std::istream& is, bool swap,
00133 oct_mach_info::float_format fmt);
00134
00135 #if defined (HAVE_HDF5)
00136 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats);
00137
00138 bool load_hdf5 (hid_t loc_id, const char *name);
00139 #endif
00140
00141 mxArray *as_mxArray (void) const;
00142
00143
00144 octave_value map (unary_mapper_t umap) const
00145 {
00146 octave_sparse_matrix m (sparse_matrix_value ());
00147 return m.map (umap);
00148 }
00149
00150 protected:
00151
00152 DECLARE_OCTAVE_ALLOCATOR
00153
00154 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
00155 };
00156
00157 #endif