#include "oct-map.h"
Public Types | |
typedef std::map< std::string, Cell >::const_iterator | const_iterator |
typedef std::list< std::string > ::const_iterator | const_key_list_iterator |
typedef std::map< std::string, Cell >::iterator | iterator |
typedef std::list< std::string > ::iterator | key_list_iterator |
Public Member Functions | |
Octave_map (const dim_vector &dv=dim_vector(0, 0), const Cell &key_vals=Cell()) | |
Octave_map (const std::string &k, const octave_value &value) | |
Octave_map (const std::string &k, const Cell &vals) | |
Octave_map (const std::string &k, const octave_value_list &val_list) | |
Octave_map (const string_vector &sv, const dim_vector &dv=dim_vector(0, 0)) | |
Octave_map (const Octave_map &m) | |
Octave_map (const octave_map &m) | |
~Octave_map (void) | |
Octave_map & | assign (const std::string &k, const Cell &rhs) |
Octave_map & | assign (const octave_value_list &idx, const Octave_map &rhs) |
Octave_map & | assign (const octave_value_list &idx, const std::string &k, const Cell &rhs) |
Octave_map & | assign (const std::string &k, const octave_value &rhs) |
iterator | begin (void) |
const_iterator | begin (void) const |
void | clear (void) |
octave_idx_type | columns (void) const |
Octave_map | concat (const Octave_map &rb, const Array< octave_idx_type > &ra_idx) |
bool | contains (const std::string &k) const |
Cell & | contents (iterator p) |
Cell & | contents (const std::string &k) |
Cell | contents (const_iterator p) const |
Cell | contents (const std::string &k) const |
void | del (const std::string &k) |
dim_vector | dims (void) const |
iterator | end (void) |
const_iterator | end (void) const |
Octave_map | index (const octave_value_list &idx, bool resize_ok=false) const |
int | intfield (const std::string &k, int def_val=0) const |
std::string | key (const_iterator p) const |
string_vector | keys (void) const |
Octave_map & | maybe_delete_elements (const octave_value_list &idx) |
int | ndims (void) const |
octave_idx_type | nfields (void) const |
octave_idx_type | numel (void) const |
Octave_map & | operator= (const Octave_map &m) |
Octave_map | permute (const Array< int > &vec, bool inv=false) const |
Octave_map | reshape (const dim_vector &new_dims) const |
void | resize (const dim_vector &dv, bool fill=false) |
octave_idx_type | rows (void) const |
iterator | seek (const std::string &k) |
const_iterator | seek (const std::string &k) const |
Octave_map | squeeze (void) const |
std::string | stringfield (const std::string &k, const std::string &def_val=std::string()) const |
Octave_map | transpose (void) const |
Private Member Functions | |
void | maybe_add_to_key_list (const std::string &k) |
Private Attributes | |
dim_vector | dimensions |
std::list< std::string > | key_list |
std::map< std::string, Cell > | map |
Definition at line 479 of file oct-map.h.
typedef std::map<std::string, Cell>::const_iterator Octave_map::const_iterator |
typedef std::list<std::string>::const_iterator Octave_map::const_key_list_iterator |
typedef std::map<std::string, Cell>::iterator Octave_map::iterator |
typedef std::list<std::string>::iterator Octave_map::key_list_iterator |
Octave_map::Octave_map | ( | const dim_vector & | dv = dim_vector (0, 0) , |
|
const Cell & | key_vals = Cell () | |||
) |
Definition at line 1313 of file oct-map.cc.
References error(), Cell::is_cellstr(), key_list, map, and Array< T >::numel().
Octave_map::Octave_map | ( | const std::string & | k, | |
const octave_value & | value | |||
) | [inline] |
Octave_map::Octave_map | ( | const string_vector & | sv, | |
const dim_vector & | dv = dim_vector (0, 0) | |||
) | [inline] |
Definition at line 503 of file oct-map.h.
References Array< T >::length().
Octave_map::Octave_map | ( | const std::string & | k, | |
const Cell & | vals | |||
) | [inline] |
Octave_map::Octave_map | ( | const std::string & | k, | |
const octave_value_list & | val_list | |||
) | [inline] |
Octave_map::Octave_map | ( | const Octave_map & | m | ) | [inline] |
Octave_map::Octave_map | ( | const octave_map & | m | ) |
Definition at line 1331 of file oct-map.cc.
References octave_map::begin(), octave_map::contents(), octave_map::end(), octave_map::fieldnames(), octave_map::key(), key_list, map, and Array< T >::numel().
Octave_map & Octave_map::assign | ( | const octave_value_list & | idx, | |
const Octave_map & | rhs | |||
) |
Definition at line 1611 of file oct-map.cc.
References Cell::assign(), contents(), Array< T >::dims(), dims(), error(), error_state, keys_ok(), Array< T >::length(), and resize().
Referenced by concat(), index(), permute(), read_mat5_binary_element(), reshape(), resize(), squeeze(), and transpose().
Octave_map & Octave_map::assign | ( | const octave_value_list & | idx, | |
const std::string & | k, | |||
const Cell & | rhs | |||
) |
Definition at line 1653 of file oct-map.cc.
References Cell::assign(), begin(), contains(), contents(), dimensions, Array< T >::dims(), end(), error_state, map, maybe_add_to_key_list(), Array< T >::resize(), and Cell::resize_fill_value().
Octave_map & Octave_map::assign | ( | const std::string & | k, | |
const octave_value & | rhs | |||
) |
Definition at line 1686 of file oct-map.cc.
References dim_vector::all_ones(), dimensions, dims(), error(), map, maybe_add_to_key_list(), and nfields().
Octave_map & Octave_map::assign | ( | const std::string & | k, | |
const Cell & | rhs | |||
) |
Definition at line 1714 of file oct-map.cc.
References dimensions, dims(), Array< T >::dims(), error(), map, maybe_add_to_key_list(), and nfields().
iterator Octave_map::begin | ( | void | ) | [inline] |
Definition at line 572 of file oct-map.h.
Referenced by assign(), concat(), index(), permute(), read_mat5_binary_element(), reshape(), resize(), save_mat5_element_length(), squeeze(), and transpose().
const_iterator Octave_map::begin | ( | void | ) | const [inline] |
octave_idx_type Octave_map::columns | ( | void | ) | const [inline] |
Octave_map Octave_map::concat | ( | const Octave_map & | rb, | |
const Array< octave_idx_type > & | ra_idx | |||
) |
Definition at line 1505 of file oct-map.cc.
References dim_vector::all_zero(), assign(), begin(), contents(), dims(), end(), error(), key(), key_list, nfields(), and seek().
bool Octave_map::contains | ( | const std::string & | k | ) | const [inline] |
Cell & Octave_map::contents | ( | const std::string & | k | ) |
Definition at line 1384 of file oct-map.cc.
References map, and maybe_add_to_key_list().
Referenced by assign(), concat(), DEFUN_DLD(), index(), intfield(), maybe_delete_elements(), octave_map::octave_map(), permute(), read_mat5_binary_element(), reshape(), resize(), save_mat5_binary_element(), save_mat5_element_length(), squeeze(), stringfield(), and transpose().
Cell Octave_map::contents | ( | const std::string & | k | ) | const |
Definition at line 1392 of file oct-map.cc.
Cell Octave_map::contents | ( | const_iterator | p | ) | const [inline] |
void Octave_map::del | ( | const std::string & | k | ) | [inline] |
dim_vector Octave_map::dims | ( | void | ) | const [inline] |
const_iterator Octave_map::end | ( | void | ) | const [inline] |
iterator Octave_map::end | ( | void | ) | [inline] |
Definition at line 575 of file oct-map.h.
Referenced by assign(), concat(), contents(), index(), permute(), read_mat5_binary_element(), reshape(), resize(), save_mat5_element_length(), squeeze(), and transpose().
Octave_map Octave_map::index | ( | const octave_value_list & | idx, | |
bool | resize_ok = false | |||
) | const |
Definition at line 1740 of file oct-map.cc.
References assign(), begin(), contents(), end(), error_state, key(), key_list, and octave_value_list::length().
Definition at line 1400 of file oct-map.cc.
References contents(), and Array< T >::is_empty().
std::string Octave_map::key | ( | const_iterator | p | ) | const [inline] |
Definition at line 578 of file oct-map.h.
Referenced by concat(), index(), permute(), read_mat5_binary_element(), reshape(), resize(), squeeze(), and transpose().
string_vector Octave_map::keys | ( | void | ) | const |
Definition at line 1427 of file oct-map.cc.
References key_list, and nfields().
Referenced by keys_ok(), maybe_delete_elements(), and save_mat5_binary_element().
void Octave_map::maybe_add_to_key_list | ( | const std::string & | k | ) | [inline, private] |
Definition at line 652 of file oct-map.h.
Referenced by assign(), and contents().
Octave_map & Octave_map::maybe_delete_elements | ( | const octave_value_list & | idx | ) |
Definition at line 1586 of file oct-map.cc.
References contents(), Cell::delete_elements(), dimensions, Array< T >::dims(), error_state, keys(), and Array< T >::length().
int Octave_map::ndims | ( | void | ) | const [inline] |
Definition at line 614 of file oct-map.h.
Referenced by transpose().
octave_idx_type Octave_map::nfields | ( | void | ) | const [inline] |
Definition at line 553 of file oct-map.h.
Referenced by assign(), concat(), keys(), keys_ok(), read_mat5_binary_element(), resize(), and save_mat5_binary_element().
octave_idx_type Octave_map::numel | ( | void | ) | const [inline] |
Definition at line 622 of file oct-map.h.
Referenced by save_mat5_binary_element(), and save_mat5_element_length().
Octave_map& Octave_map::operator= | ( | const Octave_map & | m | ) | [inline] |
Definition at line 534 of file oct-map.h.
References dimensions, key_list, and map.
Octave_map Octave_map::permute | ( | const Array< int > & | vec, | |
bool | inv = false | |||
) | const |
Definition at line 1363 of file oct-map.cc.
References assign(), begin(), contents(), dims(), end(), error_state, key(), key_list, and Array< T >::permute().
Octave_map Octave_map::reshape | ( | const dim_vector & | new_dims | ) | const |
Definition at line 1458 of file oct-map.cc.
References assign(), begin(), contents(), dimensions, dims(), end(), key(), and key_list.
void Octave_map::resize | ( | const dim_vector & | dv, | |
bool | fill = false | |||
) |
Definition at line 1479 of file oct-map.cc.
References assign(), begin(), contents(), dimensions, dims(), end(), key(), nfields(), Array< T >::resize(), and Cell::resize_fill_value().
Referenced by assign().
octave_idx_type Octave_map::rows | ( | void | ) | const [inline] |
const_iterator Octave_map::seek | ( | const std::string & | k | ) | const [inline] |
iterator Octave_map::seek | ( | const std::string & | k | ) | [inline] |
Definition at line 594 of file oct-map.h.
Referenced by concat(), and contents().
Octave_map Octave_map::squeeze | ( | void | ) | const |
Definition at line 1342 of file oct-map.cc.
References assign(), begin(), contents(), dims(), end(), error_state, key(), key_list, and Array< T >::squeeze().
std::string Octave_map::stringfield | ( | const std::string & | k, | |
const std::string & | def_val = std::string () | |||
) | const |
Definition at line 1413 of file oct-map.cc.
References contents(), and Array< T >::is_empty().
Octave_map Octave_map::transpose | ( | void | ) | const |
Definition at line 1435 of file oct-map.cc.
References assign(), begin(), contents(), dims(), end(), key(), key_list, and ndims().
dim_vector Octave_map::dimensions [mutable, private] |
Definition at line 650 of file oct-map.h.
Referenced by assign(), maybe_delete_elements(), operator=(), reshape(), and resize().
std::list<std::string> Octave_map::key_list [private] |
Definition at line 647 of file oct-map.h.
Referenced by concat(), index(), keys(), Octave_map(), operator=(), permute(), reshape(), squeeze(), and transpose().
std::map<std::string, Cell> Octave_map::map [private] |
Definition at line 643 of file oct-map.h.
Referenced by assign(), contents(), Octave_map(), and operator=().