# HG changeset patch
# User Rik
# Date 1702444698 28800
# Node ID 3c2c585965cc6e2316211156d6dc6a9914323cb2
# Parent 05b4479c29d8f3a6b842dd19935abeb3490fc058
maint: C++ style check for liboctave/ before 9.1 release.
* liboctave/array/Array-b.cc, liboctave/array/Array-base.cc,
liboctave/array/CMatrix.cc, liboctave/array/CNDArray.cc,
liboctave/array/CSparse.cc, liboctave/array/MArray.cc,
liboctave/array/Range.cc, liboctave/array/Sparse.cc, liboctave/array/Sparse.h,
liboctave/array/dMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fCNDArray.cc, liboctave/array/fMatrix.cc,
liboctave/array/idx-vector.cc, liboctave/numeric/CollocWt.cc,
liboctave/numeric/gsvd.cc, liboctave/numeric/lo-mappers.cc,
liboctave/numeric/lo-specfun.cc, liboctave/numeric/oct-norm.cc,
liboctave/numeric/oct-rand.cc, liboctave/numeric/oct-spparms.cc,
liboctave/numeric/randmtzig.cc, liboctave/numeric/randpoisson.cc,
liboctave/operators/mx-inlines.cc, liboctave/system/child-list.cc,
liboctave/system/file-ops.cc, liboctave/system/lo-sysdep.cc,
liboctave/system/lo-sysinfo.cc, liboctave/system/mach-info.cc,
liboctave/util/file-info.cc, liboctave/util/glob-match.cc,
liboctave/util/lo-error.h, liboctave/util/lo-utils.cc,
liboctave/util/oct-inttypes.h, liboctave/util/oct-shlib.cc,
liboctave/util/oct-sort.cc, liboctave/util/oct-string.cc,
liboctave/util/pathsearch.cc, liboctave/util/quit.cc, liboctave/version.cc:
C++ style check for liboctave/ before 9.1 release.
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/Array-b.cc
--- a/liboctave/array/Array-b.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/Array-b.cc Tue Dec 12 21:18:18 2023 -0800
@@ -46,7 +46,8 @@
// Specialize bool sorting (aka stable partitioning).
template
-static void do_bool_partition (bool *data, octave_idx_type nel)
+static void
+do_bool_partition (bool *data, octave_idx_type nel)
{
octave_idx_type k = 0;
for (octave_idx_type i = 0; i < nel; i++)
@@ -57,8 +58,9 @@
}
template
-static void do_bool_partition (bool *data, octave_idx_type *idx,
- octave_idx_type nel)
+static void
+do_bool_partition (bool *data, octave_idx_type *idx,
+ octave_idx_type nel)
{
// FIXME: This is essentially a simple bucket sort.
// Can it be efficiently done by std::partition?
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/Array-base.cc
--- a/liboctave/array/Array-base.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/Array-base.cc Tue Dec 12 21:18:18 2023 -0800
@@ -197,7 +197,7 @@
template
octave_idx_type
Array::compute_index (octave_idx_type i, octave_idx_type j,
- octave_idx_type k) const
+ octave_idx_type k) const
{
return ::compute_index (i, j, k, m_dimensions);
}
@@ -266,7 +266,7 @@
template
typename Array::crefT
Array::checkelem (octave_idx_type i, octave_idx_type j,
- octave_idx_type k) const
+ octave_idx_type k) const
{
return elem (compute_index (i, j, k));
}
@@ -1067,7 +1067,7 @@
template
Array
Array::index (const octave::idx_vector& i, const octave::idx_vector& j,
- bool resize_ok, const T& rfv) const
+ bool resize_ok, const T& rfv) const
{
Array tmp = *this;
if (resize_ok)
@@ -1095,7 +1095,7 @@
template
Array
Array::index (const Array& ia,
- bool resize_ok, const T& rfv) const
+ bool resize_ok, const T& rfv) const
{
Array tmp = *this;
if (resize_ok)
@@ -1173,7 +1173,7 @@
template
void
Array::assign (const octave::idx_vector& i, const octave::idx_vector& j,
- const Array& rhs, const T& rfv)
+ const Array& rhs, const T& rfv)
{
bool initial_dims_all_zero = m_dimensions.all_zero ();
@@ -1277,7 +1277,7 @@
template
void
Array::assign (const Array& ia,
- const Array& rhs, const T& rfv)
+ const Array& rhs, const T& rfv)
{
int ial = ia.numel ();
@@ -2760,7 +2760,8 @@
}
template
-bool Array::optimize_dimensions (const dim_vector& dv)
+bool
+Array::optimize_dimensions (const dim_vector& dv)
{
bool retval = m_dimensions == dv;
if (retval)
@@ -2770,7 +2771,8 @@
}
template
-void Array::instantiation_guard ()
+void
+Array::instantiation_guard ()
{
// This guards against accidental implicit instantiations.
// Array instances should always be explicit and use INSTANTIATE_ARRAY.
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/CMatrix.cc
--- a/liboctave/array/CMatrix.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/CMatrix.cc Tue Dec 12 21:18:18 2023 -0800
@@ -3625,9 +3625,10 @@
return result;
}
-ComplexMatrix linspace (const ComplexColumnVector& x1,
- const ComplexColumnVector& x2,
- octave_idx_type n)
+ComplexMatrix
+linspace (const ComplexColumnVector& x1,
+ const ComplexColumnVector& x2,
+ octave_idx_type n)
{
octave_idx_type m = x1.numel ();
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/CNDArray.cc
--- a/liboctave/array/CNDArray.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/CNDArray.cc Tue Dec 12 21:18:18 2023 -0800
@@ -649,7 +649,8 @@
return a;
}
-ComplexNDArray& operator /= (ComplexNDArray& a, double s)
+ComplexNDArray&
+operator /= (ComplexNDArray& a, double s)
{
if (a.is_shared ())
return a = a / s;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/CSparse.cc
--- a/liboctave/array/CSparse.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/CSparse.cc Tue Dec 12 21:18:18 2023 -0800
@@ -7421,7 +7421,8 @@
#undef COL_EXPR
}
-SparseMatrix SparseComplexMatrix::abs () const
+SparseMatrix
+SparseComplexMatrix::abs () const
{
octave_idx_type nz = nnz ();
octave_idx_type nc = cols ();
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/MArray.cc
--- a/liboctave/array/MArray.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/MArray.cc Tue Dec 12 21:18:18 2023 -0800
@@ -149,8 +149,9 @@
}
template
-void MArray::idx_add_nd (const octave::idx_vector& idx,
- const MArray& vals, int dim)
+void
+MArray::idx_add_nd (const octave::idx_vector& idx,
+ const MArray& vals, int dim)
{
int nd = std::max (this->ndims (), vals.ndims ());
if (dim < 0)
@@ -373,7 +374,8 @@
}
template
-void MArray::instantiation_guard ()
+void
+MArray::instantiation_guard ()
{
// This guards against accidental implicit instantiations.
// Array instances should always be explicit and use INSTANTIATE_ARRAY.
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/Range.cc
--- a/liboctave/array/Range.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/Range.cc Tue Dec 12 21:18:18 2023 -0800
@@ -72,7 +72,8 @@
}
template
-bool xteq (T u, T v, T ct = 3 * std::numeric_limits::epsilon ())
+bool
+xteq (T u, T v, T ct = 3 * std::numeric_limits::epsilon ())
{
T tu = std::abs (u);
T tv = std::abs (v);
@@ -81,7 +82,8 @@
}
template
-octave_idx_type xnumel_internal (T base, T limit, T inc)
+octave_idx_type
+xnumel_internal (T base, T limit, T inc)
{
octave_idx_type retval = -1;
if (! math::isfinite (base) || ! math::isfinite (inc)
@@ -133,7 +135,8 @@
}
template
-bool xall_elements_are_ints (T base, T inc, T final_val, octave_idx_type nel)
+bool
+xall_elements_are_ints (T base, T inc, T final_val, octave_idx_type nel)
{
// If the range is empty or NaN then there are no elements so there
// can be no int elements.
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/Sparse.cc
--- a/liboctave/array/Sparse.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/Sparse.cc Tue Dec 12 21:18:18 2023 -0800
@@ -197,8 +197,7 @@
template
OCTAVE_API
-Sparse::Sparse (octave_idx_type nr, octave_idx_type nc,
- T val)
+Sparse::Sparse (octave_idx_type nr, octave_idx_type nc, T val)
: m_rep (nullptr), m_dimensions (dim_vector (nr, nc))
{
if (val != T ())
@@ -774,8 +773,8 @@
template
OCTAVE_API
T
-Sparse::range_error (const char *fcn, octave_idx_type i,
- octave_idx_type j) const
+Sparse::range_error (const char *fcn,
+ octave_idx_type i, octave_idx_type j) const
{
(*current_liboctave_error_handler)
("%s (%" OCTAVE_IDX_TYPE_FORMAT ", %" OCTAVE_IDX_TYPE_FORMAT "): "
@@ -785,8 +784,8 @@
template
OCTAVE_API
T&
-Sparse::range_error (const char *fcn, octave_idx_type i,
- octave_idx_type j)
+Sparse::range_error (const char *fcn,
+ octave_idx_type i, octave_idx_type j)
{
(*current_liboctave_error_handler)
("%s (%" OCTAVE_IDX_TYPE_FORMAT ", %" OCTAVE_IDX_TYPE_FORMAT "): "
@@ -797,7 +796,7 @@
OCTAVE_API
T
Sparse::range_error (const char *fcn,
- const Array& ra_idx) const
+ const Array& ra_idx) const
{
std::ostringstream buf;
@@ -2031,8 +2030,7 @@
template
OCTAVE_API
void
-Sparse::assign (const octave::idx_vector& idx,
- const T& rhs)
+Sparse::assign (const octave::idx_vector& idx, const T& rhs)
{
// FIXME: Converting the RHS and forwarding to the sparse matrix
// assignment function is simpler, but it might be good to have a
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/Sparse.h
--- a/liboctave/array/Sparse.h Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/Sparse.h Tue Dec 12 21:18:18 2023 -0800
@@ -56,7 +56,7 @@
// The real representation of all Sparse arrays.
//--------------------------------------------------------------------
-class SparseRep : public Alloc
+ class SparseRep : public Alloc
{
public:
@@ -290,8 +290,8 @@
Sparse (const dim_vector& dv, octave_idx_type nz,
T *ptr, octave_idx_type *ridx, octave_idx_type *cidx,
const Alloc& xallocator = Alloc ())
- : m_rep (new typename Sparse::SparseRep (dv, nz, ptr, ridx, cidx, xallocator)),
- m_dimensions (dv)
+ : m_rep (new typename Sparse::SparseRep (dv, nz, ptr, ridx, cidx, xallocator)),
+ m_dimensions (dv)
{ }
// Both SparseMatrix and SparseBoolMatrix need this ctor, and this
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/dMatrix.cc
--- a/liboctave/array/dMatrix.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/dMatrix.cc Tue Dec 12 21:18:18 2023 -0800
@@ -3008,9 +3008,10 @@
return result;
}
-Matrix linspace (const ColumnVector& x1,
- const ColumnVector& x2,
- octave_idx_type n)
+Matrix
+linspace (const ColumnVector& x1,
+ const ColumnVector& x2,
+ octave_idx_type n)
{
octave_idx_type m = x1.numel ();
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/fCMatrix.cc
--- a/liboctave/array/fCMatrix.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/fCMatrix.cc Tue Dec 12 21:18:18 2023 -0800
@@ -2849,7 +2849,8 @@
return FloatComplexNDArray::sumsq (dim);
}
-FloatMatrix FloatComplexMatrix::abs () const
+FloatMatrix
+FloatComplexMatrix::abs () const
{
return FloatComplexNDArray::abs ();
}
@@ -3655,9 +3656,10 @@
return result;
}
-FloatComplexMatrix linspace (const FloatComplexColumnVector& x1,
- const FloatComplexColumnVector& x2,
- octave_idx_type n)
+FloatComplexMatrix
+linspace (const FloatComplexColumnVector& x1,
+ const FloatComplexColumnVector& x2,
+ octave_idx_type n)
{
octave_idx_type m = x1.numel ();
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/fCNDArray.cc
--- a/liboctave/array/fCNDArray.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/fCNDArray.cc Tue Dec 12 21:18:18 2023 -0800
@@ -664,7 +664,8 @@
return a;
}
-FloatComplexNDArray& operator /= (FloatComplexNDArray& a, float s)
+FloatComplexNDArray&
+operator /= (FloatComplexNDArray& a, float s)
{
if (a.is_shared ())
a = a / s;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/fMatrix.cc
--- a/liboctave/array/fMatrix.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/fMatrix.cc Tue Dec 12 21:18:18 2023 -0800
@@ -3014,9 +3014,10 @@
return result;
}
-FloatMatrix linspace (const FloatColumnVector& x1,
- const FloatColumnVector& x2,
- octave_idx_type n)
+FloatMatrix
+linspace (const FloatColumnVector& x1,
+ const FloatColumnVector& x2,
+ octave_idx_type n)
{
octave_idx_type m = x1.numel ();
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/array/idx-vector.cc
--- a/liboctave/array/idx-vector.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/array/idx-vector.cc Tue Dec 12 21:18:18 2023 -0800
@@ -49,19 +49,22 @@
(*current_liboctave_error_handler) ("invalid range used as index");
}
-OCTAVE_NORETURN static void err_index_out_of_range ()
+OCTAVE_NORETURN static void
+err_index_out_of_range ()
{
(*current_liboctave_error_handler)
("internal error: idx_vector index out of range");
}
-idx_vector::idx_vector_rep *idx_vector::nil_rep ()
+idx_vector::idx_vector_rep *
+idx_vector::nil_rep ()
{
static idx_vector_rep ivr;
return &ivr;
}
-Array idx_vector::idx_base_rep::as_array ()
+Array
+idx_vector::idx_base_rep::as_array ()
{
(*current_liboctave_error_handler)
("internal error: as_array not allowed for this index class");
@@ -94,7 +97,8 @@
("internal error: idx_colon_rep::sort_idx");
}
-std::ostream& idx_vector::idx_colon_rep::print (std::ostream& os) const
+std::ostream&
+idx_vector::idx_colon_rep::print (std::ostream& os) const
{
return os << ':';
}
@@ -154,7 +158,8 @@
return m_start + i*m_step;
}
-idx_vector::idx_base_rep *idx_vector::idx_range_rep::sort_uniq_clone (bool)
+idx_vector::idx_base_rep *
+idx_vector::idx_range_rep::sort_uniq_clone (bool)
{
if (m_step < 0)
return new idx_range_rep (m_start + (m_len - 1)*m_step, m_len, -m_step, DIRECT);
@@ -185,19 +190,22 @@
}
}
-std::ostream& idx_vector::idx_range_rep::print (std::ostream& os) const
+std::ostream&
+idx_vector::idx_range_rep::print (std::ostream& os) const
{
os << m_start << ':' << m_step << ':' << m_start + m_len *m_step;
return os;
}
-range idx_vector::idx_range_rep::unconvert () const
+range
+idx_vector::idx_range_rep::unconvert () const
{
return range::make_n_element_range
(static_cast (m_start+1), static_cast (m_step), m_len);
}
-Array idx_vector::idx_range_rep::as_array ()
+Array
+idx_vector::idx_range_rep::as_array ()
{
Array retval (dim_vector (1, m_len));
for (octave_idx_type i = 0; i < m_len; i++)
@@ -206,7 +214,8 @@
return retval;
}
-inline octave_idx_type convert_index (octave_idx_type i, octave_idx_type& ext)
+inline octave_idx_type
+convert_index (octave_idx_type i, octave_idx_type& ext)
{
if (i <= 0)
err_invalid_index (i-1);
@@ -217,7 +226,8 @@
return i - 1;
}
-inline octave_idx_type convert_index (double x, octave_idx_type& ext)
+inline octave_idx_type
+convert_index (double x, octave_idx_type& ext)
{
octave_idx_type i = static_cast (x);
@@ -227,13 +237,15 @@
return convert_index (i, ext);
}
-inline octave_idx_type convert_index (float x, octave_idx_type& ext)
+inline octave_idx_type
+convert_index (float x, octave_idx_type& ext)
{
return convert_index (static_cast (x), ext);
}
template
-inline octave_idx_type convert_index (octave_int x, octave_idx_type& ext)
+inline octave_idx_type
+convert_index (octave_int x, octave_idx_type& ext)
{
octave_idx_type i = octave_int (x).value ();
@@ -274,17 +286,20 @@
return this;
}
-std::ostream& idx_vector::idx_scalar_rep::print (std::ostream& os) const
+std::ostream&
+idx_vector::idx_scalar_rep::print (std::ostream& os) const
{
return os << m_data;
}
-double idx_vector::idx_scalar_rep::unconvert () const
+double
+idx_vector::idx_scalar_rep::unconvert () const
{
return m_data + 1;
}
-Array idx_vector::idx_scalar_rep::as_array ()
+Array
+idx_vector::idx_scalar_rep::as_array ()
{
return Array (dim_vector (1, 1), m_data);
}
@@ -566,7 +581,8 @@
return new_rep.release ();
}
-std::ostream& idx_vector::idx_vector_rep::print (std::ostream& os) const
+std::ostream&
+idx_vector::idx_vector_rep::print (std::ostream& os) const
{
os << '[';
@@ -581,7 +597,8 @@
return os;
}
-Array idx_vector::idx_vector_rep::unconvert () const
+Array
+idx_vector::idx_vector_rep::unconvert () const
{
Array retval (m_orig_dims);
for (octave_idx_type i = 0; i < m_len; i++)
@@ -589,7 +606,8 @@
return retval;
}
-Array idx_vector::idx_vector_rep::as_array ()
+Array
+idx_vector::idx_vector_rep::as_array ()
{
if (m_aowner)
return *m_aowner;
@@ -653,7 +671,8 @@
delete [] m_data;
}
-octave_idx_type idx_vector::idx_mask_rep::xelem (octave_idx_type n) const
+octave_idx_type
+idx_vector::idx_mask_rep::xelem (octave_idx_type n) const
{
if (n == m_lsti + 1)
{
@@ -670,7 +689,8 @@
return m_lste;
}
-octave_idx_type idx_vector::idx_mask_rep::checkelem (octave_idx_type n) const
+octave_idx_type
+idx_vector::idx_mask_rep::checkelem (octave_idx_type n) const
{
if (n < 0 || n >= m_len)
err_invalid_index (n);
@@ -678,7 +698,8 @@
return xelem (n);
}
-std::ostream& idx_vector::idx_mask_rep::print (std::ostream& os) const
+std::ostream&
+idx_vector::idx_mask_rep::print (std::ostream& os) const
{
os << '[';
@@ -693,7 +714,8 @@
return os;
}
-Array idx_vector::idx_mask_rep::unconvert () const
+Array
+idx_vector::idx_mask_rep::unconvert () const
{
if (m_aowner)
return *m_aowner;
@@ -706,7 +728,8 @@
}
}
-Array idx_vector::idx_mask_rep::as_array ()
+Array
+idx_vector::idx_mask_rep::as_array ()
{
if (m_aowner)
return m_aowner->find ().reshape (m_orig_dims);
@@ -746,8 +769,9 @@
m_rep = new idx_mask_rep (bnda, nnz);
}
-bool idx_vector::maybe_reduce (octave_idx_type n, const idx_vector& j,
- octave_idx_type nj)
+bool
+idx_vector::maybe_reduce (octave_idx_type n, const idx_vector& j,
+ octave_idx_type nj)
{
bool reduced = false;
@@ -914,8 +938,9 @@
return reduced;
}
-bool idx_vector::is_cont_range (octave_idx_type n, octave_idx_type& l,
- octave_idx_type& u) const
+bool
+idx_vector::is_cont_range (octave_idx_type n, octave_idx_type& l,
+ octave_idx_type& u) const
{
bool res = false;
@@ -967,7 +992,8 @@
return res;
}
-octave_idx_type idx_vector::increment () const
+octave_idx_type
+idx_vector::increment () const
{
octave_idx_type retval = 0;
@@ -996,7 +1022,8 @@
return retval;
}
-const octave_idx_type *idx_vector::raw ()
+const octave_idx_type *
+idx_vector::raw ()
{
if (m_rep->idx_class () != class_vector)
*this = idx_vector (as_array (), extent (0));
@@ -1008,7 +1035,8 @@
return r->get_data ();
}
-void idx_vector::copy_data (octave_idx_type *m_data) const
+void
+idx_vector::copy_data (octave_idx_type *m_data) const
{
octave_idx_type m_len = m_rep->length (0);
@@ -1065,7 +1093,8 @@
}
}
-idx_vector idx_vector::complement (octave_idx_type n) const
+idx_vector
+idx_vector::complement (octave_idx_type n) const
{
idx_vector retval;
if (extent (n) > n)
@@ -1095,7 +1124,8 @@
return retval;
}
-bool idx_vector::is_permutation (octave_idx_type n) const
+bool
+idx_vector::is_permutation (octave_idx_type n) const
{
bool retval = false;
@@ -1123,7 +1153,8 @@
return retval;
}
-idx_vector idx_vector::inverse_permutation (octave_idx_type n) const
+idx_vector
+idx_vector::inverse_permutation (octave_idx_type n) const
{
assert (n == length (n));
@@ -1157,7 +1188,8 @@
return retval;
}
-idx_vector idx_vector::unmask () const
+idx_vector
+idx_vector::unmask () const
{
if (idx_class () == class_mask)
{
@@ -1180,9 +1212,10 @@
return *this;
}
-void idx_vector::unconvert (idx_class_type& iclass,
- double& scalar, range& range,
- Array& array, Array& mask) const
+void
+idx_vector::unconvert (idx_class_type& iclass,
+ double& scalar, range& range,
+ Array& array, Array& mask) const
{
iclass = idx_class ();
switch (iclass)
@@ -1224,12 +1257,14 @@
}
}
-Array idx_vector::as_array () const
+Array
+idx_vector::as_array () const
{
return m_rep->as_array ();
}
-bool idx_vector::isvector () const
+bool
+idx_vector::isvector () const
{
return idx_class () != class_vector || orig_dimensions ().isvector ();
}
@@ -1244,7 +1279,8 @@
return length (z_len);
}
-octave_idx_type idx_vector::ones_count () const
+octave_idx_type
+idx_vector::ones_count () const
{
octave_idx_type n = 0;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/CollocWt.cc
--- a/liboctave/numeric/CollocWt.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/CollocWt.cc Tue Dec 12 21:18:18 2023 -0800
@@ -147,9 +147,10 @@
// dif3 : one dimensional vector containing the third derivative
// of the node polynomial at the zeros
-static bool jcobi (octave_idx_type n, octave_idx_type n0, octave_idx_type n1,
- double alpha, double beta, double *dif1, double *dif2,
- double *dif3, double *root)
+static bool
+jcobi (octave_idx_type n, octave_idx_type n0, octave_idx_type n1,
+ double alpha, double beta, double *dif1, double *dif2,
+ double *dif3, double *root)
{
assert (n0 == 0 || n0 == 1);
assert (n1 == 0 || n1 == 1);
@@ -308,9 +309,10 @@
//
// vect : one dimensional vector of computed weights
-static void dfopr (octave_idx_type n, octave_idx_type n0, octave_idx_type n1,
- octave_idx_type i, octave_idx_type id, double *dif1,
- double *dif2, double *dif3, double *root, double *vect)
+static void
+dfopr (octave_idx_type n, octave_idx_type n0, octave_idx_type n1,
+ octave_idx_type i, octave_idx_type id, double *dif1,
+ double *dif2, double *dif3, double *root, double *vect)
{
assert (n0 == 0 || n0 == 1);
assert (n1 == 0 || n1 == 1);
@@ -377,12 +379,14 @@
// Error handling.
-void CollocWt::error (const char *msg)
+void
+CollocWt::error (const char *msg)
{
(*current_liboctave_error_handler) ("CollocWt: fatal error '%s'", msg);
}
-CollocWt& CollocWt::set_left (double val)
+CollocWt&
+CollocWt::set_left (double val)
{
if (val >= m_rb)
error ("CollocWt: left bound greater than right bound");
@@ -392,7 +396,8 @@
return *this;
}
-CollocWt& CollocWt::set_right (double val)
+CollocWt&
+CollocWt::set_right (double val)
{
if (val <= m_lb)
error ("CollocWt: right bound less than left bound");
@@ -402,7 +407,8 @@
return *this;
}
-void CollocWt::init ()
+void
+CollocWt::init ()
{
// Check for possible errors.
@@ -479,7 +485,8 @@
m_initialized = 1;
}
-std::ostream& operator << (std::ostream& os, const CollocWt& a)
+std::ostream&
+operator << (std::ostream& os, const CollocWt& a)
{
if (a.left_included ())
os << "left boundary is included\n";
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/gsvd.cc
--- a/liboctave/numeric/gsvd.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/gsvd.cc Tue Dec 12 21:18:18 2023 -0800
@@ -53,7 +53,8 @@
#define xSTRINGIZE(x) #x
#define STRINGIZE(x) xSTRINGIZE(x)
-static void initialize_gsvd ()
+static void
+initialize_gsvd ()
{
if (gsvd_initialized)
return;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/lo-mappers.cc
--- a/liboctave/numeric/lo-mappers.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/lo-mappers.cc Tue Dec 12 21:18:18 2023 -0800
@@ -125,12 +125,14 @@
return y;
}
-double frexp (double x, int *expptr)
+double
+frexp (double x, int *expptr)
{
return octave_frexp_wrapper (x, expptr);
}
-float frexp (float x, int *expptr)
+float
+frexp (float x, int *expptr)
{
return octave_frexpf_wrapper (x, expptr);
}
@@ -175,8 +177,10 @@
return (ax != lax) ? (x / ax) * lax : x;
}
-bool negative_sign (double x) { return __lo_ieee_signbit (x); }
-bool negative_sign (float x) { return __lo_ieee_float_signbit (x); }
+bool
+negative_sign (double x) { return __lo_ieee_signbit (x); }
+bool
+negative_sign (float x) { return __lo_ieee_float_signbit (x); }
// Sometimes you need a large integer, but not always.
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/lo-specfun.cc
--- a/liboctave/numeric/lo-specfun.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/lo-specfun.cc Tue Dec 12 21:18:18 2023 -0800
@@ -1463,8 +1463,10 @@
}
// Real and complex Dawson function (= scaled erfi) from Faddeeva package
-double dawson (double x) { return Faddeeva::Dawson (x); }
-float dawson (float x) { return Faddeeva::Dawson (x); }
+double
+dawson (double x) { return Faddeeva::Dawson (x); }
+float
+dawson (float x) { return Faddeeva::Dawson (x); }
Complex
dawson (const Complex& x)
@@ -1616,7 +1618,8 @@
// different input domain of erfcinv. See the notes for erfinv for an
// explanation.
-static double do_erfcinv (double x, bool refine)
+static double
+do_erfcinv (double x, bool refine)
{
// Coefficients of rational approximation.
static const double a[] =
@@ -1690,19 +1693,23 @@
return y;
}
-double erfcinv (double x)
+double
+erfcinv (double x)
{
return do_erfcinv (x, true);
}
-float erfcinv (float x)
+float
+erfcinv (float x)
{
return do_erfcinv (x, false);
}
// Real and complex scaled complementary error function from Faddeeva pkg.
-double erfcx (double x) { return Faddeeva::erfcx (x); }
-float erfcx (float x) { return Faddeeva::erfcx (x); }
+double
+erfcx (double x) { return Faddeeva::erfcx (x); }
+float
+erfcx (float x) { return Faddeeva::erfcx (x); }
Complex
erfcx (const Complex& x)
@@ -1720,8 +1727,10 @@
}
// Real and complex imaginary error function from Faddeeva package
-double erfi (double x) { return Faddeeva::erfi (x); }
-float erfi (float x) { return Faddeeva::erfi (x); }
+double
+erfi (double x) { return Faddeeva::erfi (x); }
+float
+erfi (float x) { return Faddeeva::erfi (x); }
Complex
erfi (const Complex& x)
@@ -1746,7 +1755,8 @@
// order method. For single precision, the accuracy is already OK, so
// we skip it to get faster evaluation.
-static double do_erfinv (double x, bool refine)
+static double
+do_erfinv (double x, bool refine)
{
// Coefficients of rational approximation.
static const double a[] =
@@ -1809,12 +1819,14 @@
return y;
}
-double erfinv (double x)
+double
+erfinv (double x)
{
return do_erfinv (x, true);
}
-float erfinv (float x)
+float
+erfinv (float x)
{
return do_erfinv (x, false);
}
@@ -2045,8 +2057,10 @@
}
// explicit instantiations
-double psi (double z) { return xpsi (z); }
-float psi (float z) { return xpsi (z); }
+double
+psi (double z) { return xpsi (z); }
+float
+psi (float z) { return xpsi (z); }
template
std::complex
@@ -2094,8 +2108,10 @@
}
// explicit instantiations
-Complex psi (const Complex& z) { return xpsi (z); }
-FloatComplex psi (const FloatComplex& z) { return xpsi (z); }
+Complex
+psi (const Complex& z) { return xpsi (z); }
+FloatComplex
+psi (const FloatComplex& z) { return xpsi (z); }
template
static inline void
@@ -2152,8 +2168,10 @@
return ans;
}
-double psi (octave_idx_type n, double z) { return xpsi (n, z); }
-float psi (octave_idx_type n, float z) { return xpsi (n, z); }
+double
+psi (octave_idx_type n, double z) { return xpsi (n, z); }
+float
+psi (octave_idx_type n, float z) { return xpsi (n, z); }
Complex
rc_lgamma (double x)
@@ -2193,14 +2211,16 @@
return result;
}
-Complex rc_log1p (double x)
+Complex
+rc_log1p (double x)
{
return (x < -1.0
? Complex (std::log (-(1.0 + x)), M_PI)
: Complex (log1p (x)));
}
-FloatComplex rc_log1p (float x)
+FloatComplex
+rc_log1p (float x)
{
return (x < -1.0f
? FloatComplex (std::log (-(1.0f + x)), M_PI)
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/oct-norm.cc
--- a/liboctave/numeric/oct-norm.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/oct-norm.cc Tue Dec 12 21:18:18 2023 -0800
@@ -274,7 +274,8 @@
// OK, we're armed :) Now let's go for the fun
template
-inline void vector_norm (const Array& v, R& res, ACC acc)
+inline void
+vector_norm (const Array& v, R& res, ACC acc)
{
for (octave_idx_type i = 0; i < v.numel (); i++)
acc.accum (v(i));
@@ -284,7 +285,8 @@
// dense versions
template
-void column_norms (const MArray& m, MArray& res, ACC acc)
+void
+column_norms (const MArray& m, MArray& res, ACC acc)
{
res = MArray (dim_vector (1, m.columns ()));
for (octave_idx_type j = 0; j < m.columns (); j++)
@@ -298,7 +300,8 @@
}
template
-void row_norms (const MArray& m, MArray& res, ACC acc)
+void
+row_norms (const MArray& m, MArray& res, ACC acc)
{
res = MArray (dim_vector (m.rows (), 1));
std::vector acci (m.rows (), acc);
@@ -314,7 +317,8 @@
// sparse versions
template
-void column_norms (const MSparse& m, MArray& res, ACC acc)
+void
+column_norms (const MSparse& m, MArray& res, ACC acc)
{
res = MArray (dim_vector (1, m.columns ()));
for (octave_idx_type j = 0; j < m.columns (); j++)
@@ -328,7 +332,8 @@
}
template
-void row_norms (const MSparse& m, MArray& res, ACC acc)
+void
+row_norms (const MSparse& m, MArray& res, ACC acc)
{
res = MArray (dim_vector (m.rows (), 1));
std::vector acci (m.rows (), acc);
@@ -452,7 +457,8 @@
// the p-dual element (should work for both real and complex)
template
-inline T elem_dual_p (T x, R p)
+inline T
+elem_dual_p (T x, R p)
{
return math::signum (x) * std::pow (std::abs (x), p-1);
}
@@ -462,7 +468,8 @@
// does not support multiplication with column/row vectors.
// the dual vector
template
-VectorT dual_p (const VectorT& x, R p, R q)
+VectorT
+dual_p (const VectorT& x, R p, R q)
{
VectorT res (x.dims ());
for (octave_idx_type i = 0; i < x.numel (); i++)
@@ -472,8 +479,9 @@
// Higham's hybrid method
template
-R higham (const MatrixT& m, R p, R tol, int maxiter,
- VectorT& x)
+R
+higham (const MatrixT& m, R p, R tol, int maxiter,
+ VectorT& x)
{
x.resize (m.columns (), 1);
// the OSE part
@@ -532,7 +540,8 @@
// version with SVD for dense matrices
template
-R svd_matrix_norm (const MatrixT& m, R p, VectorT)
+R
+svd_matrix_norm (const MatrixT& m, R p, VectorT)
{
R res = 0;
if (p == 2)
@@ -558,7 +567,8 @@
// SVD-free version for sparse matrices
template
-R matrix_norm (const MatrixT& m, R p, VectorT)
+R
+matrix_norm (const MatrixT& m, R p, VectorT)
{
R res = 0;
if (p == 1)
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/oct-rand.cc
--- a/liboctave/numeric/oct-rand.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/oct-rand.cc Tue Dec 12 21:18:18 2023 -0800
@@ -59,7 +59,8 @@
initialize_mersenne_twister ();
}
-bool rand::instance_ok ()
+bool
+rand::instance_ok ()
{
bool retval = true;
@@ -72,7 +73,8 @@
return retval;
}
-double rand::do_seed ()
+double
+rand::do_seed ()
{
union d2i { double d; int32_t i[2]; };
union d2i u;
@@ -108,7 +110,8 @@
return i;
}
-void rand::do_seed (double s)
+void
+rand::do_seed (double s)
{
m_use_old_generators = true;
@@ -135,18 +138,21 @@
F77_FUNC (setsd, SETSD) (i0, i1);
}
-void rand::do_reset ()
+void
+rand::do_reset ()
{
m_use_old_generators = true;
initialize_ranlib_generators ();
}
-uint32NDArray rand::do_state (const std::string& d)
+uint32NDArray
+rand::do_state (const std::string& d)
{
return m_rand_states[d.empty () ? m_current_distribution : get_dist_id (d)];
}
-void rand::do_state (const uint32NDArray& s, const std::string& d)
+void
+rand::do_state (const uint32NDArray& s, const std::string& d)
{
m_use_old_generators = false;
@@ -167,7 +173,8 @@
m_rand_states[old_dist] = saved_state;
}
-void rand::do_reset (const std::string& d)
+void
+rand::do_reset (const std::string& d)
{
m_use_old_generators = false;
@@ -187,7 +194,8 @@
m_rand_states[old_dist] = saved_state;
}
-std::string rand::do_distribution ()
+std::string
+rand::do_distribution ()
{
std::string retval;
@@ -222,7 +230,8 @@
return retval;
}
-void rand::do_distribution (const std::string& d)
+void
+rand::do_distribution (const std::string& d)
{
int id = get_dist_id (d);
@@ -255,35 +264,40 @@
}
}
-void rand::do_uniform_distribution ()
+void
+rand::do_uniform_distribution ()
{
switch_to_generator (uniform_dist);
F77_FUNC (setcgn, SETCGN) (uniform_dist);
}
-void rand::do_normal_distribution ()
+void
+rand::do_normal_distribution ()
{
switch_to_generator (normal_dist);
F77_FUNC (setcgn, SETCGN) (normal_dist);
}
-void rand::do_exponential_distribution ()
+void
+rand::do_exponential_distribution ()
{
switch_to_generator (expon_dist);
F77_FUNC (setcgn, SETCGN) (expon_dist);
}
-void rand::do_poisson_distribution ()
+void
+rand::do_poisson_distribution ()
{
switch_to_generator (poisson_dist);
F77_FUNC (setcgn, SETCGN) (poisson_dist);
}
-void rand::do_gamma_distribution ()
+void
+rand::do_gamma_distribution ()
{
switch_to_generator (gamma_dist);
@@ -291,7 +305,8 @@
}
template <>
-OCTAVE_API double rand::uniform ()
+OCTAVE_API double
+rand::uniform ()
{
double retval;
@@ -304,7 +319,8 @@
}
template <>
-OCTAVE_API double rand::normal ()
+OCTAVE_API double
+rand::normal ()
{
double retval;
@@ -317,7 +333,8 @@
}
template <>
-OCTAVE_API double rand::exponential ()
+OCTAVE_API double
+rand::exponential ()
{
double retval;
@@ -330,7 +347,8 @@
}
template <>
-OCTAVE_API double rand::poisson (double a)
+OCTAVE_API double
+rand::poisson (double a)
{
double retval;
@@ -352,7 +370,8 @@
}
template <>
-OCTAVE_API double rand::gamma (double a)
+OCTAVE_API double
+rand::gamma (double a)
{
double retval;
@@ -452,7 +471,8 @@
}
template
-T rand::do_scalar (T a)
+T
+rand::do_scalar (T a)
{
T retval = 0;
@@ -516,7 +536,8 @@
template OCTAVE_API Array
rand::do_vector (octave_idx_type, float);
-NDArray rand::do_nd_array (const dim_vector& dims, double a)
+NDArray
+rand::do_nd_array (const dim_vector& dims, double a)
{
NDArray retval;
@@ -530,7 +551,8 @@
return retval;
}
-FloatNDArray rand::do_float_nd_array (const dim_vector& dims, float a)
+FloatNDArray
+rand::do_float_nd_array (const dim_vector& dims, float a)
{
FloatNDArray retval;
@@ -549,7 +571,8 @@
// technique used below will cycle monthly, but it does seem to
// work ok to give fairly different seeds each time Octave starts.
-void rand::initialize_ranlib_generators ()
+void
+rand::initialize_ranlib_generators ()
{
sys::localtime tm;
int stored_distribution = m_current_distribution;
@@ -569,7 +592,8 @@
F77_FUNC (setcgn, SETCGN) (stored_distribution);
}
-void rand::initialize_mersenne_twister ()
+void
+rand::initialize_mersenne_twister ()
{
uint32NDArray s;
@@ -598,7 +622,8 @@
set_internal_state (m_rand_states[m_current_distribution]);
}
-uint32NDArray rand::get_internal_state ()
+uint32NDArray
+rand::get_internal_state ()
{
uint32NDArray s (dim_vector (MT_N + 1, 1));
@@ -607,12 +632,14 @@
return s;
}
-void rand::save_state ()
+void
+rand::save_state ()
{
m_rand_states[m_current_distribution] = get_internal_state ();
}
-int rand::get_dist_id (const std::string& d)
+int
+rand::get_dist_id (const std::string& d)
{
int retval = unknown_dist;
@@ -633,7 +660,8 @@
return retval;
}
-void rand::set_internal_state (const uint32NDArray& s)
+void
+rand::set_internal_state (const uint32NDArray& s)
{
octave_idx_type len = s.numel ();
@@ -645,7 +673,8 @@
init_mersenne_twister (sdata, len);
}
-void rand::switch_to_generator (int dist)
+void
+rand::switch_to_generator (int dist)
{
if (dist != m_current_distribution)
{
@@ -655,7 +684,8 @@
}
}
-void rand::fill (octave_idx_type len, double *v, double a)
+void
+rand::fill (octave_idx_type len, double *v, double a)
{
if (len < 1)
return;
@@ -723,7 +753,8 @@
return;
}
-void rand::fill (octave_idx_type len, float *v, float a)
+void
+rand::fill (octave_idx_type len, float *v, float a)
{
if (len < 1)
return;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/oct-spparms.cc
--- a/liboctave/numeric/oct-spparms.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/oct-spparms.cc Tue Dec 12 21:18:18 2023 -0800
@@ -39,7 +39,8 @@
sparse_params *sparse_params::s_instance = nullptr;
-bool sparse_params::instance_ok ()
+bool
+sparse_params::instance_ok ()
{
bool retval = true;
@@ -52,56 +53,66 @@
return retval;
}
-void sparse_params::defaults ()
+void
+sparse_params::defaults ()
{
if (instance_ok ())
s_instance->do_defaults ();
}
-void sparse_params::tight ()
+void
+sparse_params::tight ()
{
if (instance_ok ())
s_instance->do_tight ();
}
-string_vector sparse_params::get_keys ()
+string_vector
+sparse_params::get_keys ()
{
return instance_ok () ? s_instance->do_get_keys () : string_vector ();
}
-ColumnVector sparse_params::get_vals ()
+ColumnVector
+sparse_params::get_vals ()
{
return instance_ok () ? s_instance->do_get_vals () : ColumnVector ();
}
-bool sparse_params::set_vals (const Array& vals)
+bool
+sparse_params::set_vals (const Array& vals)
{
return instance_ok () ? s_instance->do_set_vals (vals) : false;
}
-bool sparse_params::set_key (const std::string& key, const double& val)
+bool
+sparse_params::set_key (const std::string& key, const double& val)
{
return instance_ok () ? s_instance->do_set_key (key, val) : false;
}
-double sparse_params::get_key (const std::string& key)
+double
+sparse_params::get_key (const std::string& key)
{
return (instance_ok ()
? s_instance->do_get_key (key) : numeric_limits::NaN ());
}
-double sparse_params::get_bandden ()
+double
+sparse_params::get_bandden ()
{
return instance_ok () ? s_instance->do_get_bandden () : 0.0;
}
-void sparse_params::print_info (std::ostream& os, const std::string& prefix)
+void
+sparse_params::print_info (std::ostream& os, const std::string& prefix)
{
if (instance_ok ())
s_instance->do_print_info (os, prefix);
}
-void sparse_params::do_defaults ()
+void
+sparse_params::do_defaults ()
{
m_params(0) = 0; // spumoni
m_params(1) = 1; // ths_rel
@@ -118,7 +129,8 @@
m_params(12) = 0.001; // sym_tol
}
-void sparse_params::do_tight ()
+void
+sparse_params::do_tight ()
{
m_params(0) = 0; // spumoni
m_params(1) = 1; // ths_rel
@@ -135,7 +147,8 @@
m_params(12) = 0.001; // sym_tol
}
-void sparse_params::init_keys ()
+void
+sparse_params::init_keys ()
{
m_keys(0) = "spumoni";
m_keys(1) = "ths_rel";
@@ -152,12 +165,14 @@
m_keys(12) = "sym_tol";
}
-double sparse_params::do_get_bandden ()
+double
+sparse_params::do_get_bandden ()
{
return m_params(10);
}
-bool sparse_params::do_set_vals (const Array& vals)
+bool
+sparse_params::do_set_vals (const Array& vals)
{
octave_idx_type len = vals.numel ();
@@ -171,7 +186,8 @@
return true;
}
-bool sparse_params::do_set_key (const std::string& key, const double& val)
+bool
+sparse_params::do_set_key (const std::string& key, const double& val)
{
for (int i = 0; i < OCTAVE_SPARSE_CONTROLS_SIZE; i++)
{
@@ -185,7 +201,8 @@
return false;
}
-double sparse_params::do_get_key (const std::string& key)
+double
+sparse_params::do_get_key (const std::string& key)
{
for (int i = 0; i < OCTAVE_SPARSE_CONTROLS_SIZE; i++)
{
@@ -196,8 +213,9 @@
return numeric_limits::NaN ();
}
-void sparse_params::do_print_info (std::ostream& os,
- const std::string& prefix) const
+void
+sparse_params::do_print_info (std::ostream& os,
+ const std::string& prefix) const
{
for (int i = 0; i < OCTAVE_SPARSE_CONTROLS_SIZE; i++)
os << prefix << m_keys(i) << ": " << m_params(i) << "\n";
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/randmtzig.cc
--- a/liboctave/numeric/randmtzig.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/randmtzig.cc Tue Dec 12 21:18:18 2023 -0800
@@ -197,7 +197,8 @@
static int inittf = 1;
/* initializes state[MT_N] with a seed */
-void init_mersenne_twister (const uint32_t s)
+void
+init_mersenne_twister (const uint32_t s)
{
int j;
state[0] = s & 0xffffffffUL;
@@ -217,7 +218,8 @@
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
-void init_mersenne_twister (const uint32_t *init_key, const int key_length)
+void
+init_mersenne_twister (const uint32_t *init_key, const int key_length)
{
int i, j, k;
init_mersenne_twister (19650218UL);
@@ -257,7 +259,8 @@
initf = 1;
}
-void init_mersenne_twister ()
+void
+init_mersenne_twister ()
{
uint32_t entropy[MT_N];
int n = 0;
@@ -308,20 +311,23 @@
init_mersenne_twister (entropy, n);
}
-void set_mersenne_twister_state (const uint32_t *save)
+void
+set_mersenne_twister_state (const uint32_t *save)
{
std::copy_n (save, MT_N, state);
left = save[MT_N];
next = state + (MT_N - left + 1);
}
-void get_mersenne_twister_state (uint32_t *save)
+void
+get_mersenne_twister_state (uint32_t *save)
{
std::copy_n (state, MT_N, save);
save[MT_N] = left;
}
-static void next_state ()
+static void
+next_state ()
{
uint32_t *p = state;
int j;
@@ -346,7 +352,8 @@
}
/* generates a random number on [0,0xffffffff]-interval */
-static uint32_t randmt ()
+static uint32_t
+randmt ()
{
uint32_t y;
@@ -366,7 +373,8 @@
/* Select which 32 bit generator to use */
#define randi32 randmt
-static uint64_t randi53 ()
+static uint64_t
+randi53 ()
{
const uint32_t lo = randi32 ();
const uint32_t hi = randi32 () & 0x1FFFFF;
@@ -381,7 +389,8 @@
#endif
}
-static uint64_t randi54 ()
+static uint64_t
+randi54 ()
{
const uint32_t lo = randi32 ();
const uint32_t hi = randi32 () & 0x3FFFFF;
@@ -397,7 +406,8 @@
}
/* generates a random number on (0,1)-real-interval */
-static float randu24 ()
+static float
+randu24 ()
{
uint32_t i;
@@ -411,7 +421,8 @@
}
/* generates a random number on (0,1) with 53-bit resolution */
-static double randu53 ()
+static double
+randu53 ()
{
int32_t a, b;
@@ -503,7 +514,8 @@
so I'm not going to try and optimize further.
*/
-void create_ziggurat_tables ()
+void
+create_ziggurat_tables ()
{
int i;
double x, x1;
@@ -582,10 +594,12 @@
*/
-template <> OCTAVE_API double rand_normal ()
+template <>
+OCTAVE_API double
+rand_normal ()
{
- if (initt)
- create_ziggurat_tables ();
+ if (initt)
+ create_ziggurat_tables ();
while (1)
{
@@ -646,10 +660,12 @@
}
}
-template <> OCTAVE_API double rand_exponential ()
+template <>
+OCTAVE_API double
+rand_exponential ()
{
- if (initt)
- create_ziggurat_tables ();
+ if (initt)
+ create_ziggurat_tables ();
while (1)
{
@@ -674,17 +690,17 @@
template <> OCTAVE_API void rand_uniform (octave_idx_type n, double *p)
{
- std::generate_n (p, n, []() { return rand_uniform (); });
+ std::generate_n (p, n, []() { return rand_uniform (); });
}
template <> OCTAVE_API void rand_normal (octave_idx_type n, double *p)
{
- std::generate_n (p, n, []() { return rand_normal (); });
+ std::generate_n (p, n, []() { return rand_normal (); });
}
template <> OCTAVE_API void rand_exponential (octave_idx_type n, double *p)
{
- std::generate_n (p, n, []() { return rand_exponential (); });
+ std::generate_n (p, n, []() { return rand_exponential (); });
}
#undef ZIGINT
@@ -706,7 +722,8 @@
static ZIGINT fke[ZIGGURAT_TABLE_SIZE];
static float fwe[ZIGGURAT_TABLE_SIZE], ffe[ZIGGURAT_TABLE_SIZE];
-static void create_ziggurat_float_tables ()
+static void
+create_ziggurat_float_tables ()
{
int i;
float x, x1;
@@ -784,10 +801,12 @@
* distribution is exp(-0.5*x*x)
*/
-template <> OCTAVE_API float rand_normal ()
+template <>
+OCTAVE_API float
+rand_normal ()
{
- if (inittf)
- create_ziggurat_float_tables ();
+ if (inittf)
+ create_ziggurat_float_tables ();
while (1)
{
@@ -824,10 +843,12 @@
}
}
-template <> OCTAVE_API float rand_exponential ()
+template <>
+OCTAVE_API float
+rand_exponential ()
{
- if (inittf)
- create_ziggurat_float_tables ();
+ if (inittf)
+ create_ziggurat_float_tables ();
while (1)
{
@@ -852,17 +873,17 @@
template <> OCTAVE_API void rand_uniform (octave_idx_type n, float *p)
{
- std::generate_n (p, n, []() { return rand_uniform (); });
+ std::generate_n (p, n, []() { return rand_uniform (); });
}
template <> OCTAVE_API void rand_normal (octave_idx_type n, float *p)
{
- std::generate_n (p, n, []() { return rand_normal (); });
+ std::generate_n (p, n, []() { return rand_normal (); });
}
template <> OCTAVE_API void rand_exponential (octave_idx_type n, float *p)
{
- std::generate_n (p, n, []() { return rand_exponential (); });
+ std::generate_n (p, n, []() { return rand_exponential (); });
}
OCTAVE_END_NAMESPACE(octave)
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/numeric/randpoisson.cc
--- a/liboctave/numeric/randpoisson.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/numeric/randpoisson.cc Tue Dec 12 21:18:18 2023 -0800
@@ -49,7 +49,8 @@
/* ---- pprsc.c from Stadloeber's winrand --- */
/* flogfak(k) = ln(k!) */
-static double flogfak (double k)
+static double
+flogfak (double k)
{
#define C0 9.18938533204672742e-01
#define C1 8.33333333333333333e-02
@@ -115,12 +116,14 @@
* *
******************************************************************/
-static double f (double k, double l_nu, double c_pm)
+static double
+f (double k, double l_nu, double c_pm)
{
return exp (k * l_nu - flogfak (k) - c_pm);
}
-static double pprsc (double my)
+static double
+pprsc (double my)
{
static double my_last = -1.0;
static double m, k2, k4, k1, k5;
@@ -395,7 +398,9 @@
* and large enough. */
/* Generate a set of poisson numbers with the same distribution */
-template void rand_poisson (T L_arg, octave_idx_type n, T *p)
+template
+void
+rand_poisson (T L_arg, octave_idx_type n, T *p)
{
double L = L_arg;
octave_idx_type i;
@@ -430,7 +435,9 @@
template void rand_poisson (float, octave_idx_type, float *);
/* Generate one poisson variate */
-template T rand_poisson (T L_arg)
+template
+T
+rand_poisson (T L_arg)
{
double L = L_arg;
T ret;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/operators/mx-inlines.cc
--- a/liboctave/operators/mx-inlines.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/operators/mx-inlines.cc Tue Dec 12 21:18:18 2023 -0800
@@ -44,7 +44,8 @@
// Provides some commonly repeated, basic loop templates.
template
-inline void mx_inline_fill (std::size_t n, R *r, S s)
+inline void
+mx_inline_fill (std::size_t n, R *r, S s)
{
for (std::size_t i = 0; i < n; i++)
r[i] = s;
@@ -178,13 +179,15 @@
}
template
-void mx_inline_not (std::size_t n, bool *r, const X *x)
+void
+mx_inline_not (std::size_t n, bool *r, const X *x)
{
for (std::size_t i = 0; i < n; i++)
r[i] = ! logical_value (x[i]);
}
-inline void mx_inline_not2 (std::size_t n, bool *r)
+inline void
+mx_inline_not2 (std::size_t n, bool *r)
{
for (std::size_t i = 0; i < n; i++)
r[i] = ! r[i];
@@ -306,7 +309,7 @@
template
inline bool
-mx_inline_all_real (std::size_t n, const std::complex* x)
+mx_inline_all_real (std::size_t n, const std::complex *x)
{
for (std::size_t i = 0; i < n; i++)
{
@@ -318,14 +321,16 @@
}
template
-inline void mx_inline_real (std::size_t n, T *r, const std::complex* x)
+inline void
+mx_inline_real (std::size_t n, T *r, const std::complex *x)
{
for (std::size_t i = 0; i < n; i++)
r[i] = x[i].real ();
}
template
-inline void mx_inline_imag (std::size_t n, T *r, const std::complex* x)
+inline void
+mx_inline_imag (std::size_t n, T *r, const std::complex *x)
{
for (std::size_t i = 0; i < n; i++)
r[i] = x[i].imag ();
@@ -442,14 +447,16 @@
// Arbitrary function appliers.
// The function is a template parameter to enable inlining.
template
-inline void mx_inline_map (std::size_t n, R *r, const X *x)
+inline void
+mx_inline_map (std::size_t n, R *r, const X *x)
{
for (std::size_t i = 0; i < n; i++)
r[i] = fcn (x[i]);
}
template
-inline void mx_inline_map (std::size_t n, R *r, const X *x)
+inline void
+mx_inline_map (std::size_t n, R *r, const X *x)
{
for (std::size_t i = 0; i < n; i++)
r[i] = fcn (x[i]);
@@ -586,7 +593,8 @@
// NOTE: we don't use std::norm because it typically does some heavyweight
// magic to avoid underflows, which we don't need here.
template
-inline T cabsq (const std::complex& c)
+inline T
+cabsq (const std::complex& c)
{
return c.real () * c.real () + c.imag () * c.imag ();
}
@@ -1436,9 +1444,10 @@
}
template
-void mx_inline_diff (const T *v, T *r,
- octave_idx_type m, octave_idx_type n,
- octave_idx_type order)
+void
+mx_inline_diff (const T *v, T *r,
+ octave_idx_type m, octave_idx_type n,
+ octave_idx_type order)
{
switch (order)
{
@@ -1691,8 +1700,9 @@
// SIAM J. Sci. Computing, Vol. 26, 2005
template
-inline void twosum_accum (T& s, T& e,
- const T& x)
+inline void
+twosum_accum (T& s, T& e,
+ const T& x)
{
T s1 = s + x;
T t = s1 - s;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/system/child-list.cc
--- a/liboctave/system/child-list.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/system/child-list.cc Tue Dec 12 21:18:18 2023 -0800
@@ -37,12 +37,14 @@
m_list.remove_if ([pid] (const child& oc) { return oc.m_pid == pid; });
}
-void child_list::child_list::insert (pid_t pid, child::child_event_handler f)
+void
+child_list::child_list::insert (pid_t pid, child::child_event_handler f)
{
m_list.append (child (pid, f));
}
-void child_list::reap ()
+void
+child_list::reap ()
{
// Mark the record for PID invalid.
@@ -70,7 +72,8 @@
// Wait on our children and record any changes in their status.
-bool child_list::wait ()
+bool
+child_list::wait ()
{
bool retval = false;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/system/file-ops.cc
--- a/liboctave/system/file-ops.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/system/file-ops.cc Tue Dec 12 21:18:18 2023 -0800
@@ -228,7 +228,8 @@
#endif
}
-char dir_sep_char ()
+char
+dir_sep_char ()
{
#if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
return '\\';
@@ -237,7 +238,8 @@
#endif
}
-std::string dir_sep_str ()
+std::string
+dir_sep_str ()
{
#if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
return R"(\)";
@@ -246,7 +248,8 @@
#endif
}
-std::string dir_sep_chars ()
+std::string
+dir_sep_chars ()
{
#if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM)
return R"(/\)";
@@ -263,7 +266,8 @@
string_vector tilde_additional_suffixes = default_suffixes;
-bool is_dev_sep (char c)
+bool
+is_dev_sep (char c)
{
#if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
return c == dev_sep_char ();
@@ -274,13 +278,15 @@
#endif
}
-bool is_dir_sep (char c)
+bool
+is_dir_sep (char c)
{
std::string tmp = dir_sep_chars ();
return tmp.find (c) != std::string::npos;
}
-std::string tilde_expand (const std::string& name)
+std::string
+tilde_expand (const std::string& name)
{
if (name.find ('~') == std::string::npos)
return std::string (name);
@@ -336,7 +342,8 @@
}
}
-string_vector tilde_expand (const string_vector& names)
+string_vector
+tilde_expand (const string_vector& names)
{
int n = names.numel ();
@@ -348,7 +355,8 @@
return retval;
}
-std::string concat (const std::string& dir, const std::string& file)
+std::string
+concat (const std::string& dir, const std::string& file)
{
return dir.empty ()
? file
@@ -357,14 +365,16 @@
: dir + dir_sep_char () + file);
}
-std::string dirname (const std::string& path)
+std::string
+dirname (const std::string& path)
{
std::size_t ipos = path.find_last_of (dir_sep_chars ());
return (ipos != std::string::npos) ? path.substr (0, ipos) : "";
}
-std::string tail (const std::string& path)
+std::string
+tail (const std::string& path)
{
std::size_t ipos = path.find_last_of (dir_sep_chars ());
@@ -376,7 +386,8 @@
return path.substr (ipos);
}
-std::string native_separator_path (const std::string& path)
+std::string
+native_separator_path (const std::string& path)
{
std::string retval;
@@ -405,7 +416,8 @@
return mkdir (nm, md, msg);
}
-int mkdir (const std::string& name, mode_t mode, std::string& msg)
+int
+mkdir (const std::string& name, mode_t mode, std::string& msg)
{
msg = "";
@@ -417,13 +429,15 @@
return status;
}
-int recursive_mkdir (const std::string& name, mode_t mode)
+int
+recursive_mkdir (const std::string& name, mode_t mode)
{
std::string msg;
return recursive_mkdir (name, mode, msg);
}
-int recursive_mkdir (const std::string& name, mode_t mode, std::string& msg)
+int
+recursive_mkdir (const std::string& name, mode_t mode, std::string& msg)
{
int status;
@@ -470,13 +484,15 @@
return mkdir (name, mode, msg);
}
-int mkfifo (const std::string& nm, mode_t md)
+int
+mkfifo (const std::string& nm, mode_t md)
{
std::string msg;
return mkfifo (nm, md, msg);
}
-int mkfifo (const std::string& name, mode_t mode, std::string& msg)
+int
+mkfifo (const std::string& name, mode_t mode, std::string& msg)
{
msg = "";
@@ -488,14 +504,16 @@
return status;
}
-int link (const std::string& old_name, const std::string& new_name)
+int
+link (const std::string& old_name, const std::string& new_name)
{
std::string msg;
return link (old_name, new_name, msg);
}
-int link (const std::string& old_name, const std::string& new_name,
- std::string& msg)
+int
+link (const std::string& old_name, const std::string& new_name,
+ std::string& msg)
{
msg = "";
@@ -509,14 +527,16 @@
return status;
}
-int symlink (const std::string& old_name, const std::string& new_name)
+int
+symlink (const std::string& old_name, const std::string& new_name)
{
std::string msg;
return symlink (old_name, new_name, msg);
}
-int symlink (const std::string& old_name, const std::string& new_name,
- std::string& msg)
+int
+symlink (const std::string& old_name, const std::string& new_name,
+ std::string& msg)
{
msg = "";
@@ -530,13 +550,15 @@
return status;
}
-int readlink (const std::string& path, std::string& result)
+int
+readlink (const std::string& path, std::string& result)
{
std::string msg;
return readlink (path, result, msg);
}
-int readlink (const std::string& path, std::string& result, std::string& msg)
+int
+readlink (const std::string& path, std::string& result, std::string& msg)
{
int status = -1;
@@ -556,14 +578,16 @@
return status;
}
-int rename (const std::string& from, const std::string& to)
+int
+rename (const std::string& from, const std::string& to)
{
std::string msg;
return rename (from, to, msg);
}
-int rename (const std::string& from, const std::string& to,
- std::string& msg)
+int
+rename (const std::string& from, const std::string& to,
+ std::string& msg)
{
int status = -1;
@@ -603,13 +627,15 @@
return status;
}
-int rmdir (const std::string& name)
+int
+rmdir (const std::string& name)
{
std::string msg;
return rmdir (name, msg);
}
-int rmdir (const std::string& name, std::string& msg)
+int
+rmdir (const std::string& name, std::string& msg)
{
msg = "";
@@ -625,13 +651,15 @@
// And a version that works recursively.
-int recursive_rmdir (const std::string& name)
+int
+recursive_rmdir (const std::string& name)
{
std::string msg;
return recursive_rmdir (name, msg);
}
-int recursive_rmdir (const std::string& name, std::string& msg)
+int
+recursive_rmdir (const std::string& name, std::string& msg)
{
msg = "";
@@ -689,18 +717,21 @@
return status;
}
-int umask (mode_t mode)
+int
+umask (mode_t mode)
{
return octave_umask_wrapper (mode);
}
-int unlink (const std::string& name)
+int
+unlink (const std::string& name)
{
std::string msg;
return unlink (name, msg);
}
-int unlink (const std::string& name, std::string& msg)
+int
+unlink (const std::string& name, std::string& msg)
{
msg = "";
@@ -714,14 +745,16 @@
return status;
}
-std::string tempnam (const std::string& dir, const std::string& pfx)
+std::string
+tempnam (const std::string& dir, const std::string& pfx)
{
std::string msg;
return tempnam (dir, pfx, msg);
}
-std::string tempnam (const std::string& dir, const std::string& pfx,
- std::string& msg)
+std::string
+tempnam (const std::string& dir, const std::string& pfx,
+ std::string& msg)
{
msg = "";
@@ -761,13 +794,15 @@
return retval;
}
-std::string canonicalize_file_name (const std::string& name)
+std::string
+canonicalize_file_name (const std::string& name)
{
std::string msg;
return canonicalize_file_name (name, msg);
}
-std::string canonicalize_file_name (const std::string& name, std::string& msg)
+std::string
+canonicalize_file_name (const std::string& name, std::string& msg)
{
msg = "";
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/system/lo-sysdep.cc
--- a/liboctave/system/lo-sysdep.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/system/lo-sysdep.cc Tue Dec 12 21:18:18 2023 -0800
@@ -184,7 +184,8 @@
#if defined (OCTAVE_USE_WINDOWS_API)
-static bool check_fseek_ftell_workaround_needed (bool set_nonbuffered_mode)
+static bool
+check_fseek_ftell_workaround_needed (bool set_nonbuffered_mode)
{
// To check whether the workaround is needed:
//
@@ -432,7 +433,8 @@
// Return TRUE if FILE1 and FILE2 refer to the same (physical) file.
-bool same_file (const std::string& file1, const std::string& file2)
+bool
+same_file (const std::string& file1, const std::string& file2)
{
#if defined (OCTAVE_USE_WINDOWS_API)
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/system/lo-sysinfo.cc
--- a/liboctave/system/lo-sysinfo.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/system/lo-sysinfo.cc Tue Dec 12 21:18:18 2023 -0800
@@ -160,7 +160,8 @@
return retval;
}
-std::string lapack_version ()
+std::string
+lapack_version ()
{
std::string retval = "unknown LAPACK";
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/system/mach-info.cc
--- a/liboctave/system/mach-info.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/system/mach-info.cc Tue Dec 12 21:18:18 2023 -0800
@@ -57,33 +57,38 @@
}
}
-static bool is_big_endian ()
+static bool
+is_big_endian ()
{
return octave_is_big_endian ();
}
-float_format native_float_format ()
+float_format
+native_float_format ()
{
static float_format fmt = get_float_format ();
return fmt;
}
-bool words_big_endian ()
+bool
+words_big_endian ()
{
static bool big_endian = is_big_endian ();
return big_endian;
}
-bool words_little_endian ()
+bool
+words_little_endian ()
{
static bool little_endian = ! is_big_endian ();
return little_endian;
}
-float_format string_to_float_format (const std::string& s)
+float_format
+string_to_float_format (const std::string& s)
{
float_format retval = flt_fmt_unknown;
@@ -102,7 +107,8 @@
return retval;
}
-std::string float_format_as_string (float_format flt_fmt)
+std::string
+float_format_as_string (float_format flt_fmt)
{
std::string retval = "unknown";
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/file-info.cc
--- a/liboctave/util/file-info.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/file-info.cc Tue Dec 12 21:18:18 2023 -0800
@@ -72,7 +72,8 @@
// Read entire file called fname and return the contents as a string
-std::string file_info::snarf_file (const std::string& fname)
+std::string
+file_info::snarf_file (const std::string& fname)
{
std::string retval;
@@ -103,7 +104,8 @@
return retval;
}
-std::vector file_info::get_line_offsets (const std::string& buf)
+std::vector
+file_info::get_line_offsets (const std::string& buf)
{
std::deque tmp_offsets;
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/glob-match.cc
--- a/liboctave/util/glob-match.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/glob-match.cc Tue Dec 12 21:18:18 2023 -0800
@@ -71,7 +71,8 @@
#endif
}
-bool symbol_match::match (const std::string& sym)
+bool
+symbol_match::match (const std::string& sym)
{
#if defined (OCTAVE_USE_WINDOWS_API)
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/lo-error.h
--- a/liboctave/util/lo-error.h Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/lo-error.h Tue Dec 12 21:18:18 2023 -0800
@@ -46,13 +46,11 @@
typedef void (*liboctave_error_handler) (const char *, ...);
-typedef void (*liboctave_error_with_id_handler) (const char *, const char *,
- ...);
+typedef void (*liboctave_error_with_id_handler) (const char *, const char *, ...);
typedef void (*liboctave_warning_handler) (const char *, ...);
-typedef void (*liboctave_warning_with_id_handler) (const char *, const char *,
- ...);
+typedef void (*liboctave_warning_with_id_handler) (const char *, const char *, ...);
/* Would be nice to make these pointers private, but we want to share
them among all the liboctave classes. */
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/lo-utils.cc
--- a/liboctave/util/lo-utils.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/lo-utils.cc Tue Dec 12 21:18:18 2023 -0800
@@ -52,26 +52,30 @@
return math::isnan (x) || math::x_nint (x) == x;
}
-bool too_large_for_float (double x)
+bool
+too_large_for_float (double x)
{
return (math::isfinite (x)
&& fabs (x) > std::numeric_limits::max ());
}
-bool too_large_for_float (const Complex& x)
+bool
+too_large_for_float (const Complex& x)
{
return (too_large_for_float (x.real ())
|| too_large_for_float (x.imag ()));
}
-bool is_int_or_inf_or_nan (float x)
+bool
+is_int_or_inf_or_nan (float x)
{
return math::isnan (x) || math::x_nint (x) == x;
}
// Save a string.
-char * strsave (const char *s)
+char *
+strsave (const char *s)
{
if (! s)
return nullptr;
@@ -82,13 +86,15 @@
return tmp;
}
-std::string fgets (FILE *f)
+std::string
+fgets (FILE *f)
{
bool eof;
return fgets (f, eof);
}
-std::string fgets (FILE *f, bool& eof)
+std::string
+fgets (FILE *f, bool& eof)
{
eof = false;
@@ -162,13 +168,15 @@
return retval;
}
-std::string fgetl (FILE *f)
+std::string
+fgetl (FILE *f)
{
bool eof;
return fgetl (f, eof);
}
-std::string fgetl (FILE *f, bool& eof)
+std::string
+fgetl (FILE *f, bool& eof)
{
std::string retval = fgets (f, eof);
@@ -432,7 +440,8 @@
// Note: precision is supposed to be managed outside of this function by
// setting stream parameters.
-template <> OCTAVE_API void
+template <>
+OCTAVE_API void
write_value (std::ostream& os, const double& value)
{
if (lo_ieee_is_NA (value))
@@ -445,7 +454,8 @@
os << value;
}
-template <> OCTAVE_API void
+template <>
+OCTAVE_API void
write_value (std::ostream& os, const Complex& value)
{
os << '(';
@@ -458,7 +468,8 @@
// Note: precision is supposed to be managed outside of this function by
// setting stream parameters.
-template <> OCTAVE_API void
+template <>
+OCTAVE_API void
write_value (std::ostream& os, const float& value)
{
if (lo_ieee_is_NA (value))
@@ -471,7 +482,8 @@
os << value;
}
-template <> OCTAVE_API void
+template <>
+OCTAVE_API void
write_value (std::ostream& os, const FloatComplex& value)
{
os << '(';
@@ -483,40 +495,43 @@
OCTAVE_BEGIN_NAMESPACE(math)
- bool int_multiply_overflow (int a, int b, int *r)
+ bool
+ int_multiply_overflow (int a, int b, int *r)
{
return octave_i_multiply_overflow_wrapper (a, b, r);
}
- bool int_multiply_overflow (long int a, long int b, long int *r)
+ bool
+ int_multiply_overflow (long int a, long int b, long int *r)
{
return octave_li_multiply_overflow_wrapper (a, b, r);
}
#if defined (OCTAVE_HAVE_LONG_LONG_INT)
- bool int_multiply_overflow (long long int a, long long int b,
- long long int *r)
+ bool
+ int_multiply_overflow (long long int a, long long int b, long long int *r)
{
return octave_lli_multiply_overflow_wrapper (a, b, r);
}
#endif
- bool int_multiply_overflow (unsigned int a, unsigned int b,
- unsigned int *r)
+ bool
+ int_multiply_overflow (unsigned int a, unsigned int b, unsigned int *r)
{
return octave_ui_multiply_overflow_wrapper (a, b, r);
}
- bool int_multiply_overflow (unsigned long int a, unsigned long int b,
- unsigned long int *r)
+ bool
+ int_multiply_overflow (unsigned long int a, unsigned long int b,
+ unsigned long int *r)
{
return octave_uli_multiply_overflow_wrapper (a, b, r);
}
#if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
- bool int_multiply_overflow (unsigned long long int a,
- unsigned long long int b,
- unsigned long long int *r)
+ bool
+ int_multiply_overflow (unsigned long long int a, unsigned long long int b,
+ unsigned long long int *r)
{
return octave_ulli_multiply_overflow_wrapper (a, b, r);
}
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/oct-inttypes.h
--- a/liboctave/util/oct-inttypes.h Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/oct-inttypes.h Tue Dec 12 21:18:18 2023 -0800
@@ -124,7 +124,7 @@
{
// Promote to int?
static const bool s_pint = (sizeof (T1) < sizeof (int)
- && sizeof (T2) < sizeof (int));
+ && sizeof (T2) < sizeof (int));
static const bool s_t1sig = std::numeric_limits::is_signed;
static const bool s_t2sig = std::numeric_limits::is_signed;
@@ -258,7 +258,8 @@
\
template \
static OCTAVE_API bool external_mop (T, double)
- OCTAVE_DECLARE_EXTERNAL_LONG_DOUBLE_INT_CMP_OPS (int64_t);
+
+ OCTAVE_DECLARE_EXTERNAL_LONG_DOUBLE_INT_CMP_OPS (int64_t);
OCTAVE_DECLARE_EXTERNAL_LONG_DOUBLE_INT_CMP_OPS (uint64_t);
#endif
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/oct-shlib.cc
--- a/liboctave/util/oct-shlib.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/oct-shlib.cc Tue Dec 12 21:18:18 2023 -0800
@@ -62,12 +62,14 @@
std::list possibly_unreferenced_dynamic_libraries;
-void dynamic_library::delete_later ()
+void
+dynamic_library::delete_later ()
{
possibly_unreferenced_dynamic_libraries.push_back (*this);
}
-int release_unreferenced_dynamic_libraries ()
+int
+release_unreferenced_dynamic_libraries ()
{
possibly_unreferenced_dynamic_libraries.clear ();
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/oct-sort.cc
--- a/liboctave/util/oct-sort.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/oct-sort.cc Tue Dec 12 21:18:18 2023 -0800
@@ -982,7 +982,8 @@
--na;
if (na == 0)
goto Succeed;
- } while (acount >= MIN_GALLOP || bcount >= MIN_GALLOP);
+ }
+ while (acount >= MIN_GALLOP || bcount >= MIN_GALLOP);
++min_gallop; /* penalize it for leaving galloping mode */
m_ms->m_min_gallop = min_gallop;
}
@@ -1125,7 +1126,8 @@
--na;
if (na == 0)
goto Succeed;
- } while (acount >= MIN_GALLOP || bcount >= MIN_GALLOP);
+ }
+ while (acount >= MIN_GALLOP || bcount >= MIN_GALLOP);
++min_gallop; /* penalize it for leaving galloping mode */
m_ms->m_min_gallop = min_gallop;
}
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/oct-string.cc
--- a/liboctave/util/oct-string.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/oct-string.cc Tue Dec 12 21:18:18 2023 -0800
@@ -898,11 +898,11 @@
&lengthp);
std::size_t ext_char;
for (ext_char = 0; ext_char < srclen; ext_char++)
- {
- if (offsets[ext_char] != static_cast (-1)
- && offsets[ext_char] >= max)
- break;
- }
+ {
+ if (offsets[ext_char] != static_cast (-1)
+ && offsets[ext_char] >= max)
+ break;
+ }
return ext_char;
}
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/pathsearch.cc
--- a/liboctave/util/pathsearch.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/pathsearch.cc Tue Dec 12 21:18:18 2023 -0800
@@ -47,12 +47,14 @@
init ();
}
-std::list directory_path::elements ()
+std::list
+directory_path::elements ()
{
return m_initialized ? m_path_elements : std::list ();
}
-std::list directory_path::all_directories ()
+std::list
+directory_path::all_directories ()
{
std::list retval;
@@ -70,12 +72,14 @@
return retval;
}
-std::string directory_path::find_first (const std::string& nm)
+std::string
+directory_path::find_first (const std::string& nm)
{
return m_initialized ? kpse_path_search (m_expanded_path, nm) : "";
}
-std::list directory_path::find_all (const std::string& nm)
+std::list
+directory_path::find_all (const std::string& nm)
{
return (m_initialized
? kpse_all_path_search (m_expanded_path, nm)
@@ -97,7 +101,8 @@
: std::list ());
}
-void directory_path::init ()
+void
+directory_path::init ()
{
static bool octave_kpse_initialized = false;
@@ -119,12 +124,14 @@
m_initialized = true;
}
-char directory_path::path_sep_char ()
+char
+directory_path::path_sep_char ()
{
return SEPCHAR;
}
-std::string directory_path::path_sep_str ()
+std::string
+directory_path::path_sep_str ()
{
return SEPCHAR_STR;
}
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/util/quit.cc
--- a/liboctave/util/quit.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/util/quit.cc Tue Dec 12 21:18:18 2023 -0800
@@ -78,7 +78,8 @@
return buf.str ();
}
-void execution_exception::display (std::ostream& os) const
+void
+execution_exception::display (std::ostream& os) const
{
if (! m_message.empty ())
{
@@ -113,7 +114,7 @@
sig_atomic_t curr_interrupt_state = octave_interrupt_state.load ();
while (curr_interrupt_state > 0 &&
- ! octave_interrupt_state.compare_exchange_weak (curr_interrupt_state, -1))
+ ! octave_interrupt_state.compare_exchange_weak (curr_interrupt_state, -1))
;
if (curr_interrupt_state > 0)
diff -r 05b4479c29d8 -r 3c2c585965cc liboctave/version.cc
--- a/liboctave/version.cc Tue Dec 12 18:24:05 2023 -0800
+++ b/liboctave/version.cc Tue Dec 12 21:18:18 2023 -0800
@@ -103,13 +103,13 @@
{
std::string sep = (html ? "\n
\n\n" : "\n");
std::string msg =
- (html ? "
\n" : "")
- + octave_name_version_copyright_copying_and_warranty (html, extra_info)
- + (html ? "" : "\n") + sep
- + octave_www_statement (html) + sep
- + octave_bugs_statement (html) + sep
- + octave_contrib_statement (html) + sep
- + (html ? "\n
" : "");
+ (html ? "\n" : "")
+ + octave_name_version_copyright_copying_and_warranty (html, extra_info)
+ + (html ? "" : "\n") + sep
+ + octave_www_statement (html) + sep
+ + octave_bugs_statement (html) + sep
+ + octave_contrib_statement (html) + sep
+ + (html ? "\n
" : "");
return msg;
}