GNU Octave
4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cfloat>
#include <cstring>
#include <cctype>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include "byte-swap.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 "strftime-wrapper.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "load-path.h"
#include "load-save.h"
#include "oct-hdf5.h"
#include "ovl.h"
#include "oct-map.h"
#include "ov-cell.h"
#include "pager.h"
#include "pt-exp.h"
#include "symtab.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "version.h"
#include "dMatrix.h"
#include "ls-hdf5.h"
#include "ls-mat-ascii.h"
#include "ls-mat4.h"
#include "ls-mat5.h"
#include "ls-oct-text.h"
#include "ls-oct-binary.h"
#include "zfstream.h"
Go to the source code of this file.
Typedefs | |
using | format = LS_UNKNOWN |
Variables | |
bool | append = false |
from the file | ar {file}. If no variables are specified then all variables found in the file will be loaded. As with ode{save} |
int | argc = args.length () + 1 |
string_vector | argv = args.make_argv ("load") |
else | |
octave::mach_info::float_format | flt_fmt = octave::mach_info::flt_fmt_unknown |
fname = find_file_to_load (fname, orig_fname) | |
int | i = 1 |
write the output to stdout if nargout | is |
bool | list_only = false |
std::string | orig_fname = "" |
in the file Octave saves all the variables in the current scope | Otherwise |
ots {} | |
in the file Octave saves all the variables in the current scope full variable names or pattern syntax can be used to specify the variables to save If the | ption {-struct} modifier is used |
return | retval |
bool | save_as_floats = false |
bool | swap = false |
bool | use_zlib = false |
static bool | Vcrash_dumps_octave_core = true |
bool | verbose = false |
static double | Voctave_core_file_limit = -1.0 |
static std::string | Voctave_core_file_name = "octave-workspace" |
static std::string | Voctave_core_file_options = "-binary" |
static std::string | Vsave_default_options = "-text" |
static std::string | Vsave_header_format_string = default_save_header_format () |
Definition at line 1580 of file load-save.cc.
in the file Octave saves all the variables in the current scope full variable names or pattern syntax can be used to specify the variables to save If the fields and variable name arguments | ( | ar{v1} | , |
ots{} | |||
) |
Definition at line 1576 of file load-save.cc.
|
static |
Definition at line 214 of file load-save.cc.
References file, OCTAVE_LOCAL_BUFFER, and retval.
Referenced by get_file_format().
|
static |
Definition at line 112 of file load-save.cc.
References octave::sys::env::get_host_name(), octave::sys::env::get_user_name(), OCTAVE_VERSION, and string.
octave_value do_load | ( | std::istream & | stream, |
const std::string & | orig_fname, | ||
load_save_format | format, | ||
octave::mach_info::float_format | flt_fmt, | ||
bool | list_only, | ||
bool | swap, | ||
bool | verbose, | ||
const string_vector & | argv, | ||
int | argv_idx, | ||
int | argc, | ||
int | nargout | ||
) |
Definition at line 344 of file load-save.cc.
References octave_scalar_map::assign(), octave_value::columns(), err_unrecognized_data_fmt(), error(), install_loaded_variable(), octave_value::is_defined(), left, string_vector::list_in_columns(), LS_BINARY, LS_HDF5, LS_MAT5_BINARY, LS_MAT7_BINARY, LS_MAT_ASCII, LS_MAT_BINARY, LS_TEXT, matches_patterns(), name, octave_scalar_map::nfields(), octave_stdout, read_binary_data(), read_hdf5_data(), read_mat5_binary_element(), read_mat_ascii_data(), read_mat_binary_data(), read_text_data(), retval, right, octave_value::rows(), string, load_save_format::type, octave_value::type_name(), and warning().
Referenced by if().
|
static |
Definition at line 907 of file load-save.cc.
References err_unrecognized_data_fmt(), LS_BINARY, LS_HDF5, LS_MAT5_BINARY, LS_MAT7_BINARY, LS_MAT_ASCII, LS_MAT_ASCII_LONG, LS_MAT_ASCII_TABS, LS_MAT_BINARY, LS_TEXT, load_save_format::opts, save_binary_data(), save_hdf5_data(), save_mat5_binary_element(), save_mat_ascii_data(), save_mat_binary_data(), save_text_data(), load_save_format::type, and warning().
Referenced by do_save(), dump_octave_core(), save_fields(), and save_vars().
void do_save | ( | std::ostream & | os, |
const symbol_table::symbol_record & | sr, | ||
load_save_format | fmt, | ||
bool | save_as_floats | ||
) |
Definition at line 954 of file load-save.cc.
References do_save(), octave_value::is_defined(), symbol_table::symbol_record::is_global(), symbol_table::symbol_record::name(), name, string, val, and symbol_table::symbol_record::varval().
|
static |
Definition at line 1314 of file load-save.cc.
References symbol_table::all_variables(), octave_value::byte_size(), do_save(), octave_value::is_defined(), message(), name, p, string, symbol_table::top_scope(), val, vars, Voctave_core_file_limit, and write_header().
Referenced by dump_octave_core(), octave::my_friendly_exit(), octave::sig_hup_handler(), and octave::sig_term_handler().
void dump_octave_core | ( | void | ) |
Definition at line 1355 of file load-save.cc.
References append, hdf5_fstreambase::close(), gzofstream::close(), defined, dump_octave_core(), file, hdf5_fstreambase::file_id, LS_BINARY, LS_HDF5, LS_MAT5_BINARY, LS_MAT7_BINARY, LS_MAT_BINARY, message(), mode, parse_save_options(), save_as_floats, octave::math::trunc(), Voctave_core_file_name, Voctave_core_file_options, and warning().
|
static |
Definition at line 130 of file load-save.cc.
References error().
Referenced by get_file_format(), and if().
Referenced by do_load(), err_file_open(), find_file_to_load(), if(), parse_save_options(), read_binary_file_header(), and save_vars().
std::string find_file_to_load | ( | const std::string & | name, |
const std::string & | orig_name | ||
) |
Definition at line 492 of file load-save.cc.
References octave::sys::file_ops::dir_sep_chars(), error(), octave::sys::base_file_stat::exists(), find_data_file_in_load_path(), fname, fs, octave::sys::base_file_stat::is_reg(), and string.
OCTAVE_EXPORT octave_value_list Fload | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 629 of file load-save.cc.
Referenced by install_load_save_fcns(), and main_window::load_workspace_callback().
for | ( | ) |
Definition at line 656 of file load-save.cc.
References err_disabled_feature(), LS_BINARY, LS_HDF5, LS_MAT5_BINARY, LS_MAT7_BINARY, LS_MAT_ASCII, LS_MAT_BINARY, LS_TEXT, and warning().
OCTAVE_EXPORT octave_value_list Fsave | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 1576 of file load-save.cc.
Referenced by install_load_save_fcns(), and main_window::save_workspace_callback().
|
static |
Definition at line 231 of file load-save.cc.
References err, extract_keyword(), flt_fmt, octave::mach_info::flt_fmt_unknown, imag(), looks_like_mat_ascii_file(), LS_BINARY, LS_MAT5_BINARY, LS_MAT_ASCII, LS_MAT_BINARY, LS_TEXT, LS_UNKNOWN, read_binary_file_header(), read_mat5_binary_file_header(), read_mat_file_header(), retval, string, and swap.
Referenced by get_file_format(), and is_octave_data_file().
|
static |
Definition at line 298 of file load-save.cc.
References check_gzip_magic(), err_file_open(), file, get_file_format(), LS_HDF5, LS_UNKNOWN, and retval.
|
static |
Definition at line 869 of file load-save.cc.
if | ( | argc | , |
1 &&!argv.empty()&&argv.at(0)! | [1][1] = '-' |
||
) |
Definition at line 641 of file load-save.cc.
if | ( | orig_fname | = = "" | ) |
Definition at line 713 of file load-save.cc.
References i, and print_usage().
if | ( | format | = = LS_UNKNOWN | ) |
Definition at line 762 of file load-save.cc.
References do_load(), err_file_open(), and nargout().
else if | ( | format! | = LS_UNKNOWN | ) |
Definition at line 781 of file load-save.cc.
References do_load(), err_file_open(), error(), file, LS_BINARY, LS_MAT5_BINARY, LS_MAT7_BINARY, mode, nargout(), read_binary_file_header(), read_mat5_binary_file_header(), and retval.
|
static |
Definition at line 144 of file load-save.cc.
References symbol_table::assign(), symbol_table::clear(), symbol_table::global_assign(), and symbol_table::mark_global().
Referenced by do_load().
bool is_octave_data_file | ( | const std::string & | fname | ) |
Definition at line 526 of file load-save.cc.
References get_file_format(), LS_UNKNOWN, and use_zlib.
Referenced by files_dock_widget::display_directory().
|
static |
Definition at line 161 of file load-save.cc.
References glob_match::match(), and pattern().
Referenced by do_load().
void octave_finalize_hdf5 | ( | void | ) |
Definition at line 1248 of file load-save.cc.
void octave_prepare_hdf5 | ( | void | ) |
Definition at line 1240 of file load-save.cc.
|
static |
Definition at line 1022 of file load-save.cc.
References string_vector::append(), argc, err_disabled_feature(), error(), LS_BINARY, LS_HDF5, LS_MAT5_BINARY, LS_MAT7_BINARY, LS_MAT_ASCII, LS_MAT_ASCII_LONG, LS_MAT_ASCII_TABS, LS_MAT_BINARY, LS_TEXT, Array< T >::numel(), load_save_format::opts, retval, and warning().
Referenced by dump_octave_core(), and parse_save_options().
|
static |
Definition at line 1140 of file load-save.cc.
References string_vector::append(), argv, is, parse_save_options(), str, and string.
parse_save_options | ( | Vsave_default_options | , |
format | , | ||
append | , | ||
save_as_floats | , | ||
use_zlib | |||
) |
int read_binary_file_header | ( | std::istream & | is, |
bool & | swap, | ||
octave::mach_info::float_format & | flt_fmt, | ||
bool | quiet | ||
) |
Definition at line 176 of file load-save.cc.
References error(), octave::mach_info::flt_fmt_unknown, mopt_digit_to_float_format(), octave::string::strncmp(), tmp, and octave::mach_info::words_big_endian().
Referenced by get_file_format(), and if().
|
static |
Definition at line 973 of file load-save.cc.
References octave_scalar_map::begin(), octave_scalar_map::contents(), do_save(), octave_scalar_map::end(), octave_scalar_map::key(), glob_match::match(), p, save_as_floats, and string.
Referenced by save_vars().
|
static |
Definition at line 1001 of file load-save.cc.
References do_save(), symbol_table::glob(), p, and vars.
Referenced by octave::my_friendly_exit(), and save_vars().
|
static |
Definition at line 1256 of file load-save.cc.
References argc, error(), i, symbol_table::is_variable(), save_fields(), save_vars(), string, symbol_table::varval(), warning(), and write_header().
void write_header | ( | std::ostream & | os, |
load_save_format | format | ||
) |
Definition at line 1157 of file load-save.cc.
References hdf5_fstreambase::file_id, float_format_to_mopt_digit(), LS_BINARY, LS_HDF5, LS_MAT5_BINARY, LS_MAT7_BINARY, LS_TEXT, min(), octave::mach_info::native_float_format(), now, number, OCTAVE_VERSION, octave::sys::base_tm::strftime(), string, tmp, load_save_format::type, Vsave_header_format_string, and octave::mach_info::words_big_endian().
Referenced by dump_octave_core(), and save_vars().
Definition at line 1582 of file load-save.cc.
Referenced by FilterChain::addFilter(), QtHandles::Canvas::annotation_callback(), octave_comment_list::append(), dump_octave_core(), tm_const::init(), octave_push_parse(), octave_tex_parse(), tree_argument_list::tree_argument_list(), tree_array_list::tree_array_list(), tree_decl_init_list::tree_decl_init_list(), tree_if_command_list::tree_if_command_list(), tree_parameter_list::tree_parameter_list(), tree_return_list::tree_return_list(), tree_statement_list::tree_statement_list(), and tree_switch_case_list::tree_switch_case_list().
in the file Octave saves all the variables in the current scope full variable names or pattern syntax can be used to specify the variables to save If the fields ar {file}. If no variables are specified then all variables found in the file will be loaded. As with ode{save} |
Definition at line 629 of file load-save.cc.
int argc = args.length () + 1 |
Definition at line 633 of file load-save.cc.
Referenced by do_who(), Fformat(), main(), parse_save_options(), read_hdf5_data(), and save_vars().
string_vector argv = args.make_argv ("load") |
Definition at line 635 of file load-save.cc.
Referenced by octave::sys::execvp(), Fformat(), octave_value_list::make_argv(), octave_exec(), parse_save_options(), and octave::sys::popen2().
else |
Definition at line 751 of file load-save.cc.
Definition at line 723 of file load-save.cc.
Referenced by octave_base_stream::float_format(), get_file_format(), mopt_digit_to_float_format(), pr_any_float(), read_mat5_binary_element(), read_mat_binary_data(), and save_mat_binary_data().
fname = find_file_to_load (fname, orig_fname) |
Definition at line 754 of file load-save.cc.
Referenced by jit_typeinfo::add_binary_fcmp(), jit_typeinfo::add_binary_icmp(), jit_typeinfo::add_binary_op(), bp_table::add_breakpoint(), symbol_table::fcn_info::fcn_info_rep::add_dispatch(), load_path::loader::add_to_fcn_map(), DEFUN(), load_path::do_files(), do_history(), find_file_to_load(), load_path::loader::find_private_fcn(), find_private_file(), octave::base_parser::frob_function(), G__eigs__(), G__fltk_uigetfile__(), get_fcn_files(), load_path::dir_info::get_file_list(), get_user_code(), Java_org_octave_Octave_call(), mexErrMsgIdAndTxt(), mexIsLocked(), mexLock(), mexUnlock(), mexWarnMsgIdAndTxt(), load_path::loader::move_fcn_map(), octave_push_parse(), raw_help_from_docstrings_file(), octave::sys::dir_entry::read(), read_mat5_binary_element(), bp_table::remove_breakpoint(), load_path::loader::remove_fcn_map(), file_editor_tab::save_file_as(), and symbol_table::fcn_info::fcn_info_rep::xfind().
Definition at line 637 of file load-save.cc.
Referenced by glob_pattern_p(), if(), and save_vars().
Definition at line 1576 of file load-save.cc.
Referenced by octave_istrstream::bad(), octave_istrstream::clear(), octave::textscan::do_scan(), octave_istrstream::eof(), extract_num(), octave_istream::input_stream(), octave_istrstream::input_stream(), octave_float_complex::load_ascii(), octave_complex::load_ascii(), octave_bool::load_ascii(), octave_scalar::load_ascii(), octave_float_scalar::load_ascii(), octave_read_complex(), octave_read_cx_fp_value(), octave_read_double(), octave_read_float(), octave_read_float_complex(), octave_read_fp_value(), octave_read_value(), octave_scan(), octave_scan_1(), operator>>(), parse_range_spec(), parse_save_options(), octave_istrstream::rdbuf(), read_hdf5_data(), read_sparse_matrix(), octave::curl_transfer::set_istream(), str2double1(), and octave_istrstream::tell().
Definition at line 653 of file load-save.cc.
std::string orig_fname = "" |
Definition at line 638 of file load-save.cc.
in the file Octave saves all the variables in the current scope Otherwise |
Definition at line 1576 of file load-save.cc.
ots {} |
Definition at line 629 of file load-save.cc.
in the file Octave saves all the variables in the current scope full variable names or pattern syntax can be used to specify the variables to save If the ption {-struct} modifier is used |
Definition at line 1576 of file load-save.cc.
return retval |
Definition at line 863 of file load-save.cc.
Referenced by check_gzip_magic(), do_load(), get_file_format(), if(), and parse_save_options().
Definition at line 1581 of file load-save.cc.
Referenced by dump_octave_core(), octave_fcn_handle::save_binary(), octave_class::save_binary(), save_fields(), octave_fcn_handle::save_hdf5(), octave_cell::save_hdf5(), octave_class::save_hdf5(), and save_mat5_element_length().
Definition at line 725 of file load-save.cc.
Referenced by octave_sort< T >::binarysort(), axes::properties::calc_ticks_and_lims(), convert_data(), dmsolve_extract(), octave::opengl_renderer::draw_axes_boxes(), extended_gcd(), RowVector::extract(), ColumnVector::extract(), FloatRowVector::extract(), FloatColumnVector::extract(), DiagMatrix::extract(), charMatrix::extract(), FloatDiagMatrix::extract(), ComplexRowVector::extract(), ComplexColumnVector::extract(), FloatComplexRowVector::extract(), FloatComplexColumnVector::extract(), ComplexDiagMatrix::extract(), FloatComplexDiagMatrix::extract(), Matrix::extract(), FloatMatrix::extract(), ComplexMatrix::extract(), FloatComplexMatrix::extract(), RowVector::fill(), ColumnVector::fill(), FloatRowVector::fill(), FloatColumnVector::fill(), ComplexRowVector::fill(), ComplexColumnVector::fill(), FloatComplexRowVector::fill(), FloatComplexColumnVector::fill(), Matrix::fill(), FloatMatrix::fill(), ComplexMatrix::fill(), FloatComplexMatrix::fill(), get_file_format(), Gsymrcm(), H_heapify_min(), H_insert(), octave_sparse_complex_matrix::load_binary(), octave_float_complex_matrix::load_binary(), octave_complex_matrix::load_binary(), octave_float_matrix::load_binary(), octave_matrix::load_binary(), mk_tmp_hist_file(), octave_sort< T >::nth_element(), octave_jit_paren_subsasgn_matrix_range(), octave::math::aepbalance< MT >::permuting_vector(), read_mat5_binary_element(), read_mat_binary_data(), simple_gcd(), Range::sort_internal(), octave::ft_text_renderer::text_to_pixels(), axes::properties::update_axes_layout(), figure::properties::update_paperorientation(), figure::properties::update_papersize(), figure::properties::update_papertype(), and figure::properties::update_paperunits().
Definition at line 756 of file load-save.cc.
Referenced by is_octave_data_file().
|
static |
Definition at line 95 of file load-save.cc.
Definition at line 654 of file load-save.cc.
Referenced by do_who(), octave_call_stack::goto_frame(), and octave_call_stack::goto_frame_relative().
|
static |
Definition at line 99 of file load-save.cc.
Referenced by dump_octave_core().
|
static |
Definition at line 102 of file load-save.cc.
Referenced by dump_octave_core().
|
static |
Definition at line 109 of file load-save.cc.
Referenced by dump_octave_core().
|
static |
Definition at line 106 of file load-save.cc.
|
static |
Definition at line 126 of file load-save.cc.
Referenced by write_header().