GNU Octave  4.2.1
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
Functions | Variables
sub2ind.cc File Reference
#include "Array-util.h"
#include "oct-locbuf.h"
#include "quit.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "ovl.h"
Include dependency graph for sub2ind.cc:

Go to the source code of this file.

Functions

 catch (const octave::index_exception &e)
 
OCTAVE_EXPORT
octave_value_list etc The
functions then then 
dimension (pages)
 
OCTAVE_EXPORT
octave_value_list etc The
functions then 
dimension (columns)
 
OCTAVE_EXPORT octave_value_list Fsub2ind (const octave_value_list &args, int) or they may be specified with subscripts for the row
 
static dim_vector get_dim_vector (const octave_value &val, const char *name)
 

Variables

the exceeded dimensions are
set to if fewer subscripts
than dimensions are the
exceeding dimensions are
merged into the final
requested dimension For 
clarity
 
OCTAVE_EXPORT octave_value_list column
 
the exceeded dimensions are
set to if fewer subscripts
than dimensions are the
exceeding dimensions are
merged into the final
requested dimension For
consider the following 
dims = [3, 3]
 
dim_vector dv = get_dim_vector (args(0), "ind2sub").redim (nargout)
 
the exceeded dimensions are
set to if fewer subscripts
than dimensions are the
exceeding dimensions are
merged into the final
requested dimension For
consider the following 
examples
 
 ind
 
OCTAVE_EXPORT
octave_value_list etc The
functions then then etc until
it has numbered all of the
elements Consider the
following by 
matrices
 
OCTAVE_EXPORT
octave_value_list etc The
functions 
ode {ind2sub} and ode{sub2ind} interconvert between the two forms. The linear index traverses dimension 1 (rows)
 
OCTAVE_EXPORT octave_value_list page
 
the exceeded dimensions are
set to if fewer subscripts
than dimensions are 
provided
 
octave_value_list retval
 
 s2 = [1, 3]
 
 try
 

Function Documentation

catch ( const octave::index_exception e)
OCTAVE_EXPORT octave_value_list etc The functions then then dimension ( pages  )
OCTAVE_EXPORT octave_value_list etc The functions then dimension ( columns  )

Referenced by alnrel(), asinh(), atanh(), cacai(), cacon(), cairy(), casyi(), cbesh(), cbesi(), cbesj(), cbesk(), cbesy(), cbinu(), cbiry(), cbknu(), cbuni(), cbunk(), cfftb(), cfftb1(), cfftf(), cfftf1(), cffti(), cffti1(), cfode(), ckscl(), cmlri(), crati(), cseri(), cunhj(), cuni1(), cuni2(), cunik(), cunk1(), cunk2(), cuoik(), cwrsk(), datv(), dcnst0(), dcnstr(), ddasic(), ddasid(), ddasik(), ddaspk(), ddasrt(), ddstp(), ddwnrm(), dfnrmd(), dfnrmk(), dgamln(), dinvwt(), dlinsd(), dlinsk(), dlsode(), dmatd(), dnedd(), dnedk(), dnsd(), dnsid(), dnsik(), dnsk(), dorth(), dpsifn(), dqagi(), dqagie(), dqagp(), dqagpe(), dqelg(), dqk15i(), dqk21(), dqpsrt(), drchek(), droots(), dslvd(), dslvk(), dspigm(), dyypnw(), erf(), erfc(), ewset(), gamln(), gamma(), intdy(), passb(), passb2(), passb3(), passb4(), passb5(), passf(), passf2(), passf3(), passf4(), passf5(), prepj(), psifn(), qagi(), qagie(), qagp(), qagpe(), qelg(), qk15i(), qk21(), qpsrt(), r9lgmc(), scfode(), sewset(), sintdy(), slsode(), solsy(), sprepj(), ssolsy(), sstode(), stode(), svnorm(), vnorm(), xerror(), xersve(), xgetua(), xsetua(), zacai(), zacon(), zairy(), zasyi(), zbesh(), zbesi(), zbesj(), zbesk(), zbesy(), zbinu(), zbiry(), zbknu(), zbuni(), zbunk(), zfftb(), zfftb1(), zfftf(), zfftf1(), zffti(), zffti1(), zkscl(), zmlri(), zpassb(), zpassb2(), zpassb3(), zpassb4(), zpassb5(), zpassf(), zpassf2(), zpassf3(), zpassf4(), zpassf5(), zrati(), zseri(), zunhj(), zuni1(), zuni2(), zunik(), zunk1(), zunk2(), zuoik(), and zwrsk().

