GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
data-conv.h File Reference
#include "octave-config.h"
#include "mach-info.h"
#include "oct-inttypes-fwd.h"

Go to the source code of this file.

Classes

class  oct_data_conv
 

Enumerations

enum  save_type {
  LS_U_CHAR = 0 , LS_U_SHORT = 1 , LS_U_INT = 2 , LS_CHAR = 3 ,
  LS_SHORT = 4 , LS_INT = 5 , LS_FLOAT = 6 , LS_DOUBLE = 7 ,
  LS_U_LONG = 8 , LS_LONG = 9
}
 

Functions

void do_double_format_conversion (void *data, octave_idx_type len, octave::mach_info::float_format from_fmt, octave::mach_info::float_format to_fmt=octave::mach_info::native_float_format())
 
void do_float_format_conversion (void *data, octave_idx_type len, octave::mach_info::float_format from_fmt, octave::mach_info::float_format to_fmt=octave::mach_info::native_float_format())
 
void do_float_format_conversion (void *data, std::size_t sz, octave_idx_type len, octave::mach_info::float_format from_fmt, octave::mach_info::float_format to_fmt=octave::mach_info::native_float_format())
 
template<typename T >
bool is_equivalent_type (oct_data_conv::data_type)
 
template<>
bool is_equivalent_type< double > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< float > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< int16_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< int32_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< int64_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< int8_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_int16 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_int32 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_int64 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_int8 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_uint16 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_uint32 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_uint64 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< octave_uint8 > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< uint16_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< uint32_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< uint64_t > (oct_data_conv::data_type t)
 
template<>
bool is_equivalent_type< uint8_t > (oct_data_conv::data_type t)
 
