GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <string>
#include <vector>
#include <list>
#include <memory>
#include "caseless-str.h"
#include "lo-mappers.h"
#include "oct-locbuf.h"
#include "Cell.h"
#include "oct-map.h"
#include "defun.h"
#include "parse.h"
#include "variables.h"
#include "ov-colon.h"
#include "unwind-prot.h"
#include "gripes.h"
#include "utils.h"
#include "ov-class.h"
#include "ov-scalar.h"
#include "ov-float.h"
#include "ov-complex.h"
#include "ov-flt-complex.h"
#include "ov-bool.h"
#include "ov-int8.h"
#include "ov-int16.h"
#include "ov-int32.h"
#include "ov-int64.h"
#include "ov-uint8.h"
#include "ov-uint16.h"
#include "ov-uint32.h"
#include "ov-uint64.h"
#include "ov-fcn-handle.h"
Go to the source code of this file.
Macros | |
#define | BTYP_BRANCH(X, Y) |
Functions | |
template<class NDA > | |
static Cell | do_cellslices_nda (const NDA &array, const Array< octave_idx_type > &lb, const Array< octave_idx_type > &ub, int dim=-1) |
template<class ArrayND > | |
Cell | do_mat2cell (const ArrayND &a, const Array< octave_idx_type > *d, int nd) |
Cell | do_mat2cell (octave_value &a, const Array< octave_idx_type > *d, int nd) |
template<class Array2D > | |
static Cell | do_mat2cell_2d (const Array2D &a, const Array< octave_idx_type > *d, int nd) |
template<class ArrayND > | |
Cell | do_mat2cell_nd (const ArrayND &a, const Array< octave_idx_type > *d, int nd) |
template<class NDA > | |
static Cell | do_num2cell (const NDA &array, const Array< int > &dimv) |
template<class NDA > | |
static NDA::element_type | do_num2cell_elem (const NDA &array, octave_idx_type i) |
static Cell | do_num2cell_elem (const Cell &array, octave_idx_type i) |
static void | do_num2cell_helper (const dim_vector &dv, const Array< int > &dimv, dim_vector &celldv, dim_vector &arraydv, Array< int > &perm) |
static Cell | do_object2cell (const octave_value &obj, const Array< int > &dimv) |
OCTAVE_EXPORT octave_value_list | Farrayfun (const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Fcellfun (const octave_value_list &args, int nargout) |
OCTAVE_EXPORT octave_value_list | Fcellindexmat (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fcellslices (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fmat2cell (const octave_value_list &args, int) |
OCTAVE_EXPORT octave_value_list | Fnum2cell (const octave_value_list &args, int) |
static void | get_mapper_fun_options (const octave_value_list &args, int &nargin, bool &uniform_output, octave_value &error_handler) |
static dim_vector | get_object_dims (octave_value &obj) |
static octave_value_list | get_output_list (octave_idx_type count, octave_idx_type nargout, const octave_value_list &inputlist, octave_value &func, octave_value &error_handler) |
static bool | mat2cell_mismatch (const dim_vector &dv, const Array< octave_idx_type > *d, int nd) |
template<class container > | |
static void | prepare_idx (container *idx, int idim, int nd, const Array< octave_idx_type > *d) |
template<typename BNDA , typename NDA > | |
static octave_value_list | try_cellfun_internal_ops (const octave_value_list &args, int nargin) |
#define BTYP_BRANCH | ( | X, | |
Y | |||
) |
Referenced by Fmat2cell(), and Frepelems().
|
static |
Definition at line 2326 of file cellfun.cc.
References idx_vector::colon, error_state, dim_vector::first_non_singleton(), Cell::index(), dim_vector::length(), Array< T >::length(), and max().
Referenced by Fcellslices().
Cell do_mat2cell | ( | const ArrayND & | a, |
const Array< octave_idx_type > * | d, | ||
int | nd | ||
) |
Definition at line 2125 of file cellfun.cc.
References do_mat2cell_2d(), and do_mat2cell_nd().
Referenced by Fmat2cell().
Cell do_mat2cell | ( | octave_value & | a, |
const Array< octave_idx_type > * | d, | ||
int | nd | ||
) |
Definition at line 2137 of file cellfun.cc.
References dim_vector::alloc(), d, octave_value::dims(), octave_value::do_index_op(), error_state, dim_vector::increment_index(), Array< T >::length(), octave_value::magic_colon_t, mat2cell_mismatch(), max(), octave_value::ndims(), OCTAVE_LOCAL_BUFFER, OCTAVE_LOCAL_BUFFER_INIT, and prepare_idx().
|
static |
Definition at line 2017 of file cellfun.cc.
References d, Array< T >::length(), mat2cell_mismatch(), OCTAVE_LOCAL_BUFFER, and prepare_idx().
Referenced by do_mat2cell(), and Fmat2cell().
Cell do_mat2cell_nd | ( | const ArrayND & | a, |
const Array< octave_idx_type > * | d, | ||
int | nd | ||
) |
Definition at line 2073 of file cellfun.cc.
References dim_vector::alloc(), idx_vector::colon, d, dim_vector::increment_index(), Array< T >::length(), mat2cell_mismatch(), max(), OCTAVE_LOCAL_BUFFER, OCTAVE_LOCAL_BUFFER_INIT, and prepare_idx().
Referenced by do_mat2cell().
|
static |
Definition at line 1765 of file cellfun.cc.
References do_num2cell_elem(), do_num2cell_helper(), error_state, Array< T >::is_empty(), and Array< T >::xelem().
Referenced by Fnum2cell().
|
inlinestatic |
Definition at line 1755 of file cellfun.cc.
Referenced by do_num2cell().
|
inlinestatic |
Definition at line 1759 of file cellfun.cc.
|
static |
Definition at line 1707 of file cellfun.cc.
References Array< T >::clear(), error(), dim_vector::length(), Array< T >::length(), max(), OCTAVE_LOCAL_BUFFER_INIT, and dim_vector::resize().
Referenced by do_num2cell().
|
static |
Definition at line 1821 of file cellfun.cc.
References error(), error_state, get_object_dims(), Array< T >::is_empty(), dim_vector::numel(), Array< T >::resize(), octave_value::single_subsref(), and Array< T >::xelem().
Referenced by Fnum2cell().
OCTAVE_EXPORT octave_value_list Farrayfun | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 1171 of file cellfun.cc.
References dim_vector::any_zero(), buffer_error_messages, octave_value::do_index_op(), error_state, error_with_id(), extract_function(), f, octave_value::fcn_handle_value(), symbol_table::find_function(), octave_value::function_value(), get_mapper_fun_options(), get_output_list(), octave_value::is_defined(), octave_value::is_function(), octave_value::is_function_handle(), octave_value::is_inline_function(), octave_value::is_string(), octave_value::is_undefined(), octave_value_list::length(), NDArray, octave_value::numel(), OCTAVE_LOCAL_BUFFER, octave_value(), octave_value_list::octave_value_list(), octave_value::op_asn_eq, print_usage(), action_container::protect_var(), octave_value_list::resize(), octave_value::resize(), unique_symbol_name(), valid_identifier(), and octave_value_list::xelem().
OCTAVE_EXPORT octave_value_list Fcellfun | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 408 of file cellfun.cc.
References dim_vector::any_zero(), buffer_error_messages, octave_value_list::empty(), error(), error_state, extract_function(), f, octave_value::fcn_handle_value(), symbol_table::find_function(), octave_value::function_value(), get_mapper_fun_options(), get_output_list(), octave_value::is_defined(), octave_value::is_function(), octave_value::is_function_handle(), octave_value::is_inline_function(), octave_value::is_string(), octave_value::is_undefined(), octave_value_list::length(), NDArray, octave_value::numel(), OCTAVE_LOCAL_BUFFER, octave_value(), octave_value_list::octave_value_list(), octave_value::op_asn_eq, print_usage(), action_container::protect_var(), octave_value_list::resize(), octave_value::resize(), unique_symbol_name(), valid_identifier(), and octave_value_list::xelem().
OCTAVE_EXPORT octave_value_list Fcellindexmat | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2509 of file cellfun.cc.
References Array< T >::dims(), octave_value::do_index_op(), error(), error_state, Array< T >::numel(), print_usage(), octave_value_list::slice(), and x.
OCTAVE_EXPORT octave_value_list Fcellslices | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2381 of file cellfun.cc.
References octave_value::array_value(), octave_value::bool_array_value(), octave_value::char_array_value(), octave_value::complex_array_value(), octave_value::dims(), do_cellslices_nda(), octave_value::do_index_op(), error(), error_state, dim_vector::first_non_singleton(), octave_value::float_array_value(), octave_value::float_complex_array_value(), octave_value::int16_array_value(), octave_value::int32_array_value(), octave_value::int64_array_value(), octave_value::int8_array_value(), octave_value::is_bool_type(), octave_value::is_char_matrix(), octave_value::is_complex_type(), octave_value::is_int16_type(), octave_value::is_int32_type(), octave_value::is_int64_type(), octave_value::is_int8_type(), octave_value::is_integer_type(), octave_value::is_matrix_type(), octave_value::is_single_type(), octave_value::is_sparse_type(), octave_value::is_uint16_type(), octave_value::is_uint32_type(), octave_value::is_uint64_type(), octave_value::is_uint8_type(), dim_vector::length(), Array< T >::length(), octave_value::length(), octave_value::magic_colon_t, max(), print_usage(), octave_value::uint16_array_value(), octave_value::uint32_array_value(), octave_value::uint64_array_value(), octave_value::uint8_array_value(), and x.
OCTAVE_EXPORT octave_value_list Fmat2cell | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2230 of file cellfun.cc.
References octave_value::array_value(), BTYP_BRANCH, btyp_complex, btyp_double, btyp_func_handle, octave_value::builtin_type(), octave_value::complex_array_value(), d, do_mat2cell(), do_mat2cell_2d(), error(), error_state, gripe_wrong_type_arg(), octave_value::is_sparse_type(), OCTAVE_LOCAL_BUFFER, print_usage(), octave_value::sparse_complex_matrix_value(), and octave_value::sparse_matrix_value().
OCTAVE_EXPORT octave_value_list Fnum2cell | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1892 of file cellfun.cc.
References octave_value::array_value(), octave_value::bool_array_value(), octave_value::cell_value(), octave_value::char_array_value(), octave_value::complex_array_value(), do_num2cell(), do_object2cell(), error_state, octave_value::float_array_value(), octave_value::float_complex_array_value(), gripe_wrong_type_arg(), octave_value::int16_array_value(), octave_value::int32_array_value(), octave_value::int64_array_value(), octave_value::int8_array_value(), octave_value::is_bool_type(), octave_value::is_cell(), octave_value::is_char_matrix(), octave_value::is_complex_type(), octave_value::is_int16_type(), octave_value::is_int32_type(), octave_value::is_int64_type(), octave_value::is_int8_type(), octave_value::is_integer_type(), octave_value::is_map(), octave_value::is_numeric_type(), octave_value::is_object(), octave_value::is_single_type(), octave_value::is_uint16_type(), octave_value::is_uint32_type(), octave_value::is_uint64_type(), octave_value::is_uint8_type(), octave_value::map_value(), print_usage(), octave_value::uint16_array_value(), octave_value::uint32_array_value(), octave_value::uint64_array_value(), and octave_value::uint8_array_value().
|
static |
Definition at line 224 of file cellfun.cc.
References arg(), caseless_str::compare(), error(), symbol_table::find_function(), octave_value::is_undefined(), and max().
Referenced by Farrayfun(), and Fcellfun().
|
static |
Definition at line 1804 of file cellfun.cc.
References Array< T >::numel(), dim_vector::resize(), and octave_value::size().
Referenced by do_object2cell().
|
static |
Definition at line 67 of file cellfun.cc.
References octave_scalar_map::assign(), buffer_error_messages, octave_value_list::clear(), octave_value::do_multi_index_op(), error_state, octave_value::is_defined(), last_error_id(), last_error_message(), and octave_value_list::prepend().
Referenced by Farrayfun(), and Fcellfun().
|
static |
Definition at line 1970 of file cellfun.cc.
References error(), dim_vector::length(), and Array< T >::length().
Referenced by do_mat2cell(), do_mat2cell_2d(), and do_mat2cell_nd().
|
static |
Definition at line 1994 of file cellfun.cc.
References idx_vector::colon, and Array< T >::numel().
Referenced by do_mat2cell(), do_mat2cell_2d(), and do_mat2cell_nd().
|
static |
Definition at line 120 of file cellfun.cc.
References octave_value_list::cell_value(), octave_value::class_name(), d, Array< T >::dims(), octave_value::dims(), Array< T >::elem(), error(), error_state, octave_value::is_bool_type(), octave_value::is_empty(), octave_value::is_numeric_type(), octave_value::is_real_type(), dim_vector::length(), octave_value::length(), octave_value::ndims(), Array< T >::numel(), and octave_value::numel().