GNU Octave  6.2.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"
Include dependency graph for Array-util.cc:

Go to the source code of this file.

Classes

struct  sub2ind_helper
 

Functions

bool all_colon_equiv (const Array< idx_vector > &ra_idx, const dim_vector &frozen_lengths)
 
bool all_ok (const Array< 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< 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< idx_vectorconv_to_array (const idx_vector *tmp, const octave_idx_type len)
 
Array< octave_idx_typeconv_to_int_array (const Array< idx_vector > &a)
 
dim_vector freeze (Array< idx_vector > &ra_idx, const dim_vector &dimensions, int resize_ok)
 
Array< octave_idx_typeget_elt_idx (const Array< 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< idx_vectorind2sub (const dim_vector &dv, const 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)
 
idx_vector sub2ind (const dim_vector &dv, const Array< idx_vector > &idxa)
 
bool vector_equivalent (const dim_vector &dv)
 
dim_vector zero_dims_inquire (const Array< idx_vector > &ia, const dim_vector &rhdv)
 
dim_vector zero_dims_inquire (const idx_vector &i, const idx_vector &j, const dim_vector &rhdv)
 

Function Documentation

◆ all_colon_equiv()

bool all_colon_equiv ( const Array< 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(), ra_idx, and retval.

◆ all_ok()

bool all_ok ( const Array< idx_vector > &  ra_idx)

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

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

◆ all_ones()

bool all_ones ( const Array< octave_idx_type > &  arr)

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

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

◆ any_ones()

bool any_ones ( const Array< octave_idx_type > &  arr)

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

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

◆ any_orig_empty()

bool any_orig_empty ( const Array< idx_vector > &  ra_idx)

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

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

◆ compute_index() [1/4]

◆ compute_index() [2/4]

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

◆ compute_index() [3/4]

◆ compute_index() [4/4]

◆ conv_to_array()

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

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

References len, and retval.

◆ conv_to_int_array()

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

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

References Array< T >::dims(), Array< T >::elem(), Array< T >::numel(), and retval.

◆ freeze()

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

◆ get_elt_idx()

Array<octave_idx_type> get_elt_idx ( const Array< 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(), ra_idx, and retval.

◆ get_ra_idx()

◆ 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, Array< T >::numel(), and retval.

◆ increment_index()

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

◆ ind2sub()

◆ 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(), ra_idx, and retval.

◆ is_scalar()

bool is_scalar ( const dim_vector dim)

◆ 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(), octave_classdef::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(), ra_idx, and retval.

Referenced by dim_vector::all_ones().

◆ permute_vector_compare()

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

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< idx_vector > &  ia,
const dim_vector rhdv 
)

◆ zero_dims_inquire() [2/2]

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