GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave_map Class Reference

#include "oct-map.h"

Public Types

typedef octave_fields::const_iterator const_iterator
 
typedef octave_scalar_map element_type
 
typedef const_iterator iterator
 

Public Member Functions

 octave_map (const dim_vector &dv)
 
 octave_map (const dim_vector &dv, const octave_fields &k)
 
 octave_map (const dim_vector &dv, const string_vector &k)
 
 octave_map (const octave_fields &k)
 
 octave_map (const octave_scalar_map &m)
 
 octave_map (const string_vector &k)
 
void assign (const Array< octave::idx_vector > &ia, const octave_map &rhs)
 
void assign (const octave::idx_vector &i, const octave::idx_vector &j, const octave_map &rhs)
 
void assign (const octave::idx_vector &i, const octave_map &rhs)
 
void assign (const octave_value_list &, const octave_map &rhs)
 
void assign (const octave_value_list &idx, const std::string &k, const Cell &rhs)
 
void assign (const std::string &k, const Cell &val)
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
octave_scalar_map checkelem (const Array< octave_idx_type > &ra_idx) const
 
octave_scalar_map checkelem (octave_idx_type i, octave_idx_type j) const
 
octave_scalar_map checkelem (octave_idx_type n) const
 
void clear ()
 
octave_idx_type cols () const
 
octave_map column (octave_idx_type k) const
 
octave_idx_type columns () const
 
octave_map concat (const octave_map &rb, const Array< octave_idx_type > &ra_idx)
 
bool contains (const std::string &name) const
 
Cellcontents (const std::string &k)
 
Cell contents (const std::string &k) const
 
const Cellcontents (const_iterator p) const
 
Cellcontents (iterator p)
 
Cellcontents (octave_idx_type i)
 
const Cellcontents (octave_idx_type i) const
 
void del (const std::string &k)
 
void delete_elements (const Array< octave::idx_vector > &ia)
 
void delete_elements (const octave::idx_vector &i)
 
void delete_elements (const octave_value_list &)
 
void delete_elements (int dim, const octave::idx_vector &i)
 
dim_vector dims () const
 
octave_scalar_map elem (const Array< octave_idx_type > &ra_idx) const
 
octave_scalar_map elem (octave_idx_type i, octave_idx_type j) const
 
octave_scalar_map elem (octave_idx_type n) const
 
const_iterator end () const
 
octave_scalar_map fast_elem_extract (octave_idx_type n) const
 
bool fast_elem_insert (octave_idx_type n, const octave_scalar_map &rhs)
 
string_vector fieldnames () const
 
Cell getfield (const std::string &key) const
 
octave_map index (const Array< octave::idx_vector > &ia, bool resize_ok=false) const
 
octave_map index (const octave::idx_vector &i, bool resize_ok=false) const
 
octave_map index (const octave::idx_vector &i, const octave::idx_vector &j, bool resize_ok=false) const
 
octave_map index (const octave_value_list &, bool resize_ok=false) const
 
octave_idx_type index (const_iterator p) const
 
bool isempty () const
 
bool isfield (const std::string &name) const
 
std::string key (const_iterator p) const
 
string_vector keys () const
 
octave_idx_type length () const
 
int ndims () const
 
octave_idx_type nfields () const
 
octave_idx_type numel () const
 
octave_scalar_map operator() (const Array< octave_idx_type > &ra_idx) const
 
octave_scalar_map operator() (octave_idx_type i, octave_idx_type j) const
 
octave_scalar_map operator() (octave_idx_type n) const
 
octave_map orderfields () const
 
octave_map orderfields (Array< octave_idx_type > &perm) const
 
octave_map orderfields (const octave_map &other, Array< octave_idx_type > &perm) const
 
octave_map page (octave_idx_type k) const
 
octave_map permute (const Array< int > &vec, bool inv=false) const
 
octave_map reshape (const dim_vector &dv) const
 
void resize (const dim_vector &dv, bool fill=false)
 
void rmfield (const std::string &key)
 
octave_idx_type rows () const
 
const_iterator seek (const std::string &k) const
 
void setfield (const std::string &key, const Cell &val)
 
octave_map squeeze () const
 
octave_map transpose () const
 

Static Public Member Functions

static octave_map cat (int dim, octave_idx_type n, const octave_map *map_list)
 
static octave_map cat (int dim, octave_idx_type n, const octave_scalar_map *map_list)
 

Detailed Description

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

Member Typedef Documentation

◆ const_iterator

◆ element_type

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

◆ iterator

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

Constructor & Destructor Documentation

◆ octave_map() [1/6]

octave_map::octave_map ( const octave_fields k)
inline

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

