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

#include "oct-map.h"

Collaboration diagram for octave_map:

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 octave_fields &k)
 
 octave_map (const dim_vector &dv, const octave_fields &k)
 
 octave_map (void)
 
 octave_map (const dim_vector &dv)
 
 octave_map (const string_vector &k)
 
 octave_map (const dim_vector &dv, const string_vector &k)
 
 octave_map (const octave_map &m)
 
 octave_map (const octave_scalar_map &m)
 
void assign (const std::string &k, const Cell &val)
 
void assign (const idx_vector &i, const octave_map &rhs)
 
void assign (const idx_vector &i, const idx_vector &j, const octave_map &rhs)
 
void assign (const Array< idx_vector > &ia, 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)
 
const_iterator begin (void) const
 
octave_scalar_map checkelem (octave_idx_type n) const
 
octave_scalar_map checkelem (octave_idx_type i, octave_idx_type j) const
 
octave_scalar_map checkelem (const Array< octave_idx_type > &ra_idx) const
 
void clear (void)
 
octave_idx_type cols (void) const
 
octave_map column (octave_idx_type k) const
 
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 &name) const
 
const Cellcontents (const_iterator p) const
 
Cellcontents (iterator p)
 
const Cellcontents (octave_idx_type i) const
 
Cellcontents (octave_idx_type i)
 
Cell contents (const std::string &k) const
 
Cellcontents (const std::string &k)
 
void del (const std::string &k)
 
void delete_elements (const idx_vector &i)
 
void delete_elements (int dim, const idx_vector &i)
 
void delete_elements (const Array< idx_vector > &ia)
 
void delete_elements (const octave_value_list &)
 
dim_vector dims (void) const
 
octave_scalar_map elem (octave_idx_type n) const
 
octave_scalar_map elem (octave_idx_type i, octave_idx_type j) const
 
octave_scalar_map elem (const Array< octave_idx_type > &ra_idx) const
 
const_iterator end (void) 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 (void) const
 
Cell getfield (const std::string &key) const
 
octave_idx_type index (const_iterator p) const
 
octave_map index (const idx_vector &i, bool resize_ok=false) const
 
octave_map index (const idx_vector &i, const idx_vector &j, bool resize_ok=false) const
 
octave_map index (const Array< idx_vector > &ia, bool resize_ok=false) const
 
octave_map index (const octave_value_list &, bool resize_ok=false) const
 
bool isempty (void) const
 
bool isfield (const std::string &name) const
 
std::string key (const_iterator p) const
 
string_vector keys (void) const
 
octave_idx_type length (void) const
 
int ndims (void) const
 
octave_idx_type nfields (void) const
 
octave_idx_type numel (void) const
 
octave_scalar_map operator() (octave_idx_type n) const
 
octave_scalar_map operator() (octave_idx_type i, octave_idx_type j) const
 
octave_scalar_map operator() (const Array< octave_idx_type > &ra_idx) const
 
octave_mapoperator= (const octave_map &m)
 
octave_map orderfields (void) 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 (void) const
 
const_iterator seek (const std::string &k) const
 
void setfield (const std::string &key, const Cell &val)
 
octave_map squeeze (void) const
 
octave_map transpose (void) const
 

Static Public Member Functions

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

Private Member Functions

void extract_scalar (octave_scalar_map &dest, octave_idx_type index) const
 
void optimize_dimensions (void)
 

Static Private Member Functions

static void do_cat (int dim, octave_idx_type n, const octave_scalar_map *map_list, octave_map &retval)
 
static void do_cat (int dim, octave_idx_type n, const octave_map *map_list, octave_map &retval)
 

Private Attributes

dim_vector dimensions
 
octave_fields xkeys
 
std::vector< Cellxvals
 

Detailed Description

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

Member Typedef Documentation

◆ const_iterator

◆ element_type

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

◆ iterator

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

Constructor & Destructor Documentation

◆ octave_map() [1/8]

octave_map::octave_map ( const octave_fields k)
inline

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

◆ octave_map() [2/8]

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

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

◆ octave_map() [3/8]

octave_map::octave_map ( void  )
inline

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

◆ octave_map() [4/8]

octave_map::octave_map ( const dim_vector dv)
inline

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

◆ octave_map() [5/8]

octave_map::octave_map ( const string_vector k)
inline

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

◆ octave_map() [6/8]

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

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

◆ octave_map() [7/8]

octave_map::octave_map ( const octave_map m)
inline

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

◆ octave_map() [8/8]

octave_map::octave_map ( const octave_scalar_map m)

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

References dimensions, i, octave_scalar_map::nfields(), octave_scalar_map::xvals, and xvals.

Member Function Documentation

◆ assign() [1/6]

◆ assign() [2/6]

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

◆ assign() [3/6]

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

◆ assign() [4/6]

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

