GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cctype>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <vector>
#include "byte-swap.h"
#include "data-conv.h"
#include "lo-error.h"
#include "lo-ieee.h"
#include "oct-locbuf.h"
Go to the source code of this file.
Macros | |
#define | FIND_SIZED_FLOAT_TYPE(VAL, BITS) |
#define | FIND_SIZED_INT_TYPE(VAL, BITS, TQ, Q) |
#define | GET_SIZED_INT_TYPE(T, U) |
#define | LS_DO_READ(TYPE, swap, data, size, len, stream) |
#define | LS_DO_WRITE(TYPE, data, size, len, stream) |
#define FIND_SIZED_FLOAT_TYPE | ( | VAL, | |
BITS | |||
) |
Definition at line 78 of file data-conv.cc.
Referenced by init_sized_type_lookup_table().
#define FIND_SIZED_INT_TYPE | ( | VAL, | |
BITS, | |||
TQ, | |||
Q | |||
) |
Definition at line 60 of file data-conv.cc.
Referenced by init_sized_type_lookup_table().
#define GET_SIZED_INT_TYPE | ( | T, | |
U | |||
) |
Definition at line 149 of file data-conv.cc.
Referenced by oct_data_conv::string_to_data_type().
#define LS_DO_READ | ( | TYPE, | |
swap, | |||
data, | |||
size, | |||
len, | |||
stream | |||
) |
Definition at line 584 of file data-conv.cc.
Referenced by read_doubles(), and read_floats().
#define LS_DO_WRITE | ( | TYPE, | |
data, | |||
size, | |||
len, | |||
stream | |||
) |
Definition at line 603 of file data-conv.cc.
Referenced by write_doubles(), and write_floats().
void do_double_format_conversion | ( | void * | data, |
octave_idx_type | len, | ||
oct_mach_info::float_format | from_fmt, | ||
oct_mach_info::float_format | to_fmt | ||
) |
Definition at line 662 of file data-conv.cc.
References oct_mach_info::flt_fmt_ieee_big_endian, oct_mach_info::flt_fmt_ieee_little_endian, gripe_unrecognized_float_fmt(), IEEE_big_double_to_IEEE_little_double(), and IEEE_little_double_to_IEEE_big_double().
Referenced by convert_data(), do_float_format_conversion(), read_doubles(), and read_floats().
void do_float_format_conversion | ( | void * | data, |
octave_idx_type | len, | ||
oct_mach_info::float_format | from_fmt, | ||
oct_mach_info::float_format | to_fmt | ||
) |
Definition at line 709 of file data-conv.cc.
References oct_mach_info::flt_fmt_ieee_big_endian, oct_mach_info::flt_fmt_ieee_little_endian, gripe_unrecognized_float_fmt(), IEEE_big_float_to_IEEE_little_float(), and IEEE_little_float_to_IEEE_big_float().
Referenced by convert_and_copy(), convert_data(), do_float_format_conversion(), read_doubles(), and read_floats().
void do_float_format_conversion | ( | void * | data, |
size_t | sz, | ||
octave_idx_type | len, | ||
oct_mach_info::float_format | from_fmt, | ||
oct_mach_info::float_format | to_fmt | ||
) |
Definition at line 756 of file data-conv.cc.
References do_double_format_conversion(), and do_float_format_conversion().
Definition at line 622 of file data-conv.cc.
Referenced by do_double_format_conversion(), and do_float_format_conversion().
|
static |
Definition at line 638 of file data-conv.cc.
References d, and swap_bytes< 8 >().
Referenced by do_double_format_conversion().
|
static |
Definition at line 644 of file data-conv.cc.
References d, and swap_bytes< 4 >().
Referenced by do_float_format_conversion().
|
static |
Definition at line 650 of file data-conv.cc.
References d, and swap_bytes< 8 >().
Referenced by do_double_format_conversion().
|
static |
Definition at line 656 of file data-conv.cc.
References d, and swap_bytes< 4 >().
Referenced by do_float_format_conversion().
|
static |
Definition at line 115 of file data-conv.cc.
References FIND_SIZED_FLOAT_TYPE, and FIND_SIZED_INT_TYPE.
Referenced by oct_data_conv::string_to_data_type().
void read_doubles | ( | std::istream & | is, |
double * | data, | ||
save_type | type, | ||
octave_idx_type | len, | ||
bool | swap, | ||
oct_mach_info::float_format | fmt | ||
) |
Definition at line 779 of file data-conv.cc.
References __lo_ieee_replace_old_NA(), do_double_format_conversion(), do_float_format_conversion(), LS_CHAR, LS_DO_READ, LS_DOUBLE, LS_FLOAT, LS_INT, LS_SHORT, LS_U_CHAR, LS_U_INT, LS_U_SHORT, and OCTAVE_LOCAL_BUFFER.
Referenced by octave_complex_diag_matrix::load_binary(), octave_diag_matrix::load_binary(), octave_sparse_complex_matrix::load_binary(), octave_sparse_matrix::load_binary(), octave_complex_matrix::load_binary(), octave_complex::load_binary(), octave_matrix::load_binary(), octave_scalar::load_binary(), read_mat5_binary_data(), and read_mat_binary_data().
void read_floats | ( | std::istream & | is, |
float * | data, | ||
save_type | type, | ||
octave_idx_type | len, | ||
bool | swap, | ||
oct_mach_info::float_format | fmt | ||
) |
Definition at line 838 of file data-conv.cc.
References do_double_format_conversion(), do_float_format_conversion(), LS_CHAR, LS_DO_READ, LS_DOUBLE, LS_FLOAT, LS_INT, LS_SHORT, LS_U_CHAR, LS_U_INT, LS_U_SHORT, and OCTAVE_LOCAL_BUFFER.
Referenced by octave_float_complex_diag_matrix::load_binary(), octave_float_diag_matrix::load_binary(), octave_float_complex_matrix::load_binary(), octave_float_complex::load_binary(), octave_float_matrix::load_binary(), octave_float_scalar::load_binary(), and read_mat5_binary_data().
|
static |
Definition at line 132 of file data-conv.cc.
Referenced by oct_data_conv::string_to_data_type().
void write_doubles | ( | std::ostream & | os, |
const double * | data, | ||
save_type | type, | ||
octave_idx_type | len | ||
) |
Definition at line 894 of file data-conv.cc.
References LS_CHAR, LS_DO_WRITE, LS_DOUBLE, LS_FLOAT, LS_INT, LS_SHORT, LS_U_CHAR, LS_U_INT, and LS_U_SHORT.
Referenced by octave_complex_diag_matrix::save_binary(), octave_diag_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_sparse_matrix::save_binary(), octave_complex_matrix::save_binary(), and octave_matrix::save_binary().
void write_floats | ( | std::ostream & | os, |
const float * | data, | ||
save_type | type, | ||
octave_idx_type | len | ||
) |
Definition at line 944 of file data-conv.cc.
References LS_CHAR, LS_DO_WRITE, LS_DOUBLE, LS_FLOAT, LS_INT, LS_SHORT, LS_U_CHAR, LS_U_INT, and LS_U_SHORT.
Referenced by octave_float_complex_diag_matrix::save_binary(), octave_float_diag_matrix::save_binary(), octave_float_complex_matrix::save_binary(), and octave_float_matrix::save_binary().