26 #if defined (HAVE_CONFIG_H)
80 #if defined (HAVE_ZLIB)
84 #define READ_PAD(is_small_data_element, l) ((is_small_data_element) ? 4 : (((l)+7)/8)*8)
85 #define PAD(l) (((l) > 0 && (l) <= 4) ? 4 : (((l)+7)/8)*8)
86 #define INT8(l) ((l) == miINT8 || (l) == miUINT8 || (l) == miUTF8)
255 template <
typename T>
261 #define READ_INTEGER_DATA(TYPE, swap, data, size, len, stream) \
266 OCTAVE_LOCAL_BUFFER (TYPE, ptr, len); \
267 std::streamsize n_bytes = size * static_cast<std::streamsize> (len); \
268 stream.read (reinterpret_cast<char *> (ptr), n_bytes); \
270 swap_bytes< size > (ptr, len); \
271 for (octave_idx_type i = 0; i < len; i++) \
323 #undef READ_INTEGER_DATA
372 #define OCTAVE_MAT5_INTEGER_READ(TYP) \
376 std::streampos tmp_pos; \
378 if (read_mat5_tag (is, swap, type, len, is_small_data_element)) \
379 error ("load: reading matrix data for '%s'", retval.c_str ()); \
381 octave_idx_type n = re.numel (); \
382 tmp_pos = is.tellg (); \
383 read_mat5_integer_data (is, re.fortran_vec (), n, swap, \
384 static_cast<enum mat5_data_type> (type)); \
387 error ("load: reading matrix data for '%s'", retval.c_str ()); \
389 is.seekg (tmp_pos + static_cast<std::streamoff> \
390 (READ_PAD (is_small_data_element, len))); \
397 if (read_mat5_tag (is, swap, type, len, is_small_data_element)) \
398 error ("load: reading matrix data for '%s'", \
402 read_mat5_binary_data (is, im.fortran_vec (), n, swap, \
403 static_cast<enum mat5_data_type> (type), flt_fmt); \
406 error ("load: reading imaginary matrix data for '%s'", \
409 ComplexNDArray ctmp (dims); \
411 for (octave_idx_type i = 0; i < n; i++) \
412 ctmp(i) = Complex (re(i).double_value (), im(i)); \
426 bool& is_small_data_element)
431 if (! is.read (
reinterpret_cast<char *
> (&temp), 4))
437 upper = (temp >> 16) & 0xffff;
438 type = temp & 0xffff;
444 is_small_data_element =
true;
448 if (! is.read (
reinterpret_cast<char *
> (&temp), 4))
453 is_small_data_element =
false;
460 read_int (std::istream& is,
bool swap, int32_t& val)
462 is.read (
reinterpret_cast<char *
> (&val), 4);
489 bool isclass =
false;
494 std::string classname;
496 bool flt_fmt_is_big_endian
502 if ((flt_fmt_is_big_endian && ! swap) || (! flt_fmt_is_big_endian && swap))
509 int32_t element_length;
510 bool is_small_data_element;
519 #if defined (HAVE_ZLIB)
526 is.read (inbuf, element_length);
532 if (uncompress (
reinterpret_cast<Bytef *
> (tmp), &destLen,
533 reinterpret_cast<Bytef *
> (inbuf), element_length)
535 error (
"load: error probing size of compressed data element");
541 destLen = tmp[1] + 8;
542 std::string outbuf (destLen,
' ');
546 int err = uncompress (
reinterpret_cast<Bytef *
>
547 (
const_cast<char *
> (outbuf.c_str ())),
548 &destLen,
reinterpret_cast<Bytef *
> (inbuf),
569 msg =
"stream error";
584 case Z_VERSION_ERROR:
585 msg =
"version error";
589 error (
"load: error uncompressing data element (%s from zlib)",
594 std::istringstream gz_is (outbuf);
611 error (
"load: invalid element type = %d",
type);
614 if (element_length == 0)
626 error (
"load: invalid array flags subelement");
631 imag = (flags & 0x0800) != 0;
633 global = (flags & 0x0400) != 0;
635 logicalvar = (flags & 0x0200) != 0;
650 error (
"load: invalid dimensions array subelement");
652 int ndims = dim_len / 4;
662 for (
int i = 0; i < ndims; i++)
669 std::streampos tmp_pos = is.tellg ();
670 is.seekg (tmp_pos +
static_cast<std::streamoff
>
671 (
READ_PAD (is_small_data_element, dim_len) - dim_len));
683 error (
"load: invalid array name subelement");
690 std::streampos tmp_pos = is.tellg ();
695 goto data_read_error;
697 is.seekg (tmp_pos +
static_cast<std::streamoff
>
709 Cell cell_array (dims);
721 error (
"load: reading cell data for '%s'", nm.c_str ());
757 std::streampos tmp_pos;
760 error (
"load: reading sparse row data for '%s'",
retval.c_str ());
762 tmp_pos = is.tellg ();
768 error (
"load: reading sparse row data for '%s'",
retval.c_str ());
770 is.seekg (tmp_pos +
static_cast<std::streamoff
>
775 error (
"load: reading sparse column data for '%s'",
778 tmp_pos = is.tellg ();
784 error (
"load: reading sparse column data for '%s'",
787 is.seekg (tmp_pos +
static_cast<std::streamoff
>
792 error (
"load: reading sparse matrix data for '%s'",
803 tmp_pos = is.tellg ();
809 error (
"load: reading sparse matrix data for '%s'",
812 is.seekg (tmp_pos +
static_cast<std::streamoff
>
821 error (
"load: reading sparse matrix data for '%s'",
829 error (
"load: reading imaginary sparse matrix data for '%s'",
849 goto data_read_error;
861 if (ftype ==
"simple" || ftype ==
"scopedfunction")
875 if ((fpath.length () >= mroot.length ())
876 && fpath.substr (0, mroot.length ()) == mroot
889 + fpath.substr (mroot.length ()));
897 std::string dir_name = str.substr (0, xpos);
910 std::list<std::string> names;
911 names.push_back (fname +
".oct");
912 names.push_back (fname +
".mex");
913 names.push_back (fname +
".m");
924 std::string dir_name = str.substr (0, xpos);
936 "load: can't find the file %s",
947 std::string dir_name = fpath.substr (0, xpos);
959 "load: can't find the file %s",
966 else if (ftype ==
"nested")
969 "load: can't load nested function");
972 else if (ftype ==
"anonymous")
993 for (
auto p0 = m2.
begin (); p0 != m2.
end (); p0++)
995 std::string key = m2.
key (p0);
998 local_vars[key] = val;
1022 = interp.
eval_string (fname.substr (4),
true, parse_status);
1024 if (parse_status != 0)
1025 error (
"load: failed to load anonymous function handle");
1030 error (
"load: failed to load anonymous function handle");
1036 error (
"load: invalid function handle type");
1046 for (
int i = 0; i < n_fields; i++)
1050 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1052 error (
"load: invalid field name subelement");
1056 std::streampos tmp_pos = is.tellg ();
1060 if (! is.read (elname, fn_len))
1061 goto data_read_error;
1063 is.seekg (tmp_pos +
static_cast<std::streamoff
>
1064 (
READ_PAD (is_small_data_element, fn_len)));
1067 elname[fn_len] =
'\0';
1072 std::vector<Cell> elt (n_fields);
1075 elt[i] =
Cell (dims);
1084 if (field(i) ==
"MCOS")
1090 goto data_read_error;
1092 elt[i](j) = fieldtc;
1100 m.assign (field (i), elt[i]);
1111 error (
"load: invalid class name");
1116 std::streampos tmp_pos = is.tellg ();
1121 goto data_read_error;
1123 is.seekg (tmp_pos +
static_cast<std::streamoff
>
1138 int32_t field_name_length;
1144 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1146 error (
"load: invalid field name length subelement");
1148 if (! is.read (
reinterpret_cast<char *
> (&field_name_length), fn_len))
1149 goto data_read_error;
1156 if (
read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element)
1158 error (
"load: invalid field name subelement");
1164 fn_len =
READ_PAD (is_small_data_element, fn_len);
1168 if (! is.read (elname, fn_len))
1169 goto data_read_error;
1171 std::vector<Cell> elt (n_fields);
1174 elt[i] =
Cell (dims);
1186 elt[i](j) = fieldtc;
1192 const char *key = elname + i*field_name_length;
1194 m.assign (key, elt[i]);
1206 "load: classdef element has been converted to a struct");
1212 std::list<std::string> ());
1219 "load: unable to reconstruct object inheritance");
1233 catch (
const octave::execution_exception&)
1235 goto data_read_error;
1243 "load: element has been converted to a structure");
1271 out(i) = in(i).bool_value ();
1308 std::streampos tmp_pos;
1311 error (
"load: reading matrix data for '%s'",
retval.c_str ());
1314 tmp_pos = is.tellg ();
1320 error (
"load: reading matrix data for '%s'",
retval.c_str ());
1322 is.seekg (tmp_pos +
static_cast<std::streamoff
>
1332 error (
"load: reading matrix data for '%s'",
retval.c_str ());
1340 error (
"load: reading imaginary matrix data for '%s'",
1365 std::streampos tmp_pos;
1368 error (
"load: reading matrix data for '%s'",
retval.c_str ());
1371 tmp_pos = is.tellg ();
1377 error (
"load: reading matrix data for '%s'",
retval.c_str ());
1379 is.seekg (tmp_pos +
static_cast<std::streamoff
>
1391 out (i) =
static_cast<bool> (re (i));
1402 error (
"load: reading matrix data for '%s'",
retval.c_str ());
1410 error (
"load: reading imaginary matrix data for '%s'",
1416 ctmp(i) =
Complex (re(i), im(i));
1426 bool found_big_char =
false;
1432 found_big_char =
true;
1438 "load: can not read non-ASCII portions of UTF characters; replacing unreadable characters with '?'");
1445 bool utf8_multi_byte =
false;
1448 unsigned char a =
static_cast<unsigned char> (re(i));
1450 utf8_multi_byte =
true;
1453 if (utf8_multi_byte)
1456 "load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'");
1460 =
static_cast<unsigned char> (re(i));
1475 is.seekg (pos +
static_cast<std::streamoff
> (element_length));
1484 error (
"load: trouble reading binary file '%s'", filename.c_str ());
1488 "load: skipping over '%s'",
retval.c_str ());
1489 is.seekg (pos +
static_cast<std::streamoff
> (element_length));
1495 const std::string& filename)
1497 int16_t version = 0;
1499 uint64_t subsys_offset;
1501 is.seekg (116, std::ios::beg);
1502 is.read (
reinterpret_cast<char *
> (&subsys_offset), 8);
1504 is.seekg (124, std::ios::beg);
1505 is.read (
reinterpret_cast<char *
> (&version), 2);
1506 is.read (
reinterpret_cast<char *
> (&magic), 2);
1508 if (magic == 0x4d49)
1510 else if (magic == 0x494d)
1515 error (
"load: can't read binary file");
1521 version = ((version >> 8) & 0xff) + ((version & 0xff) << 8);
1523 if (version != 1 && ! quiet)
1525 "load: found version %d binary MAT file, but only prepared for version 1",
1531 if (subsys_offset != 0x2020202020202020ULL && subsys_offset != 0ULL)
1534 is.seekg (subsys_offset, std::ios::beg);
1549 std::string outbuf (ilen - 7,
' ');
1552 char *ctmp =
const_cast<char *
> (outbuf.c_str ());
1554 ctmp[j-8] = itmp(j).char_value ();
1556 std::istringstream fh_ws (outbuf);
1567 is.seekg (128, std::ios::beg);
1578 if (bytes > 0 && bytes <= 4)
1579 temp = (bytes << 16) +
type;
1583 if (! is.write (
reinterpret_cast<char *
> (&temp), 4))
1588 if (! is.write (
reinterpret_cast<char *
> (&temp), 4))
1597 #define MAT5_DO_WRITE(TYPE, data, count, stream) \
1600 OCTAVE_LOCAL_BUFFER (TYPE, ptr, count); \
1601 for (octave_idx_type i = 0; i < count; i++) \
1602 ptr[i] = static_cast<TYPE> (data[i]); \
1603 std::streamsize n_bytes = sizeof (TYPE) * static_cast<std::streamsize> (count); \
1604 stream.write (reinterpret_cast<char *> (ptr), n_bytes); \
1614 const double *data =
m.data ();
1618 if (
m.too_large_for_float ())
1621 "save: some values too large to save as floats -- saving as doubles instead");
1627 double max_val, min_val;
1628 if (
m.all_integers (max_val, min_val))
1691 os.write (
reinterpret_cast<const char *
> (data),
len);
1695 error (
"unrecognized data format requested");
1701 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1710 const float *data =
m.data ();
1712 float max_val, min_val;
1713 if (
m.all_integers (max_val, min_val))
1772 os.write (
reinterpret_cast<const char *
> (data),
len);
1780 error (
"unrecognized data format requested");
1786 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1791 template <
typename T>
1835 os.write (
reinterpret_cast<const char *
> (
m),
len);
1839 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
1885 bool mark_global,
bool save_as_floats)
1894 false, save_as_floats))
1903 bool save_as_floats)
1911 bool too_large_for_float =
false;
1914 double tmp = val[i];
1919 too_large_for_float =
true;
1924 if (! too_large_for_float)
1969 return 8 + nel * size;
2025 return PAD ((nel * size <= 4 ? 4 : 8) + nel * size);
2033 bool save_as_floats)
2054 bool save_as_floats)
2075 bool save_as_floats,
bool mat7_format)
2077 size_t max_namelen = 63;
2083 ret +=
PAD (
len > max_namelen ? max_namelen :
len);
2091 if (chm.
numel () > 2)
2104 ret +=
PAD (nnz *
sizeof (int32_t));
2106 ret +=
PAD ((nc + 1) *
sizeof (int32_t));
2116 ret +=
PAD (nnz *
sizeof (int32_t));
2118 ret +=
PAD ((nc + 1) *
sizeof (int32_t));
2122 #define INT_LEN(nel, size) \
2125 octave_idx_type sz = nel * size; \
2130 else if (cname ==
"int8")
2132 else if (cname ==
"int16")
2134 else if (cname ==
"int32")
2136 else if (cname ==
"int64")
2138 else if (cname ==
"uint8")
2140 else if (cname ==
"uint16")
2142 else if (cname ==
"uint32")
2144 else if (cname ==
"uint64")
2168 for (
int i = 0; i < nel; i++)
2197 size_t classlen = tc.
class_name ().length ();
2199 ret += 8 +
PAD (classlen > max_namelen ? max_namelen : classlen);
2202 for (
auto i =
m.begin (); i !=
m.end (); i++)
2205 ret += 16 + fieldcnt * (max_namelen + 1);
2210 for (
auto i =
m.begin (); i !=
m.end (); i++)
2212 const Cell elts =
m.contents (i);
2230 int tmp =
sizeof (int32_t);
2235 tmp_idx[i] = idx[i];
2244 "save: skipping %s: dimension too large for MAT format",
2254 bool mark_global,
bool mat7_format,
2255 bool save_as_floats,
bool compressing)
2260 size_t max_namelen = 63;
2263 int nd = tc.
ndims ();
2268 for (
int i = 0; i < nd; i++)
2270 if (dv(i) > max_dim_val)
2295 if (nnz > max_dim_val || nc + 1 > max_dim_val)
2303 else if (dv.
numel () > max_dim_val)
2309 #if defined (HAVE_ZLIB)
2311 if (mat7_format && ! compressing)
2315 std::ostringstream buf;
2320 save_as_floats,
true);
2326 std::string buf_str = buf.str ();
2327 uLongf srcLen = buf_str.length ();
2328 uLongf destLen = srcLen * 101 / 100 + 12;
2331 if (compress (
reinterpret_cast<Bytef *
> (out_buf), &destLen,
2332 reinterpret_cast<const Bytef *
> (buf_str.c_str ()),
2335 error (
"save: error compressing data element");
2340 os.write (out_buf, destLen);
2348 octave_unused_parameter (compressing);
2353 (tc,
name, save_as_floats, mat7_format));
2369 else if (cname ==
"int8")
2371 else if (cname ==
"int16")
2373 else if (cname ==
"int32")
2375 else if (cname ==
"int64")
2377 else if (cname ==
"uint8" || tc.
islogical ())
2379 else if (cname ==
"uint16")
2381 else if (cname ==
"uint32")
2383 else if (cname ==
"uint64")
2405 error (
"save: error while writing '%s' to MAT file",
name.c_str ());
2408 os.write (
reinterpret_cast<char *
> (&flags), 4);
2413 os.write (
reinterpret_cast<char *
> (&nnz_32), 4);
2417 for (
int i = 0; i < nd; i++)
2420 os.write (
reinterpret_cast<char *
> (&
n), 4);
2423 if (
PAD (dim_len) > dim_len)
2425 static char buf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
2426 os.write (buf,
PAD (dim_len) - dim_len);
2431 size_t namelen =
name.length ();
2433 if (namelen > max_namelen)
2434 namelen = max_namelen;
2436 int paddedlength =
PAD (namelen);
2440 memset (paddedname, 0, paddedlength);
2441 strncpy (paddedname,
name.c_str (), namelen);
2442 os.write (paddedname, paddedlength);
2456 const char *s = chm.
data ();
2459 buf[i] = *s++ & 0x00FF;
2461 os.write (
reinterpret_cast<char *
> (buf),
len);
2463 if (paddedlength >
len)
2465 static char padbuf[9]=
"\x00\x00\x00\x00\x00\x00\x00\x00";
2466 os.write (padbuf, paddedlength -
len);
2505 for (
int i = 0; i < nnz; i++)
2506 buf (i) =
m.data (i);
2511 else if (cname ==
"int8")
2517 else if (cname ==
"int16")
2523 else if (cname ==
"int32")
2529 else if (cname ==
"int64")
2535 else if (cname ==
"uint8")
2541 else if (cname ==
"uint16")
2547 else if (cname ==
"uint32")
2553 else if (cname ==
"uint64")
2585 error (
"save: error while writing '%s' to MAT file",
name.c_str ());
2609 size_t namelen = classname.length ();
2611 if (namelen > max_namelen)
2612 namelen = max_namelen;
2614 int paddedlength =
PAD (namelen);
2618 memset (paddedname, 0, paddedlength);
2619 strncpy (paddedname, classname.c_str (), namelen);
2620 os.write (paddedname, paddedlength);
2635 m = tmp(0).map_value ();
2637 catch (
const octave::execution_exception&)
2639 error (
"save: error while writing '%s' to MAT file",
2650 int32_t maxfieldnamelength = max_namelen + 1;
2655 os.write (
reinterpret_cast<char *
> (&maxfieldnamelength), 4);
2664 std::string key = keys(i);
2667 memset (buf, 0, max_namelen + 1);
2669 strncpy (buf, key.c_str (), max_namelen);
2670 os.write (buf, max_namelen + 1);
2677 std::vector<const octave_value *> elts (nf);
2679 elts[i] =
m.contents (keys(i)).data ();
2694 error (
"save: error while writing '%s' to MAT file",
void swap_bytes< 8 >(void *ptr)
void swap_bytes< 4 >(void *ptr)
charNDArray max(char d, const charNDArray &m)
octave_idx_type numel(void) const
Number of elements in the array.
const T * data(void) const
Size of the specified dimension.
const T * fortran_vec(void) const
Size of the specified dimension.
octave_idx_type cols(void) const
octave_idx_type * cidx(void)
octave_idx_type nzmax(void) const
Amount of storage for nonzero elements.
octave_idx_type * ridx(void)
Vector representing the dimensions (size) of an Array.
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
void resize(int n, int fill_value=0)
cdef_class find_class(const std::string &name, bool error_if_not_found=true, bool load_if_not_found=true)
std::string find_first_of(const std::list< std::string > &names)
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
load_path & get_load_path(void)
cdef_manager & get_cdef_manager(void)
tree_evaluator & get_evaluator(void)
std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
std::string system_path(void) const
std::map< std::string, octave_value > local_vars_map
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
octave_value make_fcn_handle(const std::string &nm)
void push_dummy_scope(const std::string &name)
bool reconstruct_parents(void)
bool reconstruct_exemplar(void)
octave_value fcn_val(void)
const octave_value & contents(const_iterator p) const
octave_idx_type nfields(void) const
const_iterator end(void) const
const_iterator begin(void) const
std::string key(const_iterator p) const
int32NDArray int32_array_value(void) const
boolNDArray bool_array_value(bool warn=false) const
uint16NDArray uint16_array_value(void) const
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
bool is_complex_matrix(void) const
bool issparse(void) const
bool is_string(void) const
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
bool is_defined(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
Cell cell_value(void) const
std::string class_name(void) const
int8NDArray int8_array_value(void) const
int64NDArray int64_array_value(void) const
bool isstruct(void) const
uint8NDArray uint8_array_value(void) const
octave_fcn_handle * fcn_handle_value(bool silent=false) const
std::string string_value(bool force=false) const
octave_scalar_map scalar_map_value(void) const
uint64NDArray uint64_array_value(void) const
bool is_range(void) const
NDArray array_value(bool frc_str_conv=false) const
bool is_real_matrix(void) const
bool is_single_type(void) const
uint32NDArray uint32_array_value(void) const
octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
bool isobject(void) const
octave_map map_value(void) const
bool is_real_scalar(void) const
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
FloatNDArray float_array_value(bool frc_str_conv=false) const
bool is_uint8_type(void) const
int16NDArray int16_array_value(void) const
bool is_inline_function(void) const
bool iscomplex(void) const
bool is_complex_scalar(void) const
bool islogical(void) const
dim_vector dims(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
ColumnVector real(const ComplexColumnVector &a)
ColumnVector imag(const ComplexColumnVector &a)
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 warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
void warn_wrong_type_arg(const char *name, const octave_value &tc)
static octave_value subsys_ov
#define READ_INTEGER_DATA(TYPE, swap, data, size, len, stream)
static void read_int(std::istream &is, bool swap, int32_t &val)
void write_mat5_integer_data(std::ostream &os, const T *m, int size, octave_idx_type nel)
static int write_mat5_tag(std::ostream &is, int type, octave_idx_type bytes)
static int read_mat5_tag(std::istream &is, bool swap, int32_t &type, int32_t &bytes, bool &is_small_data_element)
static bool write_mat5_cell_array(std::ostream &os, const Cell &cell, bool mark_global, bool save_as_floats)
#define MAT5_DO_WRITE(TYPE, data, count, stream)
int save_mat5_array_length(const double *val, octave_idx_type nel, bool save_as_floats)
#define OCTAVE_MAT5_INTEGER_READ(TYP)
@ MAT_FILE_WORKSPACE_CLASS
@ MAT_FILE_FUNCTION_CLASS
static void read_mat5_binary_data(std::istream &is, double *data, octave_idx_type count, bool swap, mat5_data_type type, octave::mach_info::float_format flt_fmt)
int read_mat5_binary_file_header(std::istream &is, bool &swap, bool quiet, const std::string &filename)
#define INT_LEN(nel, size)
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)
static void write_mat5_array(std::ostream &os, const NDArray &m, bool save_as_floats)
int save_mat5_element_length(const octave_value &tc, const std::string &name, bool save_as_floats, bool mat7_format)
static void warn_dim_too_large(const std::string &name)
std::string read_mat5_binary_element(std::istream &is, const std::string &filename, bool swap, bool &global, octave_value &tc)
#define READ_PAD(is_small_data_element, l)
static void write_mat5_sparse_index_vector(std::ostream &os, const octave_idx_type *idx, octave_idx_type nel)
void read_mat5_integer_data(std::istream &is, T *m, octave_idx_type count, bool swap, mat5_data_type type)
save_type get_save_type(double, double)
std::string octave_exec_home(void)
float_format native_float_format(void)
@ flt_fmt_ieee_big_endian
@ flt_fmt_ieee_little_endian
std::string dir_sep_chars(void)
octave_value load_fcn_from_file(const std::string &file_name, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, const std::string &fcn_name, bool autoload)
interpreter & __get_interpreter__(const std::string &who)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
load_path & __get_load_path__(const std::string &who)
std::complex< double > Complex
std::complex< float > FloatComplex
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value::octave_value(const Array< char > &chm, char type) return retval