#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <sstream>
#include <string>
#include <vector>
#include "byte-swap.h"
#include "dMatrix.h"
#include "data-conv.h"
#include "file-ops.h"
#include "file-stat.h"
#include "glob-match.h"
#include "lo-mappers.h"
#include "mach-info.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "oct-time.h"
#include "quit.h"
#include "str-vec.h"
#include "Cell.h"
#include "call-stack.h"
#include "defaults.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "load-path.h"
#include "load-save.h"
#include "ls-mat5.h"
#include "ls-utils.h"
#include "oct-map.h"
#include "ov-cell.h"
#include "ov-class.h"
#include "ov-fcn-inline.h"
#include "ov.h"
#include "ovl.h"
#include "pager.h"
#include "parse.h"
#include "pt-exp.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "version.h"
#include <zlib.h>
Go to the source code of this file.
Macros | |
#define | INT8(l) ((l) == miINT8 || (l) == miUINT8 || (l) == miUTF8) |
#define | INT_LEN(nel, size) |
#define | MAT5_DO_WRITE(TYPE, data, count, stream) |
#define | OCTAVE_MAT5_INTEGER_READ(TYP) |
#define | PAD(l) (((l) > 0 && (l) <= 4) ? 4 : (((l)+7)/8)*8) |
#define | READ_INTEGER_DATA(TYPE, swap, data, size, len, stream) |
#define | READ_PAD(is_small_data_element, l) ((is_small_data_element) ? 4 : (((l)+7)/8)*8) |
Variables | |
static octave_value | subsys_ov |
Definition at line 85 of file ls-mat5.cc.
Referenced by read_mat5_binary_element().
#define INT_LEN | ( | nel, | |
size | |||
) |
Referenced by save_mat5_element_length().
#define MAT5_DO_WRITE | ( | TYPE, | |
data, | |||
count, | |||
stream | |||
) |
Definition at line 1586 of file ls-mat5.cc.
Referenced by write_mat5_array().
#define OCTAVE_MAT5_INTEGER_READ | ( | TYP | ) |
Definition at line 371 of file ls-mat5.cc.
Referenced by read_mat5_binary_element().
#define PAD | ( | l | ) | (((l) > 0 && (l) <= 4) ? 4 : (((l)+7)/8)*8) |
Definition at line 84 of file ls-mat5.cc.
Referenced by save_mat5_array_length(), save_mat5_binary_element(), save_mat5_element_length(), write_mat5_array(), and write_mat5_integer_data().
#define READ_INTEGER_DATA | ( | TYPE, | |
swap, | |||
data, | |||
size, | |||
len, | |||
stream | |||
) |
Referenced by read_mat5_integer_data().
#define READ_PAD | ( | is_small_data_element, | |
l | |||
) | ((is_small_data_element) ? 4 : (((l)+7)/8)*8) |
Definition at line 83 of file ls-mat5.cc.
Referenced by read_mat5_binary_element().
enum arrayclasstype |
Definition at line 98 of file ls-mat5.cc.
|
static |
Definition at line 459 of file ls-mat5.cc.
References is, swap, swap_bytes< 4 >(), and val.
Referenced by read_mat5_binary_element().
|
static |
Definition at line 125 of file ls-mat5.cc.
References flt_fmt, is, LS_CHAR, LS_DOUBLE, LS_FLOAT, LS_INT, LS_LONG, LS_SHORT, LS_U_CHAR, LS_U_INT, LS_U_LONG, LS_U_SHORT, miDOUBLE, miINT16, miINT32, miINT64, miINT8, miMATRIX, miRESERVE1, miRESERVE2, miRESERVE3, miSINGLE, miUINT16, miUINT32, miUINT64, miUINT8, miUTF16, miUTF32, miUTF8, read_doubles(), swap, and type.
Referenced by read_mat5_binary_element().
|
static |
Definition at line 190 of file ls-mat5.cc.
References flt_fmt, is, LS_CHAR, LS_DOUBLE, LS_FLOAT, LS_INT, LS_LONG, LS_SHORT, LS_U_CHAR, LS_U_INT, LS_U_LONG, LS_U_SHORT, miDOUBLE, miINT16, miINT32, miINT64, miINT8, miMATRIX, miRESERVE1, miRESERVE2, miRESERVE3, miSINGLE, miUINT16, miUINT32, miUINT64, miUINT8, miUTF16, miUTF32, miUTF8, read_floats(), swap, and type.
std::string read_mat5_binary_element | ( | std::istream & | is, |
const std::string & | filename, | ||
bool | swap, | ||
bool & | global, | ||
octave_value & | tc | ||
) |
Definition at line 476 of file ls-mat5.cc.
References octave::__get_call_stack__(), octave::__get_cdef_manager__(), octave::__get_load_path__(), octave::__get_symbol_table__(), a, octave::action_container::add_method(), octave_map::assign(), octave::symbol_scope::assign(), octave_scalar_map::begin(), octave_value::cell_value(), Sparse< T >::cidx(), octave_scalar_map::contents(), octave_map::contents(), octave_value::convert_to_str(), cs, Sparse< T >::data(), dims, octave::sys::file_ops::dir_sep_chars(), octave_scalar_map::end(), err, err_disabled_feature(), error(), octave::eval_string(), octave::sys::base_file_stat::exists(), octave_value::fcn_handle_value(), octave_fcn_handle::fcn_val(), octave::feval(), filename, cdef_manager::find_class(), octave::load_path::find_method(), flt_fmt, octave::mach_info::flt_fmt_ieee_big_endian, octave::mach_info::flt_fmt_ieee_little_endian, octave::mach_info::flt_fmt_unknown, fname, Array< T >::fortran_vec(), frame, fs, i, imag(), INT8, is, octave_value::is_defined(), octave_scalar_map::key(), octave::load_fcn_from_file(), octave::sys::env::make_absolute(), make_fcn_handle(), MAT_FILE_CELL_CLASS, MAT_FILE_CHAR_CLASS, MAT_FILE_DOUBLE_CLASS, MAT_FILE_FUNCTION_CLASS, MAT_FILE_INT16_CLASS, MAT_FILE_INT32_CLASS, MAT_FILE_INT64_CLASS, MAT_FILE_INT8_CLASS, MAT_FILE_OBJECT_CLASS, MAT_FILE_SINGLE_CLASS, MAT_FILE_SPARSE_CLASS, MAT_FILE_STRUCT_CLASS, MAT_FILE_UINT16_CLASS, MAT_FILE_UINT32_CLASS, MAT_FILE_UINT64_CLASS, MAT_FILE_UINT8_CLASS, MAT_FILE_WORKSPACE_CLASS, miCOMPRESSED, miINT32, miMATRIX, miUINT32, miUTF16, miUTF32, miUTF8, name, octave::mach_info::native_float_format(), octave_value::ndims(), octave_scalar_map::nfields(), nm, octave_value::nnz(), Array< T >::numel(), octave_value::nzmax(), octave::config::octave_exec_home(), OCTAVE_LOCAL_BUFFER, OCTAVE_MAT5_INTEGER_READ, cdef_object::ok(), p, octave::call_stack::pop(), octave::call_stack::push(), read_int(), read_mat5_binary_data(), read_mat5_binary_element(), read_mat5_integer_data(), read_mat5_tag(), READ_PAD, octave_class::reconstruct_exemplar(), octave_class::reconstruct_parents(), retval, Sparse< T >::ridx(), octave::action_container::run(), octave_value::scalar_map_value(), octave::symbol_table::set_scope(), str, string, octave_value::string_value(), subsys_ov, swap, swap_bytes< 4 >(), octave::load_path::system_path(), tmp, type, octave_value::uint32_array_value(), octave_value::uint8_array_value(), val, warning(), and Sparse< T >::xdata().
Referenced by do_load(), read_mat5_binary_element(), and read_mat5_binary_file_header().
int read_mat5_binary_file_header | ( | std::istream & | is, |
bool & | swap, | ||
bool | quiet, | ||
const std::string & | filename | ||
) |
Definition at line 1484 of file ls-mat5.cc.
References error(), filename, is, octave_value::is_uint8_type(), Array< T >::numel(), read_mat5_binary_element(), string, subsys_ov, swap, swap_bytes< 8 >(), octave_value::uint8_array_value(), and warning().
Referenced by get_file_format(), and if().
void read_mat5_integer_data | ( | std::istream & | is, |
T * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
Definition at line 256 of file ls-mat5.cc.
References is, miDOUBLE, miINT16, miINT32, miINT64, miINT8, miMATRIX, miRESERVE1, miRESERVE2, miRESERVE3, miSINGLE, miUINT16, miUINT32, miUINT64, miUINT8, READ_INTEGER_DATA, swap, and type.
Referenced by read_mat5_binary_element().
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_int8 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_int16 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_int32 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_int64 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_uint8 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_uint16 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_uint32 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
octave_uint64 * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
template void read_mat5_integer_data | ( | std::istream & | is, |
int * | m, | ||
octave_idx_type | count, | ||
bool | swap, | ||
mat5_data_type | type | ||
) |
|
static |
Definition at line 424 of file ls-mat5.cc.
References is, swap, swap_bytes< 4 >(), and type.
Referenced by read_mat5_binary_element().
int save_mat5_array_length | ( | const double * | val, |
octave_idx_type | nel, | ||
bool | save_as_floats | ||
) |
Definition at line 1891 of file ls-mat5.cc.
References i, octave::math::isfinite(), max(), save_as_floats, octave_value::size(), tmp, and val.
Referenced by save_mat5_array_length(), and save_mat5_element_length().
int save_mat5_array_length | ( | const float * | , |
octave_idx_type | nel, | ||
bool | |||
) |
Definition at line 1965 of file ls-mat5.cc.
References PAD, and octave_value::size().
int save_mat5_array_length | ( | const Complex * | val, |
octave_idx_type | nel, | ||
bool | save_as_floats | ||
) |
Definition at line 2021 of file ls-mat5.cc.
References i, imag(), OCTAVE_LOCAL_BUFFER, real(), save_as_floats, save_mat5_array_length(), tmp, and val.
int save_mat5_array_length | ( | const FloatComplex * | val, |
octave_idx_type | nel, | ||
bool | save_as_floats | ||
) |
Definition at line 2042 of file ls-mat5.cc.
References i, imag(), OCTAVE_LOCAL_BUFFER, real(), save_as_floats, save_mat5_array_length(), tmp, and val.
bool save_mat5_binary_element | ( | std::ostream & | os, |
const octave_value & | tc, | ||
const std::string & | name, | ||
bool | mark_global, | ||
bool | mat7_format, | ||
bool | save_as_floats, | ||
bool | compressing | ||
) |
Definition at line 2241 of file ls-mat5.cc.
References octave::__get_load_path__(), octave_value::array_value(), octave_value::bool_array_value(), octave_value::cell_value(), octave_value::char_array_value(), Sparse< T >::cidx(), octave_value::class_name(), Sparse< T >::cols(), octave_value::complex_array_value(), octave_map::contents(), Sparse< T >::data(), Array< T >::data(), octave_value::dims(), dv, error(), octave::feval(), octave::load_path::find_method(), octave_value::float_array_value(), octave_value::float_complex_array_value(), Array< T >::fortran_vec(), i, imag(), octave_value::int16_array_value(), octave_value::int32_array_value(), octave_value::int64_array_value(), octave_value::int8_array_value(), octave_value::is_complex_matrix(), octave_value::is_complex_scalar(), octave_value::is_inline_function(), octave_value::is_range(), octave_value::is_real_matrix(), octave_value::is_real_scalar(), octave_value::is_single_type(), octave_value::is_string(), octave_value::iscell(), octave_value::iscomplex(), octave_value::islogical(), octave_value::isobject(), octave_value::issparse(), octave_value::isstruct(), octave_map::keys(), octave_value::map_value(), MAT_FILE_CELL_CLASS, MAT_FILE_CHAR_CLASS, MAT_FILE_DOUBLE_CLASS, MAT_FILE_INT16_CLASS, MAT_FILE_INT32_CLASS, MAT_FILE_INT64_CLASS, MAT_FILE_INT8_CLASS, MAT_FILE_OBJECT_CLASS, MAT_FILE_SINGLE_CLASS, MAT_FILE_SPARSE_CLASS, MAT_FILE_STRUCT_CLASS, MAT_FILE_UINT16_CLASS, MAT_FILE_UINT32_CLASS, MAT_FILE_UINT64_CLASS, MAT_FILE_UINT8_CLASS, max(), miCOMPRESSED, miINT32, miINT8, miMATRIX, miUINT16, miUINT32, name, octave_value::ndims(), octave_map::nfields(), Sparse< T >::nnz(), octave_value::nnz(), dim_vector::numel(), Array< T >::numel(), octave_map::numel(), Sparse< T >::nzmax(), OCTAVE_LOCAL_BUFFER, os, PAD, real(), Sparse< T >::ridx(), s, save_as_floats, save_mat5_binary_element(), save_mat5_element_length(), octave_value::sparse_complex_matrix_value(), octave_value::sparse_matrix_value(), string, tmp, octave_value::uint16_array_value(), octave_value::uint32_array_value(), octave_value::uint64_array_value(), octave_value::uint8_array_value(), warn_dim_too_large(), warn_wrong_type_arg(), octave::stream::write(), write_mat5_array(), write_mat5_cell_array(), write_mat5_integer_data(), write_mat5_sparse_index_vector(), and write_mat5_tag().
Referenced by do_save(), save_mat5_binary_element(), and write_mat5_cell_array().
int save_mat5_element_length | ( | const octave_value & | tc, |
const std::string & | name, | ||
bool | save_as_floats, | ||
bool | mat7_format | ||
) |
Definition at line 2063 of file ls-mat5.cc.
References octave_value::array_value(), octave_map::begin(), octave_value::bool_array_value(), octave_value::cell_value(), octave_value::char_array_value(), octave_value::class_name(), Sparse< T >::cols(), octave_value::complex_array_value(), octave_map::contents(), Sparse< T >::data(), octave_map::end(), octave_value::float_array_value(), octave_value::float_complex_array_value(), Array< T >::fortran_vec(), i, octave_value::int16_array_value(), octave_value::int32_array_value(), octave_value::int64_array_value(), octave_value::int8_array_value(), INT_LEN, octave_value::is_complex_matrix(), octave_value::is_complex_scalar(), octave_value::is_inline_function(), octave_value::is_range(), octave_value::is_real_matrix(), octave_value::is_real_scalar(), octave_value::is_single_type(), octave_value::is_string(), octave_value::iscell(), octave_value::iscomplex(), octave_value::islogical(), octave_value::isobject(), octave_value::issparse(), octave_value::isstruct(), octave_value::map_value(), name, octave_value::ndims(), Sparse< T >::nnz(), octave_value::nnz(), Array< T >::numel(), octave_map::numel(), PAD, save_as_floats, save_mat5_array_length(), octave_value::sparse_complex_matrix_value(), octave_value::sparse_matrix_value(), string, octave_value::uint16_array_value(), octave_value::uint32_array_value(), octave_value::uint64_array_value(), and octave_value::uint8_array_value().
Referenced by save_mat5_binary_element().
|
static |
Definition at line 2231 of file ls-mat5.cc.
References name, and warning().
Referenced by save_mat5_binary_element().
Definition at line 1600 of file ls-mat5.cc.
References NDArray::all_integers(), Array< T >::data(), error(), get_save_type(), LS_CHAR, LS_DOUBLE, LS_FLOAT, LS_INT, LS_LONG, LS_SHORT, LS_U_CHAR, LS_U_INT, LS_U_LONG, LS_U_SHORT, MAT5_DO_WRITE, miDOUBLE, miINT16, miINT32, miINT8, miSINGLE, miUINT16, miUINT32, miUINT8, Array< T >::numel(), os, PAD, save_as_floats, octave_value::size(), NDArray::too_large_for_float(), warning(), octave::stream::write(), and write_mat5_tag().
Referenced by save_mat5_binary_element().
|
static |
Definition at line 1696 of file ls-mat5.cc.
References FloatNDArray::all_integers(), Array< T >::data(), error(), get_save_type(), LS_CHAR, LS_DOUBLE, LS_FLOAT, LS_INT, LS_LONG, LS_SHORT, LS_U_CHAR, LS_U_INT, LS_U_LONG, LS_U_SHORT, MAT5_DO_WRITE, miDOUBLE, miINT16, miINT32, miINT8, miSINGLE, miUINT16, miUINT32, miUINT8, Array< T >::numel(), os, PAD, octave_value::size(), octave::stream::write(), and write_mat5_tag().
|
static |
Definition at line 1873 of file ls-mat5.cc.
References i, Array< T >::numel(), os, save_as_floats, and save_mat5_binary_element().
Referenced by save_mat5_binary_element().
void write_mat5_integer_data | ( | std::ostream & | os, |
const T * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
Definition at line 1782 of file ls-mat5.cc.
References miINT16, miINT32, miINT64, miINT8, miUINT16, miUINT32, miUINT64, miUINT8, os, PAD, octave_value::size(), octave::stream::write(), and write_mat5_tag().
Referenced by save_mat5_binary_element(), and write_mat5_sparse_index_vector().
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_int8 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_int16 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_int32 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_int64 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_uint8 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_uint16 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_uint32 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const octave_uint64 * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, |
const int * | m, | ||
int | size, | ||
octave_idx_type | nel | ||
) |
|
static |
Definition at line 2216 of file ls-mat5.cc.
References i, OCTAVE_LOCAL_BUFFER, os, tmp, and write_mat5_integer_data().
Referenced by save_mat5_binary_element().
|
static |
Definition at line 1563 of file ls-mat5.cc.
Referenced by save_mat5_binary_element(), write_mat5_array(), and write_mat5_integer_data().
|
static |
Definition at line 89 of file ls-mat5.cc.
Referenced by read_mat5_binary_element(), and read_mat5_binary_file_header().