OCTAVE_EXPORT octave_value_list Fsub2ind ( const octave_value_list args,
int   
)

Referenced by install_sub2ind_fcns().

static dim_vector get_dim_vector ( const octave_value val,
const char *  name 
)
static

Variable Documentation

the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For clarity

Definition at line 255 of file sub2ind.cc.

OCTAVE_EXPORT octave_value_list column

Definition at line 107 of file sub2ind.cc.

the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims = [3, 3]

Definition at line 255 of file sub2ind.cc.

Referenced by intNDArray< T >::abs(), add_hdf5_data(), octave_value::all_zero_dims(), DiagArray2< T >::array_value(), Sparse< T >::array_value(), OCTAVE_VALUE_INT_MATRIX_T::as_mxArray(), OCTAVE_VALUE_INT_MATRIX_T::bool_array_value(), box(), octave_bool_matrix::char_array_value(), OCTAVE_VALUE_INT_MATRIX_T::char_array_value(), DiagArray2< T >::check_idx(), octave_base_value::columns(), OCTAVE_VALUE_INT_MATRIX_T::complex_matrix_value(), compute_index(), octave_base_int_matrix< T >::convert_to_str_internal(), Array< T >::diag(), octave_fftw_planner::do_create_plan(), octave_float_fftw_planner::do_create_plan(), do_fft(), do_fft2(), do_fftn(), do_mx_diff_op(), do_mx_minmax_op(), do_rand(), do_trilu(), F__lin_interpn__(), Array< T >::find(), OCTAVE_VALUE_INT_MATRIX_T::float_complex_matrix_value(), OCTAVE_VALUE_INT_MATRIX_T::float_matrix_value(), get_ra_idx(), get_scalar_idx(), Sparse< T >::index(), octave_base_value::is_empty(), octave_base_diag< DMT, MT >::is_true(), lin_interpn(), load_hdf5_empty(), Array< octave_value >::map(), OCTAVE_VALUE_INT_MATRIX_T::matrix_value(), tree::meets_bp_condition(), octave_base_value::ndims(), Array< T >::nth_element(), octave_base_sparse< SparseComplexMatrix >::numel(), octave_class::numel(), octave_base_value::numel(), octave_print_internal(), octave_print_internal_template(), intNDArray< T >::operator!(), Array< T >::permute(), image::properties::pixel_xsize(), image::properties::pixel_ysize(), octave_base_sparse< T >::print_as_scalar(), octave_base_matrix< MT >::print_as_scalar(), octave_base_diag< DMT, MT >::print_as_scalar(), print_nd_array(), read_mat5_binary_element(), octave_base_value::rows(), octave_base_int_matrix< T >::save_ascii(), octave_base_sparse< T >::save_ascii(), octave_base_int_matrix< T >::save_binary(), octave_base_int_matrix< T >::save_hdf5(), save_hdf5_empty(), intNDArray< T >::signum(), Array< T >::sort(), twosum_accum(), and unbox().

dim_vector dv = get_dim_vector (args(0), "ind2sub").redim (nargout)

Definition at line 263 of file sub2ind.cc.

