GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Array-util.h File Reference
#include "octave-config.h"
#include "Array.h"
#include "lo-array-errwarn.h"
Include dependency graph for Array-util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  permute_vector
 

Functions

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

Function Documentation

◆ all_colon_equiv()

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

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

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

◆ all_ok()

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

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

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

◆ all_ones()

OCTAVE_API bool all_ones ( const Array< octave_idx_type > &  arr)

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

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

◆ any_ones()

OCTAVE_API 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()

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

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

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

◆ compute_index() [1/4]

◆ compute_index() [2/4]

OCTAVE_API 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_index_out_of_range(), err_invalid_index(), and dim_vector::numel().

◆ compute_index() [3/4]

OCTAVE_API 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_index_out_of_range(), err_invalid_index(), and dim_vector::numel().

◆ compute_index() [4/4]

◆ conv_to_array()

OCTAVE_API 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()

◆ freeze()

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

◆ get_elt_idx()

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

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

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

◆ get_ra_idx()

◆ get_scalar_idx()

OCTAVE_API 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()

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

◆ ind2sub()

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

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

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

Referenced by Find2sub().

◆ index_in_bounds()

OCTAVE_API 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()

OCTAVE_API 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()

OCTAVE_API 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(), octave_classdef::size(), and xnorm().

◆ num_ones()

OCTAVE_API 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 OCTAVE_API permute_vector_compare ( const void *  a,
const void *  b 
)

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

References permute_vector::pidx.

◆ sub2ind()

◆ vector_equivalent()

OCTAVE_API 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]

◆ zero_dims_inquire() [2/2]

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

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

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