#include <cfloat>
#include <cstring>
#include <cctype>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "byte-swap.h"
#include "data-conv.h"
#include "file-ops.h"
#include "glob-match.h"
#include "lo-mappers.h"
#include "mach-info.h"
#include "oct-env.h"
#include "oct-time.h"
#include "quit.h"
#include "str-vec.h"
#include "file-stat.h"
#include "oct-locbuf.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "load-save.h"
#include "load-path.h"
#include "oct-obj.h"
#include "oct-map.h"
#include "ov-cell.h"
#include "ov-class.h"
#include "ov-fcn-inline.h"
#include "pager.h"
#include "pt-exp.h"
#include "sysdep.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "version.h"
#include "dMatrix.h"
#include "ls-utils.h"
#include "ls-mat5.h"
#include "parse.h"
#include "defaults.h"
Defines | |
#define | PAD(l) (((l) > 0 && (l) <= 4) ? 4 : (((l)+7)/8)*8) |
#define | READ_INTEGER_DATA(TYPE, swap, data, size, len, stream) |
#define | OCTAVE_MAT5_INTEGER_READ(TYP) |
#define | MAT5_DO_WRITE(TYPE, data, count, stream) |
#define | INT_LEN(nel, size) |
Enumerations | |
enum | arrayclasstype { MAT_FILE_CELL_CLASS = 1, MAT_FILE_STRUCT_CLASS, MAT_FILE_OBJECT_CLASS, MAT_FILE_CHAR_CLASS, MAT_FILE_SPARSE_CLASS, MAT_FILE_DOUBLE_CLASS, MAT_FILE_SINGLE_CLASS, MAT_FILE_INT8_CLASS, MAT_FILE_UINT8_CLASS, MAT_FILE_INT16_CLASS, MAT_FILE_UINT16_CLASS, MAT_FILE_INT32_CLASS, MAT_FILE_UINT32_CLASS, MAT_FILE_INT64_CLASS, MAT_FILE_UINT64_CLASS, MAT_FILE_FUNCTION_CLASS, MAT_FILE_WORKSPACE_CLASS } |
Functions | |
template<class T > | |
void | read_mat5_integer_data (std::istream &is, T *m, octave_idx_type count, bool swap, mat5_data_type type) |
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, int *m, octave_idx_type count, bool swap, mat5_data_type type) |
std::string | read_mat5_binary_element (std::istream &is, const std::string &filename, bool swap, bool &global, octave_value &tc) |
int | read_mat5_binary_file_header (std::istream &is, bool &swap, bool quiet, const std::string &filename) |
template<class T > | |
void | write_mat5_integer_data (std::ostream &os, const T *m, int size, octave_idx_type nel) |
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 int *m, int size, octave_idx_type nel) |
int | save_mat5_array_length (const double *val, octave_idx_type nel, bool save_as_floats) |
int | save_mat5_array_length (const float *, octave_idx_type nel, bool) |
int | save_mat5_array_length (const Complex *val, octave_idx_type nel, bool save_as_floats) |
int | save_mat5_array_length (const FloatComplex *val, octave_idx_type nel, bool save_as_floats) |
int | save_mat5_element_length (const octave_value &tc, const std::string &name, bool save_as_floats, bool mat7_format) |
bool | save_mat5_binary_element (std::ostream &os, const octave_value &tc, const std::string &name, bool mark_as_global, bool mat7_format, bool save_as_floats, bool compressing) |
#define INT_LEN | ( | nel, | ||
size | ||||
) |
{ \ ret += 8; \ octave_idx_type sz = nel * size; \ if (sz > 4) \ ret += PAD (sz); \ }
#define MAT5_DO_WRITE | ( | TYPE, | ||
data, | ||||
count, | ||||
stream | ||||
) |
do \ { \ OCTAVE_LOCAL_BUFFER (TYPE, ptr, count); \ for (octave_idx_type i = 0; i < count; i++) \ ptr[i] = static_cast<TYPE> (data[i]); \ stream.write (reinterpret_cast<char *> (ptr), count * sizeof (TYPE)); \ } \ while (0)
#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 | ||||
) |
do \ { \ if (len > 0) \ { \ OCTAVE_LOCAL_BUFFER (TYPE, ptr, len); \ stream.read (reinterpret_cast<char *> (ptr), size * len); \ if (swap) \ swap_bytes< size > (ptr, len); \ for (octave_idx_type i = 0; i < len; i++) \ data[i] = ptr[i]; \ } \ } \ while (0)
enum arrayclasstype |
std::string read_mat5_binary_element | ( | std::istream & | is, | |
const std::string & | filename, | |||
bool | swap, | |||
bool & | global, | |||
octave_value & | tc | |||
) |
int read_mat5_binary_file_header | ( | std::istream & | is, | |
bool & | swap, | |||
bool | quiet, | |||
const std::string & | filename | |||
) |
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, | |
int * | m, | |||
octave_idx_type | count, | |||
bool | swap, | |||
mat5_data_type | type | |||
) |
void read_mat5_integer_data | ( | std::istream & | is, | |
T * | m, | |||
octave_idx_type | count, | |||
bool | swap, | |||
mat5_data_type | type | |||
) |
int save_mat5_array_length | ( | const double * | val, | |
octave_idx_type | nel, | |||
bool | save_as_floats | |||
) |
int save_mat5_array_length | ( | const float * | , | |
octave_idx_type | nel, | |||
bool | ||||
) |
int save_mat5_array_length | ( | const Complex * | val, | |
octave_idx_type | nel, | |||
bool | save_as_floats | |||
) |
int save_mat5_array_length | ( | const FloatComplex * | val, | |
octave_idx_type | nel, | |||
bool | save_as_floats | |||
) |
bool save_mat5_binary_element | ( | std::ostream & | os, | |
const octave_value & | tc, | |||
const std::string & | name, | |||
bool | mark_as_global, | |||
bool | mat7_format, | |||
bool | save_as_floats, | |||
bool | compressing | |||
) |
int save_mat5_element_length | ( | const octave_value & | tc, | |
const std::string & | name, | |||
bool | save_as_floats, | |||
bool | mat7_format | |||
) |
void write_mat5_integer_data | ( | std::ostream & | os, | |
const T * | 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 | |||
) |
template void write_mat5_integer_data | ( | std::ostream & | os, | |
const octave_int8 * | m, | |||
int | size, | |||
octave_idx_type | nel | |||
) |