Referenced by jit_operation::add_overload(), octave::math::airy(), octave_value_list::all_scalars(), mxArray_number::as_octave_value(), mxArray_sparse::as_octave_value(), mxArray_struct::as_octave_value(), mxArray_cell::as_octave_value(), octave_base_matrix< MT >::assign(), Array< T >::assign(), octave::math::betainc(), octave::math::betaincinv(), octave::math::biry(), box(), octave_map::cat(), Sparse< T >::cat(), Array< T >::cat(), tm_row_const::tm_row_const_rep::cellify(), Array< T >::clear(), tm_const::cols(), octave_base_value::columns(), OCTAVE_VALUE_INT_MATRIX_T::complex_matrix_value(), compute_array_dimensions(), compute_index(), octave_map::concat(), convert_cdata(), convert_packcomplex_Nd(), octave_base_int_matrix< T >::convert_to_str_internal(), octave_sparse_matrix::convert_to_str_internal(), octave_float_matrix::convert_to_str_internal(), octave_matrix::convert_to_str_internal(), octave::opengl_texture::create(), property::create(), Array< T >::delete_elements(), Array< T >::diag(), octave_oncleanup::dims(), octave_base_scalar< ST >::dims(), octave_fcn_handle::dims(), octave_scalar_struct::dims(), tm_const::dims(), mxArray_matlab::dims_to_dim_vector(), octave::math::do_bessel(), do_extended_gcd(), octave_base_matrix< MT >::do_index_op(), octave::textscan::do_scan(), row_vector_property::do_set(), handle_property::do_set(), do_single_type_concat(), do_single_type_concat< octave_map >(), symbol_table::do_workspace_info(), octave::opengl_renderer::draw_image(), octave_base_value::dump(), octave_fftw::fft(), octave_fftw::fftNd(), OCTAVE_VALUE_INT_MATRIX_T::float_complex_matrix_value(), OCTAVE_VALUE_INT_MATRIX_T::float_matrix_value(), ComplexNDArray::fourier(), FloatComplexNDArray::fourier(), FloatNDArray::fourier(), NDArray::fourier(), ComplexNDArray::fourier2d(), FloatComplexNDArray::fourier2d(), FloatNDArray::fourier2d(), NDArray::fourier2d(), Matrix::fourier2d(), FloatMatrix::fourier2d(), ComplexMatrix::fourier2d(), FloatComplexMatrix::fourier2d(), ComplexNDArray::fourierNd(), FloatComplexNDArray::fourierNd(), FloatNDArray::fourierNd(), NDArray::fourierNd(), G__osmesa_print__(), octave::math::gammainc(), image::properties::get_auto_xdata(), image::properties::get_auto_ydata(), get_dim_vector(), mxArray_octave_value::get_dimensions(), get_dims_str(), printf_value_cache::get_next_value(), hdf5_read_next_data_internal(), idx_vector::idx_mask_rep::idx_mask_rep(), idx_vector::idx_vector_rep::idx_vector_rep(), octave_fftw::ifft(), octave_fftw::ifftNd(), ComplexNDArray::ifourier(), FloatComplexNDArray::ifourier(), FloatNDArray::ifourier(), NDArray::ifourier(), ComplexNDArray::ifourier2d(), FloatComplexNDArray::ifourier2d(), FloatNDArray::ifourier2d(), NDArray::ifourier2d(), Matrix::ifourier2d(), FloatMatrix::ifourier2d(), ComplexMatrix::ifourier2d(), FloatComplexMatrix::ifourier2d(), ComplexNDArray::ifourierNd(), FloatComplexNDArray::ifourierNd(), FloatNDArray::ifourierNd(), NDArray::ifourierNd(), ind2sub(), Array< T >::index(), tm_row_const::tm_row_const_rep::init(), tm_const::init(), octave_base_sparse< T >::is_true(), octave_base_matrix< MT >::is_true(), isvector(), octave_value::length(), octave_base_int_matrix< T >::load_ascii(), octave_struct::load_ascii(), octave_float_complex_matrix::load_ascii(), octave_char_matrix_str::load_ascii(), octave_complex_matrix::load_ascii(), octave_cell::load_ascii(), octave_float_matrix::load_ascii(), octave_bool_matrix::load_ascii(), octave_matrix::load_ascii(), octave_base_int_matrix< T >::load_binary(), octave_struct::load_binary(), octave_float_complex_matrix::load_binary(), octave_char_matrix_str::load_binary(), octave_complex_matrix::load_binary(), octave_cell::load_binary(), octave_float_matrix::load_binary(), octave_bool_matrix::load_binary(), octave_matrix::load_binary(), octave_base_int_matrix< T >::load_hdf5(), octave_sparse_bool_matrix::load_hdf5(), octave_sparse_complex_matrix::load_hdf5(), octave_sparse_matrix::load_hdf5(), octave_float_complex_matrix::load_hdf5(), octave_char_matrix_str::load_hdf5(), octave_complex_matrix::load_hdf5(), octave_cell::load_hdf5(), octave_float_matrix::load_hdf5(), octave_bool_matrix::load_hdf5(), octave_matrix::load_hdf5(), QtHandles::Utils::makeImageFromCData(), OCTAVE_VALUE_INT_MATRIX_T::matrix_value(), SparseMatrix::max(), SparseComplexMatrix::max(), SparseMatrix::min(), SparseComplexMatrix::min(), mxArray_matlab::mxArray_matlab(), mxArray_number::mxArray_number(), Array< T >::nth_element(), octave_class::numel(), oct_catop_matrix_struct(), oct_catop_struct_matrix(), Array< T >::optimize_dimensions(), jit_operation::overload(), Array< T >::permute(), octave_base_sparse< T >::print_as_scalar(), octave_base_matrix< MT >::print_as_scalar(), octave_base_diag< DMT, MT >::print_as_scalar(), octave_perm_matrix::print_as_scalar(), octave_struct::print_raw(), octave_cell::print_raw(), octave_scalar_struct::print_raw(), octave::textscan_format_list::read_first_row(), rec_index_helper::rec_index_helper(), rec_permute_helper::rec_permute_helper(), octave_map::reshape(), octave_base_diag< DMT, MT >::resize(), octave_map::resize(), Sparse< T >::resize(), Array< T >::resize(), Array< T >::resize1(), octave_base_value::rows(), tm_const::rows(), tree_matrix::rvalue1(), octave_base_int_matrix< T >::save_ascii(), octave_struct::save_ascii(), octave_float_complex_matrix::save_ascii(), octave_char_matrix_str::save_ascii(), octave_complex_matrix::save_ascii(), octave_cell::save_ascii(), octave_base_sparse< T >::save_ascii(), octave_float_matrix::save_ascii(), octave_bool_matrix::save_ascii(), octave_matrix::save_ascii(), octave_scalar_struct::save_ascii(), octave_base_int_matrix< T >::save_binary(), octave_sparse_bool_matrix::save_binary(), octave_struct::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), octave_float_complex_matrix::save_binary(), octave_char_matrix_str::save_binary(), octave_complex_matrix::save_binary(), octave_cell::save_binary(), octave_float_matrix::save_binary(), octave_bool_matrix::save_binary(), octave_matrix::save_binary(), octave_base_int_matrix< T >::save_hdf5(), octave_sparse_bool_matrix::save_hdf5(), octave_sparse_complex_matrix::save_hdf5(), octave_sparse_matrix::save_hdf5(), octave_float_complex_matrix::save_hdf5(), octave_char_matrix_str::save_hdf5(), octave_complex_matrix::save_hdf5(), octave_cell::save_hdf5(), octave_float_matrix::save_hdf5(), octave_bool_matrix::save_hdf5(), octave_matrix::save_hdf5(), save_mat5_binary_element(), text::properties::set_position(), single_type_concat(), octave_class::size(), octave_base_value::size(), Array< T >::sort(), Sparse< T >::Sparse(), octave_base_diag< DMT, MT >::subsasgn(), try_cellfun_internal_ops(), unbox(), patch::properties::update_data(), patch::properties::update_fvc(), update_index(), vector_equivalent(), jit_convert::visit_constant(), and octave::tree_evaluator::visit_simple_for_command().

