GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Array-util.cc File Reference
#include "Array-util.h"
#include "lo-error.h"
#include "oct-locbuf.h"

Go to the source code of this file.

Functions

bool all_colon_equiv (const Array< octave::idx_vector > &ra_idx, const dim_vector &frozen_lengths)
 
bool all_ok (const Array< octave::idx_vector > &ra_idx)
 
bool all_ones (const Array< octave_idx_type > &arr)
 
bool any_ones (const Array< octave_idx_type > &arr)
 
bool any_orig_empty (const Array< octave::idx_vector > &ra_idx)
 
octave_idx_type compute_index (const Array< octave_idx_type > &ra_idx, const dim_vector &dims)
 
octave_idx_type compute_index (octave_idx_type i, octave_idx_type j, const dim_vector &dims)
 
octave_idx_type compute_index (octave_idx_type i, octave_idx_type j, octave_idx_type k, const dim_vector &dims)
 
octave_idx_type compute_index (octave_idx_type n, const dim_vector &dims)
 
Array< octave::idx_vectorconv_to_array (const octave::idx_vector *tmp, const octave_idx_type len)
 
Array< octave_idx_typeconv_to_int_array (const Array< octave::idx_vector > &a)
 
dim_vector freeze (Array< octave::idx_vector > &ra_idx, const dim_vector &dimensions, int resize_ok)
 
Array< octave_idx_typeget_elt_idx (const Array< octave::idx_vector > &ra_idx, const Array< octave_idx_type > &result_idx)
 
Array< octave_idx_typeget_ra_idx (octave_idx_type idx, const dim_vector &dims)
 
octave_idx_type get_scalar_idx (Array< octave_idx_type > &idx, dim_vector &dims)
 
void increment_index (Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension)
 
Array< octave::idx_vectorind2sub (const dim_vector &dv, const octave::idx_vector &idx)
 
bool index_in_bounds (const Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
 
bool is_scalar (const dim_vector &dim)
 
bool isvector (const dim_vector &dim)
 
octave_idx_type num_ones (const Array< octave_idx_type > &ra_idx)
 
int permute_vector_compare (const void *a, const void *b)
 
octave::idx_vector sub2ind (const dim_vector &dv, const Array< octave::idx_vector > &idxa)
 
bool vector_equivalent (const dim_vector &dv)
 
dim_vector zero_dims_inquire (const Array< octave::idx_vector > &ia, const dim_vector &rhdv)
 
dim_vector zero_dims_inquire (const octave::idx_vector &i, const octave::idx_vector &j, const dim_vector &rhdv)
 

Function Documentation

◆ all_colon_equiv()

bool all_colon_equiv ( const Array< octave::idx_vector > &  ra_idx,
const dim_vector frozen_lengths 
)

Definition at line 331 of file Array-util.cc.

References n, dim_vector::ndims(), octave_base_value::numel(), and ra_idx.

◆ all_ok()

bool all_ok ( const Array< octave::idx_vector > &  ra_idx)

Definition at line 303 of file Array-util.cc.

References ra_idx.

◆ all_ones()

bool all_ones ( const Array< octave_idx_type > &  arr)

Definition at line 355 of file Array-util.cc.

References Array< T, Alloc >::numel().

◆ any_ones()

bool any_ones ( const Array< octave_idx_type > &  arr)

Definition at line 160 of file Array-util.cc.

References Array< T, Alloc >::numel().

◆ any_orig_empty()

bool any_orig_empty ( const Array< octave::idx_vector > &  ra_idx)

Definition at line 312 of file Array-util.cc.

References n, octave_base_value::numel(), and ra_idx.

◆ compute_index() [1/4]

octave_idx_type compute_index ( const Array< octave_idx_type > &  ra_idx,
const dim_vector dims 
)

◆ compute_index() [2/4]

octave_idx_type compute_index ( octave_idx_type  i,
octave_idx_type  j,
const dim_vector dims 
)

Definition at line 188 of file Array-util.cc.

References err_invalid_index().

◆ compute_index() [3/4]

octave_idx_type compute_index ( octave_idx_type  i,
octave_idx_type  j,
octave_idx_type  k,
const dim_vector dims 
)

Definition at line 203 of file Array-util.cc.

References err_invalid_index().

◆ compute_index() [4/4]

◆ conv_to_array()

Array<octave::idx_vector> conv_to_array ( const octave::idx_vector tmp,
const octave_idx_type  len 
)

Definition at line 250 of file Array-util.cc.

References len.

◆ conv_to_int_array()

Array<octave_idx_type> conv_to_int_array ( const Array< octave::idx_vector > &  a)

◆ freeze()

dim_vector freeze ( Array< octave::idx_vector > &  ra_idx,
const dim_vector dimensions,
int  resize_ok 
)

◆ get_elt_idx()

Array<octave_idx_type> get_elt_idx ( const Array< octave::idx_vector > &  ra_idx,
const Array< octave_idx_type > &  result_idx 
)

Definition at line 372 of file Array-util.cc.

References n, octave_base_value::numel(), and ra_idx.

◆ get_ra_idx()

Array<octave_idx_type> get_ra_idx ( octave_idx_type  idx,
const dim_vector dims 
)

◆ get_scalar_idx()

octave_idx_type get_scalar_idx ( Array< octave_idx_type > &  idx,
dim_vector dims 
)

Definition at line 81 of file Array-util.cc.

References n, and Array< T, Alloc >::numel().

◆ increment_index()

void increment_index ( Array< octave_idx_type > &  ra_idx,
const dim_vector dimensions,
int  start_dimension 
)

Definition at line 60 of file Array-util.cc.

References n, dim_vector::ndims(), octave_base_value::numel(), and ra_idx.

Referenced by get_ra_idx(), and operator<<().

◆ ind2sub()

Array<octave::idx_vector> ind2sub ( const dim_vector dv,
const octave::idx_vector idx 
)

Definition at line 598 of file Array-util.cc.

References len, n, dim_vector::ndims(), numel(), dim_vector::numel(), and OCTAVE_LOCAL_BUFFER.

◆ index_in_bounds()

bool index_in_bounds ( const Array< octave_idx_type > &  ra_idx,
const dim_vector dimensions 
)

Definition at line 35 of file Array-util.cc.

References n, dim_vector::ndims(), octave_base_value::numel(), and ra_idx.

◆ is_scalar()

bool is_scalar ( const dim_vector dim)

Definition at line 116 of file Array-util.cc.

References n, and dim_vector::ndims().

Referenced by cdef_object_array::subsasgn(), and cdef_object_array::subsref().

◆ isvector()

bool isvector ( const dim_vector dim)

Definition at line 140 of file Array-util.cc.

References m, n, and dim_vector::ndims().

Referenced by octave_class::size(), and xnorm().

◆ num_ones()

octave_idx_type num_ones ( const Array< octave_idx_type > &  ra_idx)

Definition at line 102 of file Array-util.cc.

References octave_base_value::numel(), and ra_idx.

Referenced by dim_vector::all_ones().

◆ permute_vector_compare()

int permute_vector_compare ( const void *  a,
const void *  b 
)

Definition at line 644 of file Array-util.cc.

References permute_vector::pidx.

◆ sub2ind()

octave::idx_vector sub2ind ( const dim_vector dv,
const Array< octave::idx_vector > &  idxa 
)

Definition at line 503 of file Array-util.cc.

References len, n, Array< T, Alloc >::numel(), and dim_vector::redim().

◆ vector_equivalent()

bool vector_equivalent ( const dim_vector dv)

Definition at line 281 of file Array-util.cc.

References n, and dim_vector::ndims().

◆ zero_dims_inquire() [1/2]

dim_vector zero_dims_inquire ( const Array< octave::idx_vector > &  ia,
const dim_vector rhdv 
)

◆ zero_dims_inquire() [2/2]

dim_vector zero_dims_inquire ( const octave::idx_vector i,
const octave::idx_vector j,
const dim_vector rhdv 
)

Definition at line 465 of file Array-util.cc.

References dim_vector::chop_all_singletons(), and dim_vector::ndims().