GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
typecast.cc File Reference
#include <algorithm>
#include <limits>
#include "mx-base.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "ovl.h"
#include "unwind-prot.h"
Include dependency graph for typecast.cc:

Go to the source code of this file.

Functions

template<typename ArrayType >
ArrayType do_bitpack (const boolNDArray &bitp)
 
template<typename ArrayType >
boolNDArray do_bitunpack (const ArrayType &array)
 
OCTAVE_EXPORT octave_value_list Fbitpack (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fbitunpack (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Ftypecast (const octave_value_list &args, int)
 
template<typename ArrayType >
static void get_data_and_bytesize (const ArrayType &array, const void *&data, octave_idx_type &byte_size, dim_vector &old_dims, unwind_protect &frame)
 
static dim_vector get_vec_dims (const dim_vector &old_dims, octave_idx_type n)
 
template<typename ArrayType >
static ArrayType reinterpret_copy (const void *data, octave_idx_type byte_size, const dim_vector &old_dims)
 
template<typename ArrayType >
static ArrayType reinterpret_int_copy (const void *data, octave_idx_type byte_size, const dim_vector &old_dims)
 

Function Documentation

◆ do_bitpack()

template<typename ArrayType >
ArrayType do_bitpack ( const boolNDArray bitp)

◆ do_bitunpack()

template<typename ArrayType >
boolNDArray do_bitunpack ( const ArrayType &  array)

Definition at line 465 of file typecast.cc.

References Array< T, Alloc >::fortran_vec(), get_vec_dims(), m, and n.

Referenced by Fbitunpack().

◆ Fbitpack()

OCTAVE_EXPORT octave_value_list Fbitpack ( const octave_value_list args,
int   
)

Definition at line 377 of file typecast.cc.

References error(), octave_value::is_undefined(), octave_value(), and print_usage().

◆ Fbitunpack()

◆ Ftypecast()

◆ get_data_and_bytesize()

template<typename ArrayType >
static void get_data_and_bytesize ( const ArrayType &  array,
const void *&  data,
octave_idx_type byte_size,
dim_vector old_dims,
unwind_protect frame 
)
static

Definition at line 56 of file typecast.cc.

References action_container::add_delete().

Referenced by Ftypecast().

◆ get_vec_dims()

static dim_vector get_vec_dims ( const dim_vector old_dims,
octave_idx_type  n 
)
static

Definition at line 44 of file typecast.cc.

References n, and dim_vector::ndims().

Referenced by do_bitpack(), do_bitunpack(), reinterpret_copy(), and reinterpret_int_copy().

◆ reinterpret_copy()

template<typename ArrayType >
static ArrayType reinterpret_copy ( const void *  data,
octave_idx_type  byte_size,
const dim_vector old_dims 
)
static

Definition at line 74 of file typecast.cc.

References error(), get_vec_dims(), and n.

◆ reinterpret_int_copy()

template<typename ArrayType >
static ArrayType reinterpret_int_copy ( const void *  data,
octave_idx_type  byte_size,
const dim_vector old_dims 
)
static

Definition at line 92 of file typecast.cc.

References error(), get_vec_dims(), and n.