comparison src/oct-map.h @ 10743:cb3ed842bd30

make the new interface more backward compatible
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 23 Jun 2010 12:21:49 +0200
parents 604e13a89c7f
children 4716e2e17118
comparison
equal deleted inserted replaced
10742:604e13a89c7f 10743:cb3ed842bd30
300 300
301 // check whether a field exists. 301 // check whether a field exists.
302 bool isfield (const std::string& name) const 302 bool isfield (const std::string& name) const
303 { return keys.isfield (name); } 303 { return keys.isfield (name); }
304 304
305 bool contains (const std::string& name) const
306 { return isfield (name); }
307
305 string_vector fieldnames (void) const 308 string_vector fieldnames (void) const
306 { return keys.fieldnames (); } 309 { return keys.fieldnames (); }
307 310
308 // get contents of a given field. empty value if not exist. 311 // get contents of a given field. empty value if not exist.
309 Cell getfield (const std::string& key) const; 312 Cell getfield (const std::string& key) const;
312 // correct dimensions. 315 // correct dimensions.
313 void setfield (const std::string& key, const Cell& val); 316 void setfield (const std::string& key, const Cell& val);
314 317
315 // remove a given field. do nothing if not exist. 318 // remove a given field. do nothing if not exist.
316 void rmfield (const std::string& key); 319 void rmfield (const std::string& key);
320 void del (const std::string& key) { rmfield (key); }
317 321
318 // return a copy with fields ordered, optionally along with permutation. 322 // return a copy with fields ordered, optionally along with permutation.
319 octave_map orderfields (void) const; 323 octave_map orderfields (void) const;
320 octave_map orderfields (Array<octave_idx_type>& perm) const; 324 octave_map orderfields (Array<octave_idx_type>& perm) const;
321 octave_map orderfields (const octave_map& other, 325 octave_map orderfields (const octave_map& other,
356 360
357 octave_map transpose (void) const; 361 octave_map transpose (void) const;
358 362
359 octave_map reshape (const dim_vector& dv) const; 363 octave_map reshape (const dim_vector& dv) const;
360 364
361 void resize (const dim_vector& dv); 365 void resize (const dim_vector& dv, bool fill = false);
362 366
363 static octave_map 367 static octave_map
364 cat (int dim, octave_idx_type n, const octave_scalar_map *map_list); 368 cat (int dim, octave_idx_type n, const octave_scalar_map *map_list);
365 369
366 static octave_map 370 static octave_map
367 cat (int dim, octave_idx_type n, const octave_map *map_list); 371 cat (int dim, octave_idx_type n, const octave_map *map_list);
368 372
369 octave_map index (const idx_vector& i, bool resize_ok) const; 373 octave_map index (const idx_vector& i, bool resize_ok = false) const;
370 374
371 octave_map index (const idx_vector& i, const idx_vector& j, 375 octave_map index (const idx_vector& i, const idx_vector& j,
372 bool resize_ok) const; 376 bool resize_ok = false) const;
373 377
374 octave_map index (const Array<idx_vector>& ia, 378 octave_map index (const Array<idx_vector>& ia,
375 bool resize_ok) const; 379 bool resize_ok = false) const;
376 380
377 octave_map index (const octave_value_list&, bool resize_ok) const; 381 octave_map index (const octave_value_list&, bool resize_ok = false) const;
378 382
379 void assign (const idx_vector& i, const octave_map& rhs); 383 void assign (const idx_vector& i, const octave_map& rhs);
380 384
381 void assign (const idx_vector& i, const idx_vector& j, const octave_map& rhs); 385 void assign (const idx_vector& i, const idx_vector& j, const octave_map& rhs);
382 386