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 (Cell_h)
00025 #define Cell_h 1
00026
00027 #include <string>
00028
00029 #include "Array.h"
00030 #include "oct-alloc.h"
00031 #include "str-vec.h"
00032 #include "ov.h"
00033
00034 class octave_value_list;
00035
00036 class
00037 OCTINTERP_API
00038 Cell : public Array<octave_value>
00039 {
00040 public:
00041
00042 Cell (void)
00043 : Array<octave_value> (dim_vector (0, 0)) { }
00044
00045 Cell (const octave_value& val)
00046 : Array<octave_value> (dim_vector (1, 1), val) { }
00047
00048 Cell (const octave_value_list& ovl);
00049
00050 Cell (octave_idx_type n, octave_idx_type m,
00051 const octave_value& val = resize_fill_value ())
00052 : Array<octave_value> (dim_vector (n, m), val) { }
00053
00054 Cell (const dim_vector& dv, const octave_value& val = resize_fill_value ())
00055 : Array<octave_value> (dv, val) { }
00056
00057 Cell (const Array<octave_value>& c)
00058 : Array<octave_value> (c) { }
00059
00060 Cell (const Array<octave_value>& c, octave_idx_type nr, octave_idx_type nc)
00061 : Array<octave_value> (c, dim_vector (nr, nc)) { }
00062
00063 Cell (const string_vector& sv, bool trim = false);
00064
00065 Cell (const Array<std::string>& sa);
00066
00067 Cell (const dim_vector& dv, const string_vector& sv, bool trim = false);
00068
00069 Cell (const Cell& c)
00070 : Array<octave_value> (c) { }
00071
00072 bool is_cellstr (void) const;
00073
00074 Cell index (const octave_value_list& idx, bool resize_ok = false) const;
00075
00076 Cell& delete_elements (const octave_value_list& idx);
00077
00078 Cell& assign (const octave_value_list& idx, const Cell& rhs,
00079 const octave_value& fill_val = resize_fill_value ());
00080
00081 Cell reshape (const dim_vector& new_dims) const
00082 { return Array<octave_value>::reshape (new_dims); }
00083
00084 octave_idx_type nnz (void) const;
00085
00086 Cell column (octave_idx_type i) const;
00087
00088
00089 boolMatrix all (int = 0) const { return boolMatrix (); }
00090
00091
00092 boolMatrix any (int = 0) const { return boolMatrix (); }
00093
00094 Cell concat (const Cell& rb, const Array<octave_idx_type>& ra_idx);
00095
00096 Cell& insert (const Cell& a, octave_idx_type r, octave_idx_type c);
00097 Cell& insert (const Cell& a, const Array<octave_idx_type>& ra_idx);
00098
00099
00100 bool any_element_is_nan (void) const { return false; }
00101 bool is_true (void) const { return false; }
00102
00103 static octave_value resize_fill_value (void) { return Matrix (); }
00104
00105 Cell diag (octave_idx_type k = 0) const;
00106
00107 Cell xisalnum (void) const { return map (&octave_value::xisalnum); }
00108 Cell xisalpha (void) const { return map (&octave_value::xisalpha); }
00109 Cell xisascii (void) const { return map (&octave_value::xisascii); }
00110 Cell xiscntrl (void) const { return map (&octave_value::xiscntrl); }
00111 Cell xisdigit (void) const { return map (&octave_value::xisdigit); }
00112 Cell xisgraph (void) const { return map (&octave_value::xisgraph); }
00113 Cell xislower (void) const { return map (&octave_value::xislower); }
00114 Cell xisprint (void) const { return map (&octave_value::xisprint); }
00115 Cell xispunct (void) const { return map (&octave_value::xispunct); }
00116 Cell xisspace (void) const { return map (&octave_value::xisspace); }
00117 Cell xisupper (void) const { return map (&octave_value::xisupper); }
00118 Cell xisxdigit (void) const { return map (&octave_value::xisxdigit); }
00119 Cell xtoascii (void) const { return map (&octave_value::xtoascii); }
00120 Cell xtolower (void) const { return map (&octave_value::xtolower); }
00121 Cell xtoupper (void) const { return map (&octave_value::xtoupper); }
00122
00123 private:
00124
00125 typedef octave_value (octave_value::*ctype_mapper) (void) const;
00126
00127 Cell map (ctype_mapper) const;
00128 };
00129
00130 #endif
00131
00132
00133
00134
00135
00136