comparison src/ov-struct.h @ 5900:c20eb7330d13

[project @ 2006-07-22 08:31:16 by jwe]
author jwe
date Sat, 22 Jul 2006 08:31:17 +0000
parents c5b54890f3d1
children cdef72fcd206
comparison
equal deleted inserted replaced
5899:82c38ce145a7 5900:c20eb7330d13
85 85
86 dim_vector dims (void) const { return map.dims (); } 86 dim_vector dims (void) const { return map.dims (); }
87 87
88 size_t byte_size (void) const; 88 size_t byte_size (void) const;
89 89
90 // This is the number of elements in each field. The total number
91 // of elements is numel () * nfields ().
92 octave_idx_type numel (void) const
93 {
94 dim_vector dv = dims ();
95 return dv.numel ();
96 }
97
98 octave_idx_type nfields (void) const { return map.length (); }
99
90 octave_value reshape (const dim_vector& new_dims) const 100 octave_value reshape (const dim_vector& new_dims) const
91 { return map.reshape (new_dims); } 101 { return map.reshape (new_dims); }
92 102
93 octave_value resize (const dim_vector& dv, bool = false) const 103 octave_value resize (const dim_vector& dv, bool = false) const
94 { Octave_map tmap = map; tmap.resize (dv); return tmap; } 104 { Octave_map tmap = map; tmap.resize (dv); return tmap; }
121 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); 131 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats);
122 132
123 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); 133 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug);
124 #endif 134 #endif
125 135
136 mxArray *as_mxArray (void) const;
137
126 private: 138 private:
127 139
128 // The associative array used to manage the structure data. 140 // The associative array used to manage the structure data.
129 Octave_map map; 141 Octave_map map;
130 142