◆ octave_map() [2/6]

octave_map::octave_map ( const dim_vector dv,
const octave_fields k 
)
inline

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

◆ octave_map() [3/6]

octave_map::octave_map ( const dim_vector dv)
inline

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

◆ octave_map() [4/6]

octave_map::octave_map ( const string_vector k)
inline

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

◆ octave_map() [5/6]

octave_map::octave_map ( const dim_vector dv,
const string_vector k 
)
inline

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

◆ octave_map() [6/6]

octave_map::octave_map ( const octave_scalar_map m)

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

References m.

Member Function Documentation

◆ assign() [1/6]

void octave_map::assign ( const Array< octave::idx_vector > &  ia,
const octave_map rhs 
)

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

References assign(), error(), error_unless, octave_fields::is_same(), nfields(), and orderfields().

◆ assign() [2/6]

void octave_map::assign ( const octave::idx_vector i,
const octave::idx_vector j,
const octave_map rhs 
)

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

References assign(), error(), error_unless, octave_fields::is_same(), nfields(), and orderfields().

◆ assign() [3/6]

void octave_map::assign ( const octave::idx_vector i,
const octave_map rhs 
)

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

References assign(), error(), error_unless, octave_fields::is_same(), nfields(), and orderfields().

◆ assign() [4/6]

void octave_map::assign ( const octave_value_list idx,
const octave_map rhs 
)

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

References assign(), and octave_value_list::length().

◆ assign() [5/6]

void octave_map::assign ( const octave_value_list idx,
const std::string &  k,
const Cell rhs 
)

◆ assign() [6/6]

void octave_map::assign ( const std::string &  k,
const Cell val 
)
inline

◆ begin()

const_iterator octave_map::begin ( ) const
inline

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

References octave_fields::begin().

Referenced by Fdbstatus().

◆ cat() [1/2]

octave_map octave_map::cat ( int  dim,
octave_idx_type  n,
const octave_map map_list 
)
static

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

References error(), octave_fields::is_same(), n, nfields(), and OCTAVE_LOCAL_BUFFER.

◆ cat() [2/2]

octave_map octave_map::cat ( int  dim,
octave_idx_type  n,
const octave_scalar_map map_list 
)
static

◆ cbegin()

const_iterator octave_map::cbegin ( ) const
inline

◆ cend()

const_iterator octave_map::cend ( ) const
inline

◆ checkelem() [1/3]

octave_scalar_map octave_map::checkelem ( const Array< octave_idx_type > &  ra_idx) const
inline

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

◆ checkelem() [2/3]

octave_scalar_map octave_map::checkelem ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

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

◆ checkelem() [3/3]

◆ clear()

void octave_map::clear ( )
inline

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

◆ cols()

octave_idx_type octave_map::cols ( ) const
inline

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

◆ column()

octave_map octave_map::column ( octave_idx_type  k) const

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

References index().

◆ columns()

octave_idx_type octave_map::columns ( ) const
inline

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

Referenced by octave_struct::edit_display().

◆ concat()

octave_map octave_map::concat ( const octave_map rb,
const Array< octave_idx_type > &  ra_idx 
)

◆ contains()

bool octave_map::contains ( const std::string &  name) const
inline

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

Referenced by octave_class::reconstruct_parents(), and error_system::rethrow_error().

◆ contents() [1/6]

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

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

References octave_fields::getfield().

◆ contents() [2/6]

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

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

References getfield().

◆ contents() [3/6]

◆ contents() [4/6]

Cell& octave_map::contents ( iterator  p)
inline

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

◆ contents() [5/6]

Cell& octave_map::contents ( octave_idx_type  i)
inline

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

◆ contents() [6/6]

const Cell& octave_map::contents ( octave_idx_type  i) const
inline

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

◆ del()

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

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

◆ delete_elements() [1/4]

void octave_map::delete_elements ( const Array< octave::idx_vector > &  ia)

◆ delete_elements() [2/4]

void octave_map::delete_elements ( const octave::idx_vector i)

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

References Array< T, Alloc >::delete_elements(), Array< T, Alloc >::dims(), and nfields().

Referenced by delete_elements().

◆ delete_elements() [3/4]

void octave_map::delete_elements ( const octave_value_list idx)

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

References delete_elements(), and octave_value_list::length().

◆ delete_elements() [4/4]

void octave_map::delete_elements ( int  dim,
const octave::idx_vector i 
)

◆ dims()

dim_vector octave_map::dims ( ) const
inline

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

Referenced by octave_class::octave_class(), concat(), and permute_to_correct_order1().

◆ elem() [1/3]

octave_scalar_map octave_map::elem ( const Array< octave_idx_type > &  ra_idx) const

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

References compute_index(), and ra_idx.

◆ elem() [2/3]

octave_scalar_map octave_map::elem ( octave_idx_type  i,
octave_idx_type  j 
) const

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

References compute_index().

◆ elem() [3/3]

octave_scalar_map octave_map::elem ( octave_idx_type  n) const

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

References compute_index(), and n.

◆ end()

const_iterator octave_map::end ( ) const
inline

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

Referenced by assign(), octave_class::dotref(), octave_struct::dotref(), and Fdbstatus().

◆ fast_elem_extract()

octave_scalar_map octave_map::fast_elem_extract ( octave_idx_type  n) const

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

References n.

◆ fast_elem_insert()

bool octave_map::fast_elem_insert ( octave_idx_type  n,
const octave_scalar_map rhs 
)

◆ fieldnames()

string_vector octave_map::fieldnames ( ) const
inline

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

Referenced by Fperms().

◆ getfield()

Cell octave_map::getfield ( const std::string &  key) const

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

References octave_fields::getfield().

Referenced by contents(), and Fset().

◆ index() [1/5]

octave_map octave_map::index ( const Array< octave::idx_vector > &  ia,
bool  resize_ok = false 
) const

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

References Array< T, Alloc >::dims(), Array< T, Alloc >::index(), and nfields().

◆ index() [2/5]

octave_map octave_map::index ( const octave::idx_vector i,
bool  resize_ok = false 
) const

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

References Array< T, Alloc >::dims(), Array< T, Alloc >::index(), and nfields().

◆ index() [3/5]

octave_map octave_map::index ( const octave::idx_vector i,
const octave::idx_vector j,
bool  resize_ok = false 
) const

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

References Array< T, Alloc >::dims(), Array< T, Alloc >::index(), and nfields().

◆ index() [4/5]

octave_map octave_map::index ( const octave_value_list idx,
bool  resize_ok = false 
) const

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

References index(), and octave_value_list::length().

◆ index() [5/5]

◆ isempty()

bool octave_map::isempty ( void  ) const
inline

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

Referenced by Fdbstatus(), permute_to_correct_order1(), and error_system::rethrow_error().

◆ isfield()

bool octave_map::isfield ( const std::string &  name) const
inline

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

Referenced by bp_table::dbstop_process_map_args(), and Fset().

◆ key()

std::string octave_map::key ( const_iterator  p) const
inline

◆ keys()

string_vector octave_map::keys ( ) const
inline

◆ length()

octave_idx_type octave_map::length ( ) const
inline

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

References numel().

Referenced by octave::F__version_info__().

◆ ndims()

int octave_map::ndims ( ) const
inline

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

◆ nfields()

◆ numel()

◆ operator()() [1/3]

octave_scalar_map octave_map::operator() ( const Array< octave_idx_type > &  ra_idx) const
inline

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

◆ operator()() [2/3]

octave_scalar_map octave_map::operator() ( octave_idx_type  i,
octave_idx_type  j 
) const
inline

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

◆ operator()() [3/3]

octave_scalar_map octave_map::operator() ( octave_idx_type  n) const
inline

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

◆ orderfields() [1/3]

octave_map octave_map::orderfields ( ) const

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

Referenced by assign(), and permute_to_correct_order1().

◆ orderfields() [2/3]

octave_map octave_map::orderfields ( Array< octave_idx_type > &  perm) const

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

References nfields(), octave_fields::orderfields(), and Array< T, Alloc >::xelem().

◆ orderfields() [3/3]

octave_map octave_map::orderfields ( const octave_map other,
Array< octave_idx_type > &  perm 
) const

◆ page()

octave_map octave_map::page ( octave_idx_type  k) const

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

References index().

◆ permute()

octave_map octave_map::permute ( const Array< int > &  vec,
bool  inv = false 
) const

◆ reshape()

octave_map octave_map::reshape ( const dim_vector dv) const

◆ resize()

void octave_map::resize ( const dim_vector dv,
bool  fill = false 
)

◆ rmfield()

void octave_map::rmfield ( const std::string &  key)

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

References octave_fields::rmfield().

◆ rows()

octave_idx_type octave_map::rows ( ) const
inline

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

Referenced by octave_struct::edit_display().

◆ seek()

◆ setfield()

void octave_map::setfield ( const std::string &  key,
const Cell val 
)

◆ squeeze()

octave_map octave_map::squeeze ( ) const

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

References nfields(), and dim_vector::squeeze().

◆ transpose()

octave_map octave_map::transpose ( ) const

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

References nfields().


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