Mercurial > hg > octave-nkf
changeset 20071:17d647821d61
maint: More cleanup of C++ code to follow Octave coding conventions.
* gl-select.cc, betainc.cc, bitfcns.cc, bsxfun.cc, gl-render.cc,
graphics.cc, load-save.cc, ls-mat-ascii.cc, ls-mat5.cc, lu.cc,
oct-stream.cc, symtab.cc, variables.cc, __eigs__.cc,
__magick_read__.cc, chol.cc, ov-base-sparse.cc, ov-class.cc,
ov-classdef.cc, ov-fcn-inline.cc, ov-perm.cc, ov.cc, CMatrix.cc,
CSparse.cc, MSparse.cc, MatrixType.cc, MatrixType.h, dMatrix.cc,
dSparse.cc, fCMatrix.cc, fMatrix.cc, eigs-base.cc, lo-sysdep.cc,
kpse.cc: Break long lines before && and ||.
line wrap: on
line diff
--- a/libgui/graphics/gl-select.cc +++ b/libgui/graphics/gl-select.cc @@ -92,8 +92,8 @@ minZ = select_buffer[j++]; j++; // skip maxZ - if (((flags & select_last) == 0 && (minZ <= current_minZ)) || - ((flags & select_last) != 0 && (minZ >= current_minZ))) + if (((flags & select_last) == 0 && (minZ <= current_minZ)) + || ((flags & select_last) != 0 && (minZ >= current_minZ))) { bool candidate = true; GLuint name =
--- a/libinterp/corefcn/betainc.cc +++ b/libinterp/corefcn/betainc.cc @@ -74,8 +74,8 @@ octave_value b_arg = args(2); // FIXME: Can we make a template version of the duplicated code below - if (x_arg.is_single_type () || a_arg.is_single_type () || - b_arg.is_single_type ()) + if (x_arg.is_single_type () || a_arg.is_single_type () + || b_arg.is_single_type ()) { if (x_arg.is_scalar_type ()) { @@ -451,8 +451,8 @@ // accepted float inputs and returned float outputs. As it is, we do // extra work to calculate betaincinv to double precision and then throw // that precision away. - if (x_arg.is_single_type () || a_arg.is_single_type () || - b_arg.is_single_type ()) + if (x_arg.is_single_type () || a_arg.is_single_type () + || b_arg.is_single_type ()) { retval = Array<float> (retval.array_value ()); }
--- a/libinterp/corefcn/bitfcns.cc +++ b/libinterp/corefcn/bitfcns.cc @@ -131,6 +131,26 @@ return bitopxx (std::bit_xor<T>(), fname, x, y); } +static inline int +bitop_arg_is_int (const octave_value& arg) +{ + return (arg.class_name () != octave_scalar::static_class_name () + && arg.class_name () != octave_float_scalar::static_class_name () + && arg.class_name () != octave_bool::static_class_name ()); +} + +static inline int +bitop_arg_is_bool (const octave_value& arg) +{ + return arg.class_name () == octave_bool::static_class_name (); +} + +static inline int +bitop_arg_is_float (const octave_value& arg) +{ + return arg.class_name () == octave_float_scalar::static_class_name (); +} + octave_value bitop (const std::string& fname, const octave_value_list& args) { @@ -140,33 +160,21 @@ if (nargin == 2) { - if ((args(0).class_name () == octave_scalar::static_class_name ()) - || (args(0).class_name () == octave_float_scalar::static_class_name ()) - || (args(0).class_name () == octave_bool::static_class_name ()) - || (args(1).class_name () == octave_scalar::static_class_name ()) - || (args(1).class_name () == octave_float_scalar::static_class_name ()) - || (args(1).class_name () == octave_bool::static_class_name ())) + if (args(0).class_name () == octave_scalar::static_class_name () + || args(0).class_name () == octave_float_scalar::static_class_name () + || args(0).class_name () == octave_bool::static_class_name () + || args(1).class_name () == octave_scalar::static_class_name () + || args(1).class_name () == octave_float_scalar::static_class_name () + || args(1).class_name () == octave_bool::static_class_name ()) { - bool arg0_is_int = (args(0).class_name () != - octave_scalar::static_class_name () && - args(0).class_name () != - octave_float_scalar::static_class_name () && - args(0).class_name () != - octave_bool::static_class_name ()); - bool arg1_is_int = (args(1).class_name () != - octave_scalar::static_class_name () && - args(1).class_name () != - octave_float_scalar::static_class_name () && - args(1).class_name () != - octave_bool::static_class_name ()); - bool arg0_is_bool = args(0).class_name () == - octave_bool::static_class_name (); - bool arg1_is_bool = args(1).class_name () == - octave_bool::static_class_name (); - bool arg0_is_float = args(0).class_name () == - octave_float_scalar::static_class_name (); - bool arg1_is_float = args(1).class_name () == - octave_float_scalar::static_class_name (); + bool arg0_is_int = bitop_arg_is_int (args(0)); + bool arg1_is_int = bitop_arg_is_int (args(1)); + + bool arg0_is_bool = bitop_arg_is_bool (args(0)); + bool arg1_is_bool = bitop_arg_is_bool (args(1)); + + bool arg0_is_float = bitop_arg_is_float (args(0)); + bool arg1_is_float = bitop_arg_is_float (args(1)); if (! (arg0_is_int || arg1_is_int)) {
--- a/libinterp/corefcn/bsxfun.cc +++ b/libinterp/corefcn/bsxfun.cc @@ -536,8 +536,8 @@ { update_index (ra_idx, dvc, i); - if (have_FloatNDArray || - have_FloatComplexNDArray) + if (have_FloatNDArray + || have_FloatComplexNDArray) { if (! tmp(0).is_float_type ()) { @@ -555,8 +555,8 @@ } else if (tmp(0).is_double_type ()) { - if (tmp(0).is_complex_type () && - have_FloatNDArray) + if (tmp(0).is_complex_type () + && have_FloatNDArray) { result_ComplexNDArray = ComplexNDArray (result_FloatNDArray);
--- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -1575,9 +1575,9 @@ set_clipping (false); - if (! props.marker_is ("none") && - ! (props.markeredgecolor_is ("none") - && props.markerfacecolor_is ("none"))) + if (! props.marker_is ("none") + && ! (props.markeredgecolor_is ("none") + && props.markerfacecolor_is ("none"))) { Matrix lc, fc; @@ -2136,9 +2136,9 @@ } } - if (! props.marker_is ("none") && - ! (props.markeredgecolor_is ("none") - && props.markerfacecolor_is ("none"))) + if (! props.marker_is ("none") + && ! (props.markeredgecolor_is ("none") + && props.markerfacecolor_is ("none"))) { // FIXME: check how transparency should be handled in markers // FIXME: check what to do with marker facecolor set to auto
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -2806,9 +2806,9 @@ std::string pname = it->first; // Don't reset internal properties and handle_properties - if (! obj.has_readonly_property (pname) && - pname.find ("__") != 0 && pname.find ("current") != 0 && - pname != "uicontextmenu" && pname != "parent") + if (! obj.has_readonly_property (pname) + && pname.find ("__") != 0 && pname.find ("current") != 0 + && pname != "uicontextmenu" && pname != "parent") { // Store *mode prop/val in order to set them last if (pname.find ("mode") == (pname.length () - 4)) @@ -3222,8 +3222,8 @@ for (octave_map::const_iterator pa = m.begin (); pa != m.end (); pa++) { - if (pa->first != "children" && - ! obj.has_readonly_property (pa->first)) + if (pa->first != "children" + && ! obj.has_readonly_property (pa->first)) { property p = get_properties ().get_property (pa->first); @@ -7375,10 +7375,10 @@ void axes::update_axis_limits (const std::string& axis_type) { - if ((updating_axis_limits.find (get_handle ().value ()) != - updating_axis_limits.end ()) || - (updating_aspectratios.find (get_handle ().value ()) != - updating_aspectratios.end ())) + if ((updating_axis_limits.find (get_handle ().value ()) + != updating_axis_limits.end ()) + || (updating_aspectratios.find (get_handle ().value ()) + != updating_aspectratios.end ())) return; Matrix kids = xproperties.get_children (); @@ -8082,16 +8082,16 @@ #endif - if (autopos_tag_is ("xlabel") || autopos_tag_is ("ylabel") || - autopos_tag_is ("zlabel") || autopos_tag_is ("title")) + if (autopos_tag_is ("xlabel") || autopos_tag_is ("ylabel") + || autopos_tag_is ("zlabel") || autopos_tag_is ("title")) update_autopos ("sync"); } void text::properties::request_autopos (void) { - if (autopos_tag_is ("xlabel") || autopos_tag_is ("ylabel") || - autopos_tag_is ("zlabel") || autopos_tag_is ("title")) + if (autopos_tag_is ("xlabel") || autopos_tag_is ("ylabel") + || autopos_tag_is ("zlabel") || autopos_tag_is ("title")) update_autopos (get_autopos_tag ()); } @@ -8176,8 +8176,8 @@ NDArray cd = get_cdata ().array_value (); bad_data_msg = std::string (); - if (xd.dims () != yd.dims () || - (xd.dims () != zd.dims () && ! zd.is_empty ())) + if (xd.dims () != yd.dims () + || (xd.dims () != zd.dims () && ! zd.is_empty ())) { bad_data_msg = "x/y/zdata should have the same dimensions"; return; @@ -11234,8 +11234,8 @@ POSTSET); else { - if (args(2).is_string () && - args(2).string_value () == "persistent") + if (args(2).is_string () + && args(2).string_value () == "persistent") { go.delete_property_listener (pname, octave_value (), PERSISTENT);
--- a/libinterp/corefcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -215,8 +215,8 @@ std::ifstream file (fname.c_str ()); OCTAVE_LOCAL_BUFFER (unsigned char, magic, 2); - if (file.read (reinterpret_cast<char *> (magic), 2) && magic[0] == 0x1f && - magic[1] == 0x8b) + if (file.read (reinterpret_cast<char *> (magic), 2) && magic[0] == 0x1f + && magic[1] == 0x8b) retval = true; file.close (); @@ -1713,8 +1713,8 @@ return retval; } - bool write_header_info = ! (append && - H5Fis_hdf5 (fname.c_str ()) > 0); + bool write_header_info + = ! (append && H5Fis_hdf5 (fname.c_str ()) > 0); hdf5_ofstream hdf5_file (fname.c_str (), mode);
--- a/libinterp/corefcn/ls-mat-ascii.cc +++ b/libinterp/corefcn/ls-mat-ascii.cc @@ -172,8 +172,8 @@ beg = buf.find_first_not_of (", \t", end); - if (beg == std::string::npos || (buf[beg] == '\r' && - beg == buf.length () - 1)) + if (beg == std::string::npos + || (buf[beg] == '\r' && beg == buf.length () - 1)) { // We had a line with trailing spaces and // ending with a CRLF, so this should look like EOL,
--- a/libinterp/corefcn/ls-mat5.cc +++ b/libinterp/corefcn/ls-mat5.cc @@ -632,8 +632,8 @@ // array flags subelement int32_t len; - if (read_mat5_tag (is, swap, type, len, is_small_data_element) || - type != miUINT32 || len != 8 || is_small_data_element) + if (read_mat5_tag (is, swap, type, len, is_small_data_element) + || type != miUINT32 || len != 8 || is_small_data_element) { error ("load: invalid array flags subelement"); goto early_read_error; @@ -659,8 +659,8 @@ { int32_t dim_len; - if (read_mat5_tag (is, swap, type, dim_len, is_small_data_element) || - type != miINT32) + if (read_mat5_tag (is, swap, type, dim_len, is_small_data_element) + || type != miINT32) { error ("load: invalid dimensions array subelement"); goto early_read_error; @@ -695,7 +695,8 @@ dims(1) = 1; } - if (read_mat5_tag (is, swap, type, len, is_small_data_element) || !INT8(type)) + if (read_mat5_tag (is, swap, type, len, is_small_data_element) + || ! INT8(type)) { error ("load: invalid array name subelement"); goto early_read_error; @@ -914,9 +915,9 @@ std::string mroot = m0.contents ("matlabroot").string_value (); - if ((fpath.length () >= mroot.length ()) && - fpath.substr (0, mroot.length ()) == mroot && - OCTAVE_EXEC_PREFIX != mroot) + if ((fpath.length () >= mroot.length ()) + && fpath.substr (0, mroot.length ()) == mroot + && OCTAVE_EXEC_PREFIX != mroot) { // If fpath starts with matlabroot, and matlabroot // doesn't equal octave_config_info ("exec_prefix") @@ -1097,7 +1098,7 @@ int32_t fn_type; int32_t fn_len; if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) - || !INT8(fn_type)) + || ! INT8(fn_type)) { error ("load: invalid field name subelement"); goto data_read_error; @@ -1158,8 +1159,8 @@ { isclass = true; - if (read_mat5_tag (is, swap, type, len, is_small_data_element) || - !INT8(type)) + if (read_mat5_tag (is, swap, type, len, is_small_data_element) + || ! INT8(type)) { error ("load: invalid class name"); goto skip_ahead; @@ -1211,7 +1212,7 @@ // field name subelement. The length of this subelement tells // us how many fields there are. if (read_mat5_tag (is, swap, fn_type, fn_len, is_small_data_element) - || !INT8(fn_type)) + || ! INT8(fn_type)) { error ("load: invalid field name subelement"); goto data_read_error;
--- a/libinterp/corefcn/lu.cc +++ b/libinterp/corefcn/lu.cc @@ -593,8 +593,8 @@ octave_idx_type k = u.rows (); octave_idx_type n = u.columns (); return ((l.ndims () == 2 && u.ndims () == 2 && k == l.columns ()) - && k == std::min (m, n) && - (p.is_undefined () || p.rows () == m)); + && k == std::min (m, n) + && (p.is_undefined () || p.rows () == m)); } DEFUN (luupdate, args, ,
--- a/libinterp/corefcn/oct-stream.cc +++ b/libinterp/corefcn/oct-stream.cc @@ -4226,15 +4226,18 @@ if ((stream_number = os.file_number ()) == -1) return stream_number; - // Should we test for "(list.find (stream_number) != list.end ()) && - // list[stream_number].is_open ()" and respond with "error - // ("internal error: ...")"? It should not happen except for some - // bug or if the user has opened a stream with an interpreted - // command, but closed it directly with a system call in an - // oct-file; then the kernel knows the fd is free, but Octave does - // not know. If it happens, it should not do harm here to simply - // overwrite this entry, although the wrong entry might have done - // harm before. + // Should we test for + // + // (list.find (stream_number) != list.end () + // && list[stream_number].is_open ()) + // + // and respond with "error ("internal error: ...")"? It should not + // happen except for some bug or if the user has opened a stream with + // an interpreted command, but closed it directly with a system call + // in an oct-file; then the kernel knows the fd is free, but Octave + // does not know. If it happens, it should not do harm here to simply + // overwrite this entry, although the wrong entry might have done harm + // before. if (list.size () < list.max_size ()) list[stream_number] = os;
--- a/libinterp/corefcn/symtab.cc +++ b/libinterp/corefcn/symtab.cc @@ -244,10 +244,12 @@ { int nm_len = nm.length (); - if (octave_env::absolute_pathname (nm) && - ((nm_len > 4 && (nm.substr (nm_len-4) == ".oct" - || nm.substr (nm_len-4) == ".mex")) - || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))) + if (octave_env::absolute_pathname (nm) + && ((nm_len > 4 + && (nm.substr (nm_len-4) == ".oct" + || nm.substr (nm_len-4) == ".mex")) + || (nm_len > 2 + && nm.substr (nm_len-2) == ".m"))) file = nm; else {
--- a/libinterp/corefcn/variables.cc +++ b/libinterp/corefcn/variables.cc @@ -280,8 +280,8 @@ frame.run (); - if (tmp.is_defined () && - (tmp.is_map () || tmp.is_java () || tmp.is_classdef_object ())) + if (tmp.is_defined () + && (tmp.is_map () || tmp.is_java () || tmp.is_classdef_object ())) names = tmp.map_keys (); } }
--- a/libinterp/dldfcn/__eigs__.cc +++ b/libinterp/dldfcn/__eigs__.cc @@ -270,8 +270,8 @@ // Note hold off reading B till later to avoid issues of double // copies of the matrix if B is full/real while A is complex. - if (!error_state && nargin > 1 + arg_offset && - !(args(1 + arg_offset).is_real_scalar ())) + if (! error_state && nargin > 1 + arg_offset + && ! (args(1 + arg_offset).is_real_scalar ())) { if (args(1+arg_offset).is_complex_type ()) {
--- a/libinterp/dldfcn/__magick_read__.cc +++ b/libinterp/dldfcn/__magick_read__.cc @@ -800,8 +800,8 @@ const octave_idx_type n = frameidx.nelem (); for (octave_idx_type frame = 0; frame < n; frame++) { - if (nRows != imvec[frameidx(frame)].rows () || - nCols != imvec[frameidx(frame)].columns ()) + if (nRows != imvec[frameidx(frame)].rows () + || nCols != imvec[frameidx(frame)].columns ()) { error ("imread: all frames must have the same size but frame %i is different", frameidx(frame) +1);
--- a/libinterp/dldfcn/chol.cc +++ b/libinterp/dldfcn/chol.cc @@ -1271,8 +1271,8 @@ if (j > 0 && j <= n+1 && i > 0 && i <= n+1) { - if (argr.is_single_type () && argi.is_single_type () && - argj.is_single_type ()) + if (argr.is_single_type () && argi.is_single_type () + && argj.is_single_type ()) { if (argr.is_real_type ()) {
--- a/libinterp/octave-value/ov-base-sparse.cc +++ b/libinterp/octave-value/ov-base-sparse.cc @@ -411,9 +411,9 @@ octave_idx_type nc = 0; bool success = true; - if (extract_keyword (is, "nnz", nz, true) && - extract_keyword (is, "rows", nr, true) && - extract_keyword (is, "columns", nc, true)) + if (extract_keyword (is, "nnz", nz, true) + && extract_keyword (is, "rows", nr, true) + && extract_keyword (is, "columns", nc, true)) { T tmp (nr, nc, nz);
--- a/libinterp/octave-value/ov-class.cc +++ b/libinterp/octave-value/ov-class.cc @@ -1997,10 +1997,10 @@ for (octave_idx_type idx = 0; idx < n; idx++) { const std::string cl = cls(idx); - if ((cl == "float" && obj.is_float_type ()) || - (cl == "integer" && obj.is_integer_type ()) || - (cl == "numeric" && obj.is_numeric_type ()) || - obj.class_name () == cl || obj.is_instance_of (cl)) + if ((cl == "float" && obj.is_float_type ()) + || (cl == "integer" && obj.is_integer_type ()) + || (cl == "numeric" && obj.is_numeric_type ()) + || obj.class_name () == cl || obj.is_instance_of (cl)) matches(idx) = true; } return octave_value (matches);
--- a/libinterp/octave-value/ov-classdef.cc +++ b/libinterp/octave-value/ov-classdef.cc @@ -280,12 +280,11 @@ in_constructor = false; - if (fcn && - (fcn->is_class_method () - || fcn->is_classdef_constructor () - || fcn->is_anonymous_function_of_class () - || (fcn->is_private_function () - && ! fcn->dispatch_class ().empty ()))) + if (fcn && (fcn->is_class_method () + || fcn->is_classdef_constructor () + || fcn->is_anonymous_function_of_class () + || (fcn->is_private_function () + && ! fcn->dispatch_class ().empty ()))) { cls = lookup_class (fcn->dispatch_class ()); if (! error_state) @@ -3626,8 +3625,8 @@ // "end" that makes it impossible to execute the // function call at this stage. - if (type.size () > 1 && - ! fcn->is_postfix_index_handled (type[1])) + if (type.size () > 1 + && ! fcn->is_postfix_index_handled (type[1])) { octave_value_list tmp_args;
--- a/libinterp/octave-value/ov-fcn-inline.cc +++ b/libinterp/octave-value/ov-fcn-inline.cc @@ -759,11 +759,11 @@ break; } - if (! have_arg && tmp_arg != "i" && tmp_arg != "j" && - tmp_arg != "NaN" && tmp_arg != "nan" && - tmp_arg != "Inf" && tmp_arg != "inf" && - tmp_arg != "NA" && tmp_arg != "pi" && - tmp_arg != "e" && tmp_arg != "eps") + if (! have_arg && tmp_arg != "i" && tmp_arg != "j" + && tmp_arg != "NaN" && tmp_arg != "nan" + && tmp_arg != "Inf" && tmp_arg != "inf" + && tmp_arg != "NA" && tmp_arg != "pi" + && tmp_arg != "e" && tmp_arg != "eps") fargs.append (tmp_arg); tmp_arg = std::string ();
--- a/libinterp/octave-value/ov-perm.cc +++ b/libinterp/octave-value/ov-perm.cc @@ -112,11 +112,8 @@ // if error_state is set, we've already griped. if (! error_state && ! retval.is_defined ()) { - if (nidx == 2 && ! resize_ok && - idx0.is_scalar () && idx1.is_scalar ()) - { - retval = matrix.checkelem (idx0(0), idx1(0)); - } + if (nidx == 2 && ! resize_ok && idx0.is_scalar () && idx1.is_scalar ()) + retval = matrix.checkelem (idx0(0), idx1(0)); else retval = to_dense ().do_index_op (idx, resize_ok); }
--- a/libinterp/octave-value/ov.cc +++ b/libinterp/octave-value/ov.cc @@ -2036,8 +2036,9 @@ v2.numeric_conversion_function (); // Try biased (one-sided) conversions first. - if (cf2.type_id () >= 0 && - octave_value_typeinfo::lookup_binary_op (op, t1, cf2.type_id ())) + if (cf2.type_id () >= 0 + && octave_value_typeinfo::lookup_binary_op (op, t1, + cf2.type_id ())) cf1 = 0; else if (cf1.type_id () >= 0 && octave_value_typeinfo::lookup_binary_op (op, @@ -2097,10 +2098,10 @@ && octave_value_typeinfo::lookup_binary_op (op, t1, cf2.type_id ())) cf1 = 0; - else if (cf1.type_id () >= 0 && - octave_value_typeinfo::lookup_binary_op (op, - cf1.type_id (), - t2)) + else if (cf1.type_id () >= 0 + && octave_value_typeinfo::lookup_binary_op (op, + cf1.type_id (), + t2)) cf2 = 0; if (cf1)
--- a/liboctave/array/CMatrix.cc +++ b/liboctave/array/CMatrix.cc @@ -1938,8 +1938,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { octave_idx_type b_nc = b.cols (); rcon = 1.; @@ -2034,8 +2033,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { octave_idx_type b_nc = b.cols (); rcon = 1.;
--- a/liboctave/array/CSparse.cc +++ b/liboctave/array/CSparse.cc @@ -772,8 +772,7 @@ int typ = mattyp.type (); mattyp.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { if (typ == MatrixType::Permuted_Diagonal) retval = transpose (); @@ -827,8 +826,8 @@ int typ = mattyp.type (); mattyp.info (); - if (typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper || - typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower) + if (typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper + || typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -902,8 +901,8 @@ colXp++; colUp++; } - } while ((rpX<j) && (rpU<j) && - (colXp<cx) && (colUp<nz)); + } + while (rpX < j && rpU < j && colXp < cx && colUp < nz); // get A(m,m) @@ -1313,8 +1312,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { retval.resize (nc, b.cols (), Complex (0.,0.)); if (typ == MatrixType::Diagonal) @@ -1375,8 +1373,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { octave_idx_type b_nc = b.cols (); octave_idx_type b_nz = b.nnz (); @@ -1467,8 +1464,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { retval.resize (nc, b.cols (), Complex (0.,0.)); if (typ == MatrixType::Diagonal) @@ -1529,8 +1525,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { octave_idx_type b_nc = b.cols (); octave_idx_type b_nz = b.nnz (); @@ -1621,8 +1616,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -1661,8 +1655,8 @@ if (work[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -1737,8 +1731,8 @@ { if (work[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -1853,8 +1847,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -1902,8 +1895,8 @@ if (work[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -1999,8 +1992,8 @@ { if (work[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2136,8 +2129,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -2176,8 +2168,8 @@ if (work[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2252,8 +2244,8 @@ { if (work[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2368,8 +2360,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -2417,8 +2408,8 @@ if (work[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2514,8 +2505,8 @@ { if (work[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2652,8 +2643,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -2789,8 +2779,7 @@ { if (work[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -2905,8 +2894,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -3069,8 +3057,7 @@ { if (work[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -3208,8 +3195,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -3347,8 +3333,7 @@ { if (work[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -3464,8 +3449,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -3628,8 +3612,7 @@ { if (work[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -3920,8 +3903,8 @@ mattype.info (); // Note can't treat symmetric case as there is no dpttrf function - if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) { OCTAVE_LOCAL_BUFFER (Complex, DU2, nr - 2); OCTAVE_LOCAL_BUFFER (Complex, DU, nr - 1); @@ -4217,8 +4200,8 @@ mattype.info (); // Note can't treat symmetric case as there is no dpttrf function - if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) { OCTAVE_LOCAL_BUFFER (Complex, DU2, nr - 2); OCTAVE_LOCAL_BUFFER (Complex, DU, nr - 1); @@ -5540,8 +5523,8 @@ rcond = 1.; volatile double rcond_plus_one = rcond + 1.0; - if (status == UMFPACK_WARNING_singular_matrix || - rcond_plus_one == 1.0 || xisnan (rcond)) + if (status == UMFPACK_WARNING_singular_matrix + || rcond_plus_one == 1.0 || xisnan (rcond)) { UMFPACK_ZNAME (report_numeric) (Numeric, control); @@ -6579,8 +6562,8 @@ rcond = Info (UMFPACK_RCOND); volatile double rcond_plus_one = rcond + 1.0; - if (status == UMFPACK_WARNING_singular_matrix || - rcond_plus_one == 1.0 || xisnan (rcond)) + if (status == UMFPACK_WARNING_singular_matrix + || rcond_plus_one == 1.0 || xisnan (rcond)) { err = -2; @@ -6651,8 +6634,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -6719,8 +6702,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -6787,8 +6770,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -6856,8 +6839,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -7645,8 +7628,7 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { Complex tmp = xmin (a.data (ja), 0.); if (tmp != 0.) @@ -7658,8 +7640,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { Complex tmp = xmin (0., b.data (jb)); if (tmp != 0.) @@ -7763,8 +7745,7 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { Complex tmp = xmax (a.data (ja), 0.); if (tmp != 0.) @@ -7776,8 +7757,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { Complex tmp = xmax (0., b.data (jb)); if (tmp != 0.)
--- a/liboctave/array/MSparse.cc +++ b/liboctave/array/MSparse.cc @@ -71,8 +71,7 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { r.ridx (jx) = a.ridx (ja); r.data (jx) = op (a.data (ja), 0.); @@ -80,8 +79,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { r.ridx (jx) = b.ridx (jb); r.data (jx) = op (0., b.data (jb)); @@ -343,8 +342,7 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { r.ridx (jx) = a.ridx (ja); r.data (jx) = op (a.data (ja), 0.); @@ -352,8 +350,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { r.ridx (jx) = b.ridx (jb); r.data (jx) = op (0., b.data (jb)); @@ -465,13 +463,12 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { jb++; jb_lt_max= jb < jb_max; } @@ -584,14 +581,13 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { r.elem (a.ridx (ja),i) = a.data (ja) / Zero; ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { r.elem (b.ridx (jb),i) = Zero / b.data (jb); jb++; jb_lt_max= jb < jb_max;
--- a/liboctave/array/MatrixType.cc +++ b/liboctave/array/MatrixType.cc @@ -278,8 +278,8 @@ for (octave_idx_type j = i; j < nm; j++) { - if ((a.cidx (j+1) > a.cidx (j) + 1) || - ((a.cidx (j+1) == a.cidx (j) + 1) && found[a.ridx (j)])) + if ((a.cidx (j+1) > a.cidx (j) + 1) + || ((a.cidx (j+1) == a.cidx (j) + 1) && found[a.ridx (j)])) { tmp_typ = MatrixType::Full; break; @@ -382,8 +382,8 @@ for (octave_idx_type j = 0; j < ncols; j++) { - if ((a.cidx (j+1) - a.cidx (j)) > 0 && - (a.ridx (a.cidx (j+1)-1) == i)) + if ((a.cidx (j+1) - a.cidx (j)) > 0 + && (a.ridx (a.cidx (j+1)-1) == i)) { perm[i] = j; found = true; @@ -474,12 +474,12 @@ // problems as being detected, and force to treat as singular // as this seems to cause issues. if (((typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower) - && nrows > ncols) || - ((typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper) - && nrows < ncols)) + && nrows > ncols) + || ((typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper) + && nrows < ncols)) { - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Permuted_Lower) + if (typ == MatrixType::Permuted_Upper + || typ == MatrixType::Permuted_Lower) delete [] perm; nperm = 0; typ = MatrixType::Rectangular; @@ -488,9 +488,9 @@ if (typ == MatrixType::Full && ncols != nrows) typ = MatrixType::Rectangular; - if (maybe_hermitian && (typ == MatrixType::Full || - typ == MatrixType::Tridiagonal || - typ == MatrixType::Banded)) + if (maybe_hermitian && (typ == MatrixType::Full + || typ == MatrixType::Tridiagonal + || typ == MatrixType::Banded)) { bool is_herm = true; @@ -596,8 +596,8 @@ for (octave_idx_type j = i; j < nm; j++) { - if ((a.cidx (j+1) > a.cidx (j) + 1) || - ((a.cidx (j+1) == a.cidx (j) + 1) && found[a.ridx (j)])) + if ((a.cidx (j+1) > a.cidx (j) + 1) + || ((a.cidx (j+1) == a.cidx (j) + 1) && found[a.ridx (j)])) { tmp_typ = MatrixType::Full; break; @@ -700,8 +700,8 @@ for (octave_idx_type j = 0; j < ncols; j++) { - if ((a.cidx (j+1) - a.cidx (j)) > 0 && - (a.ridx (a.cidx (j+1)-1) == i)) + if ((a.cidx (j+1) - a.cidx (j)) > 0 + && (a.ridx (a.cidx (j+1)-1) == i)) { perm[i] = j; found = true; @@ -792,12 +792,12 @@ // problems as being detected, and force to treat as singular // as this seems to cause issues. if (((typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower) - && nrows > ncols) || - ((typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper) - && nrows < ncols)) + && nrows > ncols) + || ((typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper) + && nrows < ncols)) { - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Permuted_Lower) + if (typ == MatrixType::Permuted_Upper + || typ == MatrixType::Permuted_Lower) delete [] perm; nperm = 0; typ = MatrixType::Rectangular; @@ -806,9 +806,9 @@ if (typ == MatrixType::Full && ncols != nrows) typ = MatrixType::Rectangular; - if (maybe_hermitian && (typ == MatrixType::Full || - typ == MatrixType::Tridiagonal || - typ == MatrixType::Banded)) + if (maybe_hermitian && (typ == MatrixType::Full + || typ == MatrixType::Tridiagonal + || typ == MatrixType::Banded)) { bool is_herm = true; @@ -890,8 +890,8 @@ bandden (0), upper_band (0), lower_band (0), dense (false), full (_full), nperm (0), perm (0) { - if ((t == MatrixType::Permuted_Upper || t == MatrixType::Permuted_Lower) && - np > 0 && p != 0) + if ((t == MatrixType::Permuted_Upper || t == MatrixType::Permuted_Lower) + && np > 0 && p != 0) { typ = t; nperm = np; @@ -965,15 +965,14 @@ if (typ != MatrixType::Unknown && (full || sp_bandden == octave_sparse_params::get_bandden ())) { - if (!quiet && - octave_sparse_params::get_key ("spumoni") != 0.) + if (!quiet && octave_sparse_params::get_key ("spumoni") != 0.) warn_cached (); return typ; } - if (typ != MatrixType::Unknown && - octave_sparse_params::get_key ("spumoni") != 0.) + if (typ != MatrixType::Unknown + && octave_sparse_params::get_key ("spumoni") != 0.) (*current_liboctave_warning_with_id_handler) ("Octave:matrix-type-info", "invalidating matrix type"); @@ -1208,14 +1207,13 @@ void MatrixType::mark_as_symmetric (void) { - if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) typ = MatrixType::Tridiagonal_Hermitian; - else if (typ == MatrixType::Banded || - typ == MatrixType::Banded_Hermitian) + else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) typ = MatrixType::Banded_Hermitian; - else if (typ == MatrixType::Full || typ == MatrixType::Hermitian || - typ == MatrixType::Unknown) + else if (typ == MatrixType::Full || typ == MatrixType::Hermitian + || typ == MatrixType::Unknown) typ = MatrixType::Hermitian; else (*current_liboctave_error_handler) @@ -1225,14 +1223,13 @@ void MatrixType::mark_as_unsymmetric (void) { - if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) typ = MatrixType::Tridiagonal; - else if (typ == MatrixType::Banded || - typ == MatrixType::Banded_Hermitian) + else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) typ = MatrixType::Banded; - else if (typ == MatrixType::Full || typ == MatrixType::Hermitian || - typ == MatrixType::Unknown) + else if (typ == MatrixType::Full || typ == MatrixType::Hermitian + || typ == MatrixType::Unknown) typ = MatrixType::Full; }
--- a/liboctave/array/MatrixType.h +++ b/liboctave/array/MatrixType.h @@ -121,8 +121,8 @@ bool is_hermitian (void) const { - return (typ == Banded_Hermitian || typ == Tridiagonal_Hermitian || - typ == Hermitian); + return (typ == Banded_Hermitian || typ == Tridiagonal_Hermitian + || typ == Hermitian); } bool is_rectangular (void) const { return (typ == Rectangular); }
--- a/liboctave/array/dMatrix.cc +++ b/liboctave/array/dMatrix.cc @@ -1577,8 +1577,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { octave_idx_type b_nc = b.cols (); rcon = 1.; @@ -1672,8 +1671,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { octave_idx_type b_nc = b.cols (); rcon = 1.;
--- a/liboctave/array/dSparse.cc +++ b/liboctave/array/dSparse.cc @@ -782,8 +782,8 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (x.ridx (ja) < y.ridx (jb)))) + if ((! jb_lt_max) + || (ja_lt_max && (x.ridx (ja) < y.ridx (jb)))) { r.ridx (jx) = x.ridx (ja); r.data (jx) = atan2 (x.data (ja), 0.); @@ -791,8 +791,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (y.ridx (jb) < x.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (y.ridx (jb) < x.ridx (ja)))) { jb++; jb_lt_max= jb < jb_max; @@ -867,8 +867,7 @@ int typ = mattyp.type (); mattyp.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { if (typ == MatrixType::Permuted_Diagonal) retval = transpose (); @@ -922,8 +921,8 @@ int typ = mattyp.type (); mattyp.info (); - if (typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper || - typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower) + if (typ == MatrixType::Upper || typ == MatrixType::Permuted_Upper + || typ == MatrixType::Lower || typ == MatrixType::Permuted_Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -997,8 +996,8 @@ colXp++; colUp++; } - } while ((rpX<j) && (rpU<j) && - (colXp<cx) && (colUp<nz)); + } + while (rpX < j && rpU < j && colXp < cx && colUp < nz); // get A(m,m) if (typ == MatrixType::Upper) @@ -1399,8 +1398,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { retval.resize (nc, b.cols (), 0.); if (typ == MatrixType::Diagonal) @@ -1460,8 +1458,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { octave_idx_type b_nc = b.cols (); octave_idx_type b_nz = b.nnz (); @@ -1551,8 +1548,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { retval.resize (nc, b.cols (), 0); if (typ == MatrixType::Diagonal) @@ -1612,8 +1608,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Diagonal || - typ == MatrixType::Permuted_Diagonal) + if (typ == MatrixType::Diagonal || typ == MatrixType::Permuted_Diagonal) { octave_idx_type b_nc = b.cols (); octave_idx_type b_nz = b.nnz (); @@ -1704,8 +1699,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -1744,8 +1738,8 @@ if (work[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -1820,8 +1814,8 @@ { if (work[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -1935,8 +1929,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -1984,8 +1977,8 @@ if (work[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2081,8 +2074,8 @@ { if (work[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2218,8 +2211,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -2258,8 +2250,8 @@ if (cwork[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2335,8 +2327,8 @@ { if (cwork[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2452,8 +2444,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { double anorm = 0.; double ainvnorm = 0.; @@ -2501,8 +2492,8 @@ if (cwork[k] != 0.) { - if (ridx (cidx (kidx+1)-1) != k || - data (cidx (kidx+1)-1) == 0.) + if (ridx (cidx (kidx+1)-1) != k + || data (cidx (kidx+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2599,8 +2590,8 @@ { if (cwork[k] != 0.) { - if (ridx (cidx (k+1)-1) != k || - data (cidx (k+1)-1) == 0.) + if (ridx (cidx (k+1)-1) != k + || data (cidx (k+1)-1) == 0.) { err = -2; goto triangular_error; @@ -2738,8 +2729,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -2876,8 +2866,7 @@ { if (work[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -2994,8 +2983,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -3158,8 +3146,7 @@ { if (work[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -3297,8 +3284,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -3436,8 +3422,7 @@ { if (cwork[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -3554,8 +3539,7 @@ int typ = mattype.type (); mattype.info (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { double anorm = 0.; double ainvnorm = 0.; @@ -3719,8 +3703,7 @@ { if (cwork[k] != 0.) { - if (ridx (cidx (k)) != k || - data (cidx (k)) == 0.) + if (ridx (cidx (k)) != k || data (cidx (k)) == 0.) { err = -2; goto triangular_error; @@ -4011,8 +3994,8 @@ mattype.info (); // Note can't treat symmetric case as there is no dpttrf function - if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) { OCTAVE_LOCAL_BUFFER (double, DU2, nr - 2); OCTAVE_LOCAL_BUFFER (double, DU, nr - 1); @@ -4307,8 +4290,8 @@ mattype.info (); // Note can't treat symmetric case as there is no dpttrf function - if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) { OCTAVE_LOCAL_BUFFER (double, DU2, nr - 2); OCTAVE_LOCAL_BUFFER (double, DU, nr - 1); @@ -5733,8 +5716,8 @@ rcond = 1.; volatile double rcond_plus_one = rcond + 1.0; - if (status == UMFPACK_WARNING_singular_matrix || - rcond_plus_one == 1.0 || xisnan (rcond)) + if (status == UMFPACK_WARNING_singular_matrix + || rcond_plus_one == 1.0 || xisnan (rcond)) { UMFPACK_DNAME (report_numeric) (Numeric, control); @@ -6791,8 +6774,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -6859,8 +6842,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -6927,8 +6910,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -6995,8 +6978,8 @@ retval = ltsolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Banded || typ == MatrixType::Banded_Hermitian) retval = bsolve (mattype, b, err, rcond, sing_handler, false); - else if (typ == MatrixType::Tridiagonal || - typ == MatrixType::Tridiagonal_Hermitian) + else if (typ == MatrixType::Tridiagonal + || typ == MatrixType::Tridiagonal_Hermitian) retval = trisolve (mattype, b, err, rcond, sing_handler, false); else if (typ == MatrixType::Full || typ == MatrixType::Hermitian) retval = fsolve (mattype, b, err, rcond, sing_handler, true); @@ -7754,8 +7737,7 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { double tmp = xmin (a.data (ja), 0.); if (tmp != 0.) @@ -7767,8 +7749,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { double tmp = xmin (0., b.data (jb)); if (tmp != 0.) @@ -7905,8 +7887,7 @@ while (ja_lt_max || jb_lt_max) { octave_quit (); - if ((! jb_lt_max) || - (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) + if ((! jb_lt_max) || (ja_lt_max && (a.ridx (ja) < b.ridx (jb)))) { double tmp = xmax (a.data (ja), 0.); if (tmp != 0.) @@ -7918,8 +7899,8 @@ ja++; ja_lt_max= ja < ja_max; } - else if ((! ja_lt_max) || - (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) + else if ((! ja_lt_max) + || (jb_lt_max && (b.ridx (jb) < a.ridx (ja)))) { double tmp = xmax (0., b.data (jb)); if (tmp != 0.)
--- a/liboctave/array/fCMatrix.cc +++ b/liboctave/array/fCMatrix.cc @@ -1942,8 +1942,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { octave_idx_type b_nc = b.cols (); rcon = 1.; @@ -2038,8 +2037,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { octave_idx_type b_nc = b.cols (); rcon = 1.;
--- a/liboctave/array/fMatrix.cc +++ b/liboctave/array/fMatrix.cc @@ -1589,8 +1589,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Upper || - typ == MatrixType::Upper) + if (typ == MatrixType::Permuted_Upper || typ == MatrixType::Upper) { octave_idx_type b_nc = b.cols (); rcon = 1.; @@ -1686,8 +1685,7 @@ { volatile int typ = mattype.type (); - if (typ == MatrixType::Permuted_Lower || - typ == MatrixType::Lower) + if (typ == MatrixType::Permuted_Lower || typ == MatrixType::Lower) { octave_idx_type b_nc = b.cols (); rcon = 1.;
--- a/liboctave/numeric/eigs-base.cc +++ b/liboctave/numeric/eigs-base.cc @@ -502,8 +502,8 @@ for (octave_idx_type j = 0; j < n; j++) { double d = 0.; - if (U.xcidx (j+1) > U.xcidx (j) && - U.xridx (U.xcidx (j+1)-1) == j) + if (U.xcidx (j+1) > U.xcidx (j) + && U.xridx (U.xcidx (j+1)-1) == j) d = std::abs (U.xdata (U.xcidx (j+1)-1)); if (xisnan (minU) || d < minU) @@ -666,8 +666,8 @@ for (octave_idx_type j = 0; j < n; j++) { double d = 0.; - if (U.xcidx (j+1) > U.xcidx (j) && - U.xridx (U.xcidx (j+1)-1) == j) + if (U.xcidx (j+1) > U.xcidx (j) + && U.xridx (U.xcidx (j+1)-1) == j) d = std::abs (U.xdata (U.xcidx (j+1)-1)); if (xisnan (minU) || d < minU) @@ -846,8 +846,8 @@ { octave_idx_type bidx = static_cast<octave_idx_type> (permB(i)); - if (checked(bidx) || bidx < 0 || - bidx >= n || D_NINT (bidx) != bidx) + if (checked(bidx) || bidx < 0 || bidx >= n + || D_NINT (bidx) != bidx) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -857,9 +857,9 @@ } } - if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" && - typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" && - typ != "SI") + if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" + && typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" + && typ != "SI") { (*current_liboctave_error_handler) ("eigs: unrecognized sigma value"); @@ -1169,8 +1169,8 @@ { octave_idx_type bidx = static_cast<octave_idx_type> (permB(i)); - if (checked(bidx) || bidx < 0 || - bidx >= n || D_NINT (bidx) != bidx) + if (checked(bidx) || bidx < 0 || bidx >= n + || D_NINT (bidx) != bidx) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -1465,9 +1465,9 @@ if (! have_sigma) { - if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" && - typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" && - typ != "SI") + if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" + && typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" + && typ != "SI") (*current_liboctave_error_handler) ("eigs: unrecognized sigma value"); @@ -1760,8 +1760,8 @@ { octave_idx_type bidx = static_cast<octave_idx_type> (permB(i)); - if (checked(bidx) || bidx < 0 || - bidx >= n || D_NINT (bidx) != bidx) + if (checked(bidx) || bidx < 0 || bidx >= n + || D_NINT (bidx) != bidx) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -1771,9 +1771,9 @@ } } - if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" && - typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" && - typ != "SI") + if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" + && typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" + && typ != "SI") { (*current_liboctave_error_handler) ("eigs: unrecognized sigma value"); @@ -2132,8 +2132,8 @@ { octave_idx_type bidx = static_cast<octave_idx_type> (permB(i)); - if (checked(bidx) || bidx < 0 || - bidx >= n || D_NINT (bidx) != bidx) + if (checked(bidx) || bidx < 0 || bidx >= n + || D_NINT (bidx) != bidx) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -2483,9 +2483,9 @@ if (! have_sigma) { - if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" && - typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" && - typ != "SI") + if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" + && typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" + && typ != "SI") (*current_liboctave_error_handler) ("eigs: unrecognized sigma value"); @@ -2828,8 +2828,8 @@ { octave_idx_type bidx = static_cast<octave_idx_type> (permB(i)); - if (checked(bidx) || bidx < 0 || - bidx >= n || D_NINT (bidx) != bidx) + if (checked(bidx) || bidx < 0 || bidx >= n + || D_NINT (bidx) != bidx) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -2839,9 +2839,9 @@ } } - if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" && - typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" && - typ != "SI") + if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" + && typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" + && typ != "SI") { (*current_liboctave_error_handler) ("eigs: unrecognized sigma value"); @@ -3152,8 +3152,8 @@ { octave_idx_type bidx = static_cast<octave_idx_type> (permB(i)); - if (checked(bidx) || bidx < 0 || - bidx >= n || D_NINT (bidx) != bidx) + if (checked(bidx) || bidx < 0 || bidx >= n + || D_NINT (bidx) != bidx) { (*current_liboctave_error_handler) ("eigs: permB vector invalid"); @@ -3456,9 +3456,9 @@ if (! have_sigma) { - if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" && - typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" && - typ != "SI") + if (typ != "LM" && typ != "SM" && typ != "LA" && typ != "SA" + && typ != "BE" && typ != "LR" && typ != "SR" && typ != "LI" + && typ != "SI") (*current_liboctave_error_handler) ("eigs: unrecognized sigma value");
--- a/liboctave/system/lo-sysdep.cc +++ b/liboctave/system/lo-sysdep.cc @@ -99,16 +99,18 @@ ZeroMemory (&si, sizeof (si)); si.cb = sizeof (si); - if (! CreatePipe (&childRead, &parentWrite, 0, 0) || - ! DuplicateHandle (hProcess, childRead, hProcess, &childRead, 0, TRUE, - DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) + if (! CreatePipe (&childRead, &parentWrite, 0, 0) + || ! DuplicateHandle (hProcess, childRead, hProcess, &childRead, + 0, TRUE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) { msg = "popen2: pipe creation failed"; return -1; } - if (! CreatePipe (&parentRead, &childWrite, 0, 0) || - ! DuplicateHandle (hProcess, childWrite, hProcess, &childWrite, 0, TRUE, - DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) + if (! CreatePipe (&parentRead, &childWrite, 0, 0) + || ! DuplicateHandle (hProcess, childWrite, hProcess, &childWrite, + 0, TRUE, + DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) { msg = "popen2: pipe creation failed"; return -1;
--- a/liboctave/util/kpse.cc +++ b/liboctave/util/kpse.cc @@ -1658,10 +1658,10 @@ /* We ignore an open brace surrounded by whitespace, and also an open brace followed immediately by a close brace, that was preceded with whitespace. */ - if (c == '{' && - ((i == 0 || brace_whitespace (text[i-1])) && - (i+1 < text_len && - (brace_whitespace (text[i+1]) || text[i+1] == '}')))) + if (c == '{' + && ((i == 0 || brace_whitespace (text[i-1])) + && (i+1 < text_len + && (brace_whitespace (text[i+1]) || text[i+1] == '}')))) continue; /* If this is being compiled as part of bash, ignore the '{' in a '${ }' construct */