the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following examples

Definition at line 255 of file sub2ind.cc.

ind

Definition at line 107 of file sub2ind.cc.

Referenced by ichol_t(), and octave_base_diag< DMT, MT >::subsasgn().

OCTAVE_EXPORT octave_value_list etc The functions then then etc until it has numbered all of the elements Consider the following by matrices

Definition at line 107 of file sub2ind.cc.

the exceeded dimensions are set to ode {ind2sub} and ode{sub2ind} interconvert between the two forms. The linear index traverses dimension 1 (rows)

Definition at line 107 of file sub2ind.cc.

OCTAVE_EXPORT octave_value_list page
the exceeded dimensions are set to if fewer subscripts than dimensions are provided

Definition at line 255 of file sub2ind.cc.

return retval
Initial value:
{
if (args.length () != 2)
OCTINTERP_API void print_usage(void)
Definition: defun.cc:52
JNIEnv void * args
Definition: ov-java.cc:67

Definition at line 256 of file sub2ind.cc.

s2 = [1, 3]

Definition at line 107 of file sub2ind.cc.

Referenced by cacon(), keyword_almost_match(), and str2double1().

try
Initial value:
{
retval = Array<octave_value> (ind2sub (dv, args(1).index_vector ()))
JNIEnv void * args
Definition: ov-java.cc:67
octave_value_list retval
Definition: sub2ind.cc:256
Array< idx_vector > ind2sub(const dim_vector &dv, const idx_vector &idx)
Definition: Array-util.cc:619
dim_vector dv
Definition: sub2ind.cc:263

Definition at line 266 of file sub2ind.cc.