25 #if defined (HAVE_CONFIG_H)
85 if (next_only && ch !=
'%' && ch !=
'#')
91 if (c ==
'%' || c ==
'#')
93 std::ostringstream buf;
95 while (is.get (c) && (c ==
' ' || c ==
'\t' || c ==
'%' || c ==
'#'))
101 while (is.get (c) && isalpha (c))
105 bool match = (tmp.substr (0,
strlen (keyword)) == keyword);
109 std::ostringstream
value;
110 while (is.get (c) && (c ==
' ' || c ==
'\t' || c ==
':'))
124 int len = retval.length ();
132 if (c ==
' ' || c ==
'\t')
233 #define SUBSTRING_COMPARE_EQ(s, pos, n, t) (s.substr (pos, n) == t)
246 error (
"load: empty name keyword or no data found in file '%s'",
252 if (! (name ==
".nargin." || name ==
".nargout."
254 error (
"load: invalid identifier '%s' found in file '%s'",
255 name.c_str (), filename.c_str ());
262 error (
"load: failed to extract keyword specifying value type");
265 size_t pos = tag.rfind (
' ');
267 if (pos != std::string::npos)
271 typ = global ? tag.substr (7) : tag;
283 error (
"load: trouble reading ascii file '%s'", filename.c_str ());
307 os <<
"# name: " << name <<
"\n";
312 os <<
"# type: global " << val.
type_name () <<
"\n";
314 os <<
"# type: " << val.
type_name () <<
"\n";
319 long old_precision = os.precision ();
320 os.precision (precision);
330 os.precision (old_precision);
332 return (os && success);
357 error (
"for now, I can only save real matrices in 3-D format");
359 os <<
"# 3-D data...\n"
360 <<
"# type: matrix\n"
361 <<
"# total rows: " << nr <<
"\n"
362 <<
"# total columns: " << nc <<
"\n";
364 long old_precision = os.precision ();
371 warning (
"ignoring last %d columns", extras);
396 os.precision (old_precision);
398 return (os && ! fail);
std::string read_until_newline(std::istream &is, bool keep_newline)
#define SET_INTERNAL_VARIABLE_WITH_LIMITS(NM, MINVAL, MAXVAL)
bool save_text_data_for_plotting(std::ostream &os, const octave_value &t, const std::string &name)
octave_idx_type rows(void) const
Matrix extract(octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const
identity matrix If supplied two scalar respectively For allows like xample val
void skip_until_newline(std::istream &is, bool keep_newline)
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
static int Vsave_precision
octave_idx_type rows(void) const
#define SUBSTRING_COMPARE_EQ(s, pos, n, t)
static octave_value lookup_type(const std::string &nm)
octave_idx_type columns(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
bool save_text_data(std::ostream &os, const octave_value &val_arg, const std::string &name, bool mark_as_global, int precision)
bool valid_identifier(const char *s)
std::string extract_keyword(std::istream &is, const char *keyword, const bool next_only)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
T::size_type strlen(const typename T::value_type *str)
Matrix matrix_value(bool frc_str_conv=false) const
bool save_ascii(std::ostream &os)
void warning(const char *fmt,...)
std::string type_name(void) const
charNDArray max(char d, const charNDArray &m)
bool load_ascii(std::istream &is)
=val(i)}if ode{val(i)}occurs in table i
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol zero divided by nd tex zero divided by nd ifnottex and any operation involving another NaN value(5+NaN).Note that NaN always compares not equal to NaN(NaN!
std::string read_text_data(std::istream &is, const std::string &filename, bool &global, octave_value &tc, octave_idx_type count)
bool save_three_d(std::ostream &os, const octave_value &tc, bool parametric)
write the output to stdout if nargout is
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
bool is_real_matrix(void) const