#include <cctype>
#include <cstdlib>
#include <istream>
#include <limits>
#include <ostream>
#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) |
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) |
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) |
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) |
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) |
#define FIND_SIZED_FLOAT_TYPE | ( | VAL, | |
BITS | |||
) |
Definition at line 87 of file data-conv.cc.
#define FIND_SIZED_INT_TYPE | ( | VAL, | |
BITS, | |||
TQ, | |||
Q | |||
) |
Definition at line 69 of file data-conv.cc.
#define GET_SIZED_INT_TYPE | ( | T, | |
U | |||
) |
Definition at line 158 of file data-conv.cc.
Definition at line 580 of file data-conv.cc.
Definition at line 599 of file data-conv.cc.
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 | ||
) |
Definition at line 659 of file data-conv.cc.
References flt_fmt_ieee_big_endian, and flt_fmt_ieee_little_endian.
Referenced by do_float_format_conversion(), read_doubles(), and read_floats().
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 | ||
) |
Definition at line 706 of file data-conv.cc.
References flt_fmt_ieee_big_endian, and flt_fmt_ieee_little_endian.
Referenced by do_float_format_conversion(), read_doubles(), and read_floats().
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 | ||
) |
Definition at line 753 of file data-conv.cc.
References do_double_format_conversion(), do_float_format_conversion(), and len.
void read_doubles | ( | std::istream & | is, |
double * | data, | ||
save_type | type, | ||
octave_idx_type | len, | ||
bool | swap, | ||
octave::mach_info::float_format | fmt | ||
) |
Definition at line 776 of file data-conv.cc.
References do_double_format_conversion(), do_float_format_conversion(), len, 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::load_binary(), octave_complex_diag_matrix::load_binary(), octave_complex_matrix::load_binary(), octave_sparse_complex_matrix::load_binary(), octave_diag_matrix::load_binary(), octave_matrix::load_binary(), octave_sparse_matrix::load_binary(), and octave_scalar::load_binary().
void read_floats | ( | std::istream & | is, |
float * | data, | ||
save_type | type, | ||
octave_idx_type | len, | ||
bool | swap, | ||
octave::mach_info::float_format | fmt | ||
) |
Definition at line 836 of file data-conv.cc.
References do_double_format_conversion(), do_float_format_conversion(), len, 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_scalar::load_binary(), octave_float_complex::load_binary(), octave_float_complex_diag_matrix::load_binary(), octave_float_complex_matrix::load_binary(), octave_float_diag_matrix::load_binary(), and octave_float_matrix::load_binary().
void write_doubles | ( | std::ostream & | os, |
const double * | data, | ||
save_type | type, | ||
octave_idx_type | len | ||
) |
Definition at line 892 of file data-conv.cc.
References len, 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_complex_matrix::save_binary(), octave_sparse_complex_matrix::save_binary(), octave_diag_matrix::save_binary(), octave_matrix::save_binary(), and octave_sparse_matrix::save_binary().
void write_floats | ( | std::ostream & | os, |
const float * | data, | ||
save_type | type, | ||
octave_idx_type | len | ||
) |
Definition at line 942 of file data-conv.cc.
References len, 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_complex_matrix::save_binary(), octave_float_diag_matrix::save_binary(), and octave_float_matrix::save_binary().