GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Octave_map Class Reference

#include "oct-map.h"

Collaboration diagram for Octave_map:
Collaboration graph
[legend]

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_mapassign (const octave_value_list &idx, const Octave_map &rhs)
Octave_mapassign (const octave_value_list &idx, const std::string &k, const Cell &rhs)
Octave_mapassign (const std::string &k, const octave_value &rhs)
Octave_mapassign (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
Cellcontents (const std::string &k)
Cell contents (const std::string &k) const
Cellcontents (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_mapmaybe_delete_elements (const octave_value_list &idx)
int ndims (void) const
octave_idx_type nfields (void) const
octave_idx_type numel (void) const
Octave_mapoperator= (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, Cellmap

Detailed Description

Definition at line 482 of file oct-map.h.

Member Typedef Documentation

typedef std::map<std::string, Cell>::const_iterator Octave_map::const_iterator

Definition at line 489 of file oct-map.h.

typedef std::list<std::string>::const_iterator Octave_map::const_key_list_iterator

Definition at line 492 of file oct-map.h.

typedef std::map<std::string, Cell>::iterator Octave_map::iterator

Definition at line 488 of file oct-map.h.

typedef std::list<std::string>::iterator Octave_map::key_list_iterator

Definition at line 491 of file oct-map.h.

Constructor & Destructor Documentation

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().

Octave_map::Octave_map ( const std::string &  k,
const octave_value value 
)
inline

Definition at line 499 of file oct-map.h.

Octave_map::Octave_map ( const string_vector sv,
const dim_vector dv = dim_vector (0, 0) 
)
inline

Definition at line 506 of file oct-map.h.

References Array< T >::length().

Octave_map::Octave_map ( const std::string &  k,
const Cell vals 
)
inline

Definition at line 518 of file oct-map.h.

Octave_map::Octave_map ( const std::string &  k,
const octave_value_list val_list 
)
inline

Definition at line 525 of file oct-map.h.

Octave_map::Octave_map ( const Octave_map m)
inline

Definition at line 532 of file oct-map.h.

Octave_map::Octave_map ( const octave_map m)
Octave_map::~Octave_map ( void  )
inline

Definition at line 549 of file oct-map.h.

Member Function Documentation

Octave_map & Octave_map::assign ( const octave_value_list idx,
const Octave_map rhs 
)
Octave_map & Octave_map::assign ( const octave_value_list idx,
const std::string &  k,
const Cell rhs 
)
Octave_map & Octave_map::assign ( const std::string &  k,
const octave_value rhs 
)
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().

iterator Octave_map::begin ( void  )
inline

Definition at line 575 of file oct-map.h.

Referenced by assign(), concat(), index(), permute(), reshape(), resize(), squeeze(), and transpose().

const_iterator Octave_map::begin ( void  ) const
inline

Definition at line 576 of file oct-map.h.

void Octave_map::clear ( void  )
inline

Definition at line 603 of file oct-map.h.

octave_idx_type Octave_map::columns ( void  ) const
inline

Definition at line 613 of file oct-map.h.

Octave_map Octave_map::concat ( const Octave_map rb,
const Array< octave_idx_type > &  ra_idx 
)
bool Octave_map::contains ( const std::string &  k) const
inline

Definition at line 600 of file oct-map.h.

Referenced by assign().

Cell & Octave_map::contents ( const std::string &  k)
Cell Octave_map::contents ( const std::string &  k) const

Definition at line 1396 of file oct-map.cc.

References end(), and seek().

Cell& Octave_map::contents ( iterator  p)
inline

Definition at line 586 of file oct-map.h.

Cell Octave_map::contents ( const_iterator  p) const
inline

Definition at line 589 of file oct-map.h.

void Octave_map::del ( const std::string &  k)
inline

Definition at line 558 of file oct-map.h.

References find().

dim_vector Octave_map::dims ( void  ) const
inline

Definition at line 615 of file oct-map.h.

Referenced by assign(), concat(), permute(), reshape(), resize(), squeeze(), and transpose().

iterator Octave_map::end ( void  )
inline

Definition at line 578 of file oct-map.h.

Referenced by assign(), concat(), contents(), index(), permute(), reshape(), resize(), squeeze(), and transpose().

const_iterator Octave_map::end ( void  ) const
inline

Definition at line 579 of file oct-map.h.

Octave_map Octave_map::index ( const octave_value_list idx,
bool  resize_ok = false 
) const
int Octave_map::intfield ( const std::string &  k,
int  def_val = 0 
) const

Definition at line 1404 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 581 of file oct-map.h.

Referenced by concat(), index(), permute(), reshape(), resize(), squeeze(), and transpose().

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().

void Octave_map::maybe_add_to_key_list ( const std::string &  k)
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)
int Octave_map::ndims ( void  ) const
inline

Definition at line 617 of file oct-map.h.

Referenced by transpose().

octave_idx_type Octave_map::nfields ( void  ) const
inline

Definition at line 556 of file oct-map.h.

Referenced by assign(), concat(), keys(), keys_ok(), and resize().

octave_idx_type Octave_map::numel ( void  ) const
inline

Definition at line 625 of file oct-map.h.

Octave_map& Octave_map::operator= ( const Octave_map m)
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().

octave_idx_type Octave_map::rows ( void  ) const
inline

Definition at line 611 of file oct-map.h.

iterator Octave_map::seek ( const std::string &  k)
inline

Definition at line 597 of file oct-map.h.

Referenced by concat(), and contents().

const_iterator Octave_map::seek ( const std::string &  k) const
inline

Definition at line 598 of file oct-map.h.

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().

Member Data Documentation

dim_vector Octave_map::dimensions
mutableprivate

Definition at line 654 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 651 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 647 of file oct-map.h.

Referenced by assign(), contents(), Octave_map(), and operator=().


The documentation for this class was generated from the following files: