GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#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 string_vector &sv, const dim_vector &dv=dim_vector(0, 0)) | |
Octave_map (const std::string &k, const Cell &vals) | |
Octave_map (const std::string &k, const octave_value_list &val_list) | |
Octave_map (const Octave_map &m) | |
Octave_map (const octave_map &m) | |
~Octave_map (void) | |
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) |
Octave_map & | assign (const std::string &k, const Cell &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 (const std::string &k) |
Cell | contents (const std::string &k) const |
Cell & | contents (iterator p) |
Cell | contents (const_iterator p) 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 |
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 1317 of file oct-map.cc.
References error(), Cell::is_cellstr(), key_list, map, and Array< T >::numel().
|
inline |
|
inline |
Definition at line 506 of file oct-map.h.
References Array< T >::length().
|
inline |
|
inline |
|
inline |
Octave_map::Octave_map | ( | const octave_map & | m | ) |
Definition at line 1335 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 1615 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(), 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 1657 of file oct-map.cc.
References Cell::assign(), begin(), contains(), contents(), dimensions, Array< T >::dims(), end(), error_state, map, maybe_add_to_key_list(), and Array< T >::resize().
Octave_map & Octave_map::assign | ( | const std::string & | k, |
const octave_value & | rhs | ||
) |
Definition at line 1690 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 1718 of file oct-map.cc.
References dimensions, Array< T >::dims(), dims(), error(), map, maybe_add_to_key_list(), and nfields().
|
inline |
|
inline |
Octave_map Octave_map::concat | ( | const Octave_map & | rb, |
const Array< octave_idx_type > & | ra_idx | ||
) |
Definition at line 1509 of file oct-map.cc.
References dim_vector::all_zero(), assign(), begin(), contents(), dims(), end(), error(), key(), key_list, nfields(), and seek().
|
inline |
Cell & Octave_map::contents | ( | const std::string & | k | ) |
Definition at line 1388 of file oct-map.cc.
References map, and maybe_add_to_key_list().
Referenced by assign(), concat(), index(), intfield(), maybe_delete_elements(), octave_map::octave_map(), permute(), reshape(), resize(), squeeze(), stringfield(), and transpose().
Cell Octave_map::contents | ( | const std::string & | k | ) | const |
Definition at line 1396 of file oct-map.cc.
|
inline |
|
inline |
|
inline |
|
inline |
Octave_map Octave_map::index | ( | const octave_value_list & | idx, |
bool | resize_ok = false |
||
) | const |
Definition at line 1744 of file oct-map.cc.
References assign(), begin(), contents(), end(), error_state, key(), key_list, and octave_value_list::length().
Definition at line 1404 of file oct-map.cc.
References contents(), and Array< T >::is_empty().
|
inline |
string_vector Octave_map::keys | ( | void | ) | const |
Definition at line 1431 of file oct-map.cc.
References key_list, and nfields().
Referenced by keys_ok(), and maybe_delete_elements().
|
inlineprivate |
Definition at line 656 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 1590 of file oct-map.cc.
References contents(), Cell::delete_elements(), dimensions, Array< T >::dims(), error_state, keys(), and Array< T >::length().
Definition at line 617 of file oct-map.h.
Referenced by transpose().
|
inline |
|
inline |
|
inline |
Definition at line 537 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 1367 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 1462 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 1483 of file oct-map.cc.
References assign(), begin(), contents(), dimensions, dims(), end(), key(), nfields(), and Array< T >::resize().
Referenced by assign().
|
inline |
|
inline |
Definition at line 597 of file oct-map.h.
Referenced by concat(), and contents().
|
inline |
Octave_map Octave_map::squeeze | ( | void | ) | const |
Definition at line 1346 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 1417 of file oct-map.cc.
References contents(), and Array< T >::is_empty().
Octave_map Octave_map::transpose | ( | void | ) | const |
Definition at line 1439 of file oct-map.cc.
References assign(), begin(), contents(), dims(), end(), key(), key_list, and ndims().
|
mutableprivate |
Definition at line 654 of file oct-map.h.
Referenced by assign(), maybe_delete_elements(), operator=(), reshape(), and resize().
|
private |
Definition at line 651 of file oct-map.h.
Referenced by concat(), index(), keys(), Octave_map(), operator=(), permute(), reshape(), squeeze(), and transpose().
|
private |
Definition at line 647 of file oct-map.h.
Referenced by assign(), contents(), Octave_map(), and operator=().