void read_doubles (std::istream &is, double *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
 
void read_floats (std::istream &is, float *data, save_type type, octave_idx_type len, bool swap, octave::mach_info::float_format fmt)
 
void write_doubles (std::ostream &os, const double *data, save_type type, octave_idx_type len)
 
void write_floats (std::ostream &os, const float *data, save_type type, octave_idx_type len)
 

Enumeration Type Documentation

◆ save_type

enum save_type
Enumerator
LS_U_CHAR 
LS_U_SHORT 
LS_U_INT 
LS_CHAR 
LS_SHORT 
LS_INT 
LS_FLOAT 
LS_DOUBLE 
LS_U_LONG 
LS_LONG 

Definition at line 86 of file data-conv.h.

Function Documentation

◆ do_double_format_conversion()

void do_double_format_conversion ( void *  data,
octave_idx_type  len,
octave::mach_info::float_format  from_fmt,
octave::mach_info::float_format  to_fmt = octave::mach_info::native_float_format() 
)

◆ do_float_format_conversion() [1/2]

void do_float_format_conversion ( void *  data,
octave_idx_type  len,
octave::mach_info::float_format  from_fmt,
octave::mach_info::float_format  to_fmt = octave::mach_info::native_float_format() 
)

◆ do_float_format_conversion() [2/2]

void do_float_format_conversion ( void *  data,
std::size_t  sz,
octave_idx_type  len,
octave::mach_info::float_format  from_fmt,
octave::mach_info::float_format  to_fmt = octave::mach_info::native_float_format() 
)

Definition at line 753 of file data-conv.cc.

References do_double_format_conversion(), do_float_format_conversion(), and len.

◆ is_equivalent_type()

template<typename T >
bool is_equivalent_type ( oct_data_conv::data_type  )
inline

Definition at line 136 of file data-conv.h.

◆ is_equivalent_type< double >()

template<>
bool is_equivalent_type< double > ( oct_data_conv::data_type  t)
inline

Definition at line 254 of file data-conv.h.

References oct_data_conv::dt_double.

◆ is_equivalent_type< float >()

template<>
bool is_equivalent_type< float > ( oct_data_conv::data_type  t)
inline

Definition at line 261 of file data-conv.h.

References oct_data_conv::dt_float, and oct_data_conv::dt_single.

◆ is_equivalent_type< int16_t >()

template<>
bool is_equivalent_type< int16_t > ( oct_data_conv::data_type  t)
inline

Definition at line 149 of file data-conv.h.

References oct_data_conv::dt_int16.

◆ is_equivalent_type< int32_t >()

template<>
bool is_equivalent_type< int32_t > ( oct_data_conv::data_type  t)
inline

Definition at line 156 of file data-conv.h.

References oct_data_conv::dt_int32.

◆ is_equivalent_type< int64_t >()

template<>
bool is_equivalent_type< int64_t > ( oct_data_conv::data_type  t)
inline

Definition at line 163 of file data-conv.h.

References oct_data_conv::dt_int64.

◆ is_equivalent_type< int8_t >()

template<>
bool is_equivalent_type< int8_t > ( oct_data_conv::data_type  t)
inline

Definition at line 142 of file data-conv.h.

References oct_data_conv::dt_int8.

◆ is_equivalent_type< octave_int16 >()

template<>
bool is_equivalent_type< octave_int16 > ( oct_data_conv::data_type  t)
inline

Definition at line 205 of file data-conv.h.

References oct_data_conv::dt_int16.

◆ is_equivalent_type< octave_int32 >()

template<>
bool is_equivalent_type< octave_int32 > ( oct_data_conv::data_type  t)
inline

Definition at line 212 of file data-conv.h.

References oct_data_conv::dt_int32.

◆ is_equivalent_type< octave_int64 >()

template<>
bool is_equivalent_type< octave_int64 > ( oct_data_conv::data_type  t)
inline

Definition at line 219 of file data-conv.h.

References oct_data_conv::dt_int64.

◆ is_equivalent_type< octave_int8 >()

template<>
bool is_equivalent_type< octave_int8 > ( oct_data_conv::data_type  t)
inline

Definition at line 198 of file data-conv.h.

References oct_data_conv::dt_int8.

◆ is_equivalent_type< octave_uint16 >()

template<>
bool is_equivalent_type< octave_uint16 > ( oct_data_conv::data_type  t)
inline

Definition at line 233 of file data-conv.h.

References oct_data_conv::dt_uint16.

◆ is_equivalent_type< octave_uint32 >()

template<>
bool is_equivalent_type< octave_uint32 > ( oct_data_conv::data_type  t)
inline

Definition at line 240 of file data-conv.h.

References oct_data_conv::dt_uint32.

◆ is_equivalent_type< octave_uint64 >()

template<>
bool is_equivalent_type< octave_uint64 > ( oct_data_conv::data_type  t)
inline

Definition at line 247 of file data-conv.h.

References oct_data_conv::dt_uint64.

◆ is_equivalent_type< octave_uint8 >()

template<>
bool is_equivalent_type< octave_uint8 > ( oct_data_conv::data_type  t)
inline

Definition at line 226 of file data-conv.h.

References oct_data_conv::dt_uint8.

◆ is_equivalent_type< uint16_t >()

template<>
bool is_equivalent_type< uint16_t > ( oct_data_conv::data_type  t)
inline

Definition at line 177 of file data-conv.h.

References oct_data_conv::dt_uint16.

◆ is_equivalent_type< uint32_t >()

template<>
bool is_equivalent_type< uint32_t > ( oct_data_conv::data_type  t)
inline

Definition at line 184 of file data-conv.h.

References oct_data_conv::dt_uint32.

◆ is_equivalent_type< uint64_t >()

template<>
bool is_equivalent_type< uint64_t > ( oct_data_conv::data_type  t)
inline

Definition at line 191 of file data-conv.h.

References oct_data_conv::dt_uint64.

◆ is_equivalent_type< uint8_t >()

template<>
bool is_equivalent_type< uint8_t > ( oct_data_conv::data_type  t)
inline

Definition at line 170 of file data-conv.h.

References oct_data_conv::dt_uint8.

◆ read_doubles()

◆ read_floats()

◆ write_doubles()

◆ write_floats()