◆ assign() [5/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(), e, i, k, and octave_value_list::length().

◆ assign() [6/6]

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

◆ begin()

◆ cat() [1/2]

◆ cat() [2/2]

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

◆ checkelem() [1/3]

octave_scalar_map octave_map::checkelem ( octave_idx_type  n) const
inline

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

References elem.

Referenced by octave_struct::fast_elem_extract(), and octave_struct::try_narrowing_conversion().

◆ checkelem() [2/3]

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

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

References elem, and i.

◆ checkelem() [3/3]

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

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

References elem, and ra_idx.

◆ clear()

void octave_map::clear ( void  )
inline

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

◆ cols()

octave_idx_type octave_map::cols ( void  ) const
inline

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

◆ column()

octave_map octave_map::column ( octave_idx_type  k) const

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

References idx_vector::colon, index(), and k.

◆ columns()

octave_idx_type octave_map::columns ( void  ) const
inline

Definition at line 381 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

◆ contents() [1/6]

◆ contents() [2/6]

Cell& octave_map::contents ( iterator  p)
inline

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

References p.

◆ contents() [3/6]

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

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

References i.

◆ contents() [4/6]

Cell& octave_map::contents ( octave_idx_type  i)
inline

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

References i.

◆ contents() [5/6]

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

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

References getfield(), and k.

◆ contents() [6/6]

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

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

References dimensions, octave_fields::getfield(), k, xkeys, and xvals.

◆ del()

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

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

References k, and rmfield.

◆ delete_elements() [1/4]

void octave_map::delete_elements ( const idx_vector i)

◆ delete_elements() [2/4]

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

◆ delete_elements() [3/4]

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

◆ delete_elements() [4/4]

void octave_map::delete_elements ( const octave_value_list idx)

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

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

◆ dims()

dim_vector octave_map::dims ( void  ) const
inline

◆ do_cat() [1/2]

void octave_map::do_cat ( int  dim,
octave_idx_type  n,
const octave_scalar_map map_list,
octave_map retval 
)
staticprivate

◆ do_cat() [2/2]

void octave_map::do_cat ( int  dim,
octave_idx_type  n,
const octave_map map_list,
octave_map retval 
)
staticprivate

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

References octave_value::dims(), i, octave_value::nfields(), OCTAVE_LOCAL_BUFFER, retval, and xvals.

◆ elem() [1/3]

octave_scalar_map octave_map::elem ( octave_idx_type  n) const

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

References compute_index(), dimensions, extract_scalar(), retval, and xkeys.

◆ elem() [2/3]

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

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

References compute_index(), dimensions, extract_scalar(), i, retval, and xkeys.

◆ elem() [3/3]

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

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

References compute_index(), dimensions, extract_scalar(), ra_idx, retval, and xkeys.

◆ end()

◆ extract_scalar()

void octave_map::extract_scalar ( octave_scalar_map dest,
octave_idx_type  index 
) const
private

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

References i, nfields(), octave_scalar_map::xvals, and xvals.

Referenced by elem(), and fast_elem_extract().

◆ fast_elem_extract()

octave_scalar_map octave_map::fast_elem_extract ( octave_idx_type  n) const

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

References extract_scalar(), retval, and xkeys.

◆ fast_elem_insert()

◆ fieldnames()

◆ getfield()

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

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

References octave_fields::getfield(), k, xkeys, and xvals.

Referenced by contents(), and G__eigs__().

◆ index() [1/5]

◆ index() [2/5]

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

◆ index() [3/5]

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

◆ index() [4/5]

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

◆ index() [5/5]

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

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

References e, i, index(), k, octave_value_list::length(), and retval.

◆ isempty()

bool octave_map::isempty ( void  ) const
inline

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

Referenced by permute_to_correct_order1(), and rethrow_error().

◆ isfield()

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

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

References name.

Referenced by octave::bp_table::dbstop_process_map_args(), and Fisfield().

◆ key()

◆ keys()

◆ length()

octave_idx_type octave_map::length ( void  ) const
inline

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

References numel().

Referenced by F__version_info__(), and rethrow_error().

◆ ndims()

int octave_map::ndims ( void  ) const
inline

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

Referenced by transpose().

◆ nfields()

◆ numel()

◆ operator()() [1/3]

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

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

References elem.

◆ operator()() [2/3]

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

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

References elem, and i.

◆ operator()() [3/3]

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

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

References elem, and ra_idx.

◆ operator=()

octave_map& octave_map::operator= ( const octave_map m)
inline

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

References dimensions, xkeys, and xvals.

◆ optimize_dimensions()

void octave_map::optimize_dimensions ( void  )
private

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

References dimensions, error(), i, nfields(), and xvals.

Referenced by assign(), delete_elements(), and resize().

◆ orderfields() [1/3]

octave_map octave_map::orderfields ( void  ) const

Definition at line 307 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 314 of file oct-map.cc.

References i, nfields(), retval, Array< T >::xelem(), xkeys, and xvals.

◆ 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 986 of file oct-map.cc.

References idx_vector::colon, index(), and k.

◆ 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 299 of file oct-map.cc.

References k, octave_fields::rmfield(), xkeys, and xvals.

◆ rows()

octave_idx_type octave_map::rows ( void  ) const
inline

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

Referenced by octave_struct::edit_display().

◆ seek()

◆ setfield()

◆ squeeze()

octave_map octave_map::squeeze ( void  ) const

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

References dimensions, i, nfields(), retval, dim_vector::squeeze(), and xvals.

Referenced by octave_struct::squeeze().

◆ transpose()

octave_map octave_map::transpose ( void  ) const

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

References dimensions, i, ndims(), nfields(), retval, xkeys, and xvals.

Referenced by oct_unop_transpose().

Member Data Documentation

◆ dimensions

◆ xkeys

◆ xvals


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