Skip to content

Commit

Permalink
changed writeToStream to write_to_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
ebertolazzi committed Apr 1, 2022
1 parent 562568a commit 2374e98
Show file tree
Hide file tree
Showing 26 changed files with 81 additions and 79 deletions.
4 changes: 2 additions & 2 deletions cmake/CMakeLists-cflags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ set( VS_WARN "")

if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
set( CMAKE_CXX_FLAGS "-std=c++11 ${CXX_WARN}" )
set( CMAKE_CXX_FLAGS_RELEASE "-fPIC -fopenmp -O2 -g -floop-interchange -floop-block -funroll-loops " )
set( CMAKE_CXX_FLAGS_RELEASE "-fPIC -fopenmp -O2 -g " )
set( CMAKE_CXX_FLAGS_DEBUG "-fPIC -fopenmp -O0 -ggdb -DMECHATRONIX_DEBUG -DDEBUG " )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CLANG_WARN}" )
set( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Os -g -finline-functions -finline-hint-functions -funroll-loops -fcolor-diagnostics " )
set( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Os -g -fcolor-diagnostics " )
set( CMAKE_CXX_FLAGS_DEBUG "-fPIC -O0 -gfull -fcolor-diagnostics -DMECHATRONIX_DEBUG -DDEBUG " )
elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
set( CMAKE_CXX_FLAGS " ${VS_WARN}" )
Expand Down
10 changes: 5 additions & 5 deletions src/SplineAkima2D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -286,16 +286,16 @@ namespace Splines {

#endif

//!
//!
//! This subroutine estimates three partial derivatives, zx, zy, and
//! zxy, of a bivariate function, z(x,y), on a rectangular grid in
//! the x-y plane. It is based on the revised Akima method that has
//! the accuracy of a bicubic polynomial.
//!
//!
void
Akima2Dspline::makeSpline() {

size_t nn = size_t( m_nx*m_ny );
size_t nn = size_t( m_nx*m_ny );
m_mem_bicubic.reallocate( 3*nn );
m_DX = m_mem_bicubic( nn );
m_DY = m_mem_bicubic( nn );
Expand Down Expand Up @@ -392,7 +392,7 @@ namespace Splines {
}

void
Akima2Dspline::writeToStream( ostream_type & s ) const {
Akima2Dspline::write_to_stream( ostream_type & s ) const {
fmt::print( s, "Nx = {} Ny = {}\n", m_nx, m_ny );
for ( integer i = 1; i < m_nx; ++i ) {
for ( integer j = 1; j < m_ny; ++j ) {
Expand Down
4 changes: 2 additions & 2 deletions src/SplineBiCubic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
BiCubicSpline::writeToStream( ostream_type & s ) const {
BiCubicSpline::write_to_stream( ostream_type & s ) const {
fmt::print( "Nx = {} Ny = {}\n", m_nx, m_ny );
for ( integer i = 1; i < m_nx; ++i ) {
for ( integer j = 1; j < m_ny; ++j ) {
Expand Down
4 changes: 2 additions & 2 deletions src/SplineBiQuintic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
BiQuinticSpline::writeToStream( ostream_type & s ) const {
BiQuinticSpline::write_to_stream( ostream_type & s ) const {
fmt::print( s, "Nx = {} Ny = {}\n", m_nx, m_ny );
for ( integer i = 1; i < m_nx; ++i ) {
for ( integer j = 1; j < m_ny; ++j ) {
Expand Down
4 changes: 2 additions & 2 deletions src/SplineBilinear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -119,7 +119,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
BilinearSpline::writeToStream( ostream_type & s ) const {
BilinearSpline::write_to_stream( ostream_type & s ) const {
fmt::print( s, "Nx = {} Ny = {}\n", m_nx, m_ny );
for ( integer i = 1; i < m_nx; ++i ) {
for ( integer j = 1; j < m_ny; ++j ) {
Expand Down
2 changes: 1 addition & 1 deletion src/SplineConstant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
ConstantSpline::writeToStream( ostream_type & s ) const {
ConstantSpline::write_to_stream( ostream_type & s ) const {
size_t nseg = size_t(m_npts > 0 ? m_npts - 1 : 0);
for ( size_t i = 0; i < nseg; ++i )
fmt::print( s,
Expand Down
4 changes: 2 additions & 2 deletions src/SplineCubicBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -272,7 +272,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
CubicSplineBase::writeToStream( ostream_type & s ) const {
CubicSplineBase::write_to_stream( ostream_type & s ) const {
size_t nseg = size_t( m_npts > 0 ? m_npts - 1 : 0 );
for ( size_t i = 0; i < nseg; ++i )
fmt::print( s,
Expand Down
2 changes: 1 addition & 1 deletion src/SplineLinear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
LinearSpline::writeToStream( ostream_type & s ) const {
LinearSpline::write_to_stream( ostream_type & s ) const {
integer nseg = m_npts > 0 ? m_npts - 1 : 0;
for ( integer i = 0; i < nseg; ++i )
fmt::print( s,
Expand Down
6 changes: 3 additions & 3 deletions src/SplineQuinticBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ namespace Splines {
real_type a, b, c, d, e, f;
Hermite5_to_poly(
H,
m_Y[i], m_Y[i+1],
m_Yp[i], m_Yp[i+1],
m_Y[i], m_Y[i+1],
m_Yp[i], m_Yp[i+1],
m_Ypp[i], m_Ypp[i+1],
a, b, c, d, e, f
);
Expand Down Expand Up @@ -289,7 +289,7 @@ namespace Splines {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void
QuinticSplineBase::writeToStream( ostream_type & s ) const {
QuinticSplineBase::write_to_stream( ostream_type & s ) const {
size_t nseg = size_t(m_npts > 0 ? m_npts - 1 : 0);
for ( size_t i = 0; i < nseg; ++i )
fmt::print( s,
Expand Down
8 changes: 5 additions & 3 deletions src/Splines.hh
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ namespace Splines {
//!
//! Print spline coefficients
//!
virtual void writeToStream( ostream_type & s ) const = 0;
virtual void write_to_stream( ostream_type & s ) const = 0;
void writeToStream( ostream_type & s ) const { write_to_stream(s); }

///@}

Expand Down Expand Up @@ -1000,7 +1001,7 @@ namespace Splines {
real_type id_DDDDD( integer, real_type ) const override { return 0; }
///@}

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;

// --------------------------- VIRTUALS -----------------------------------

Expand Down Expand Up @@ -1546,7 +1547,8 @@ namespace Splines {
//!
//! Print spline coefficients.
//!
virtual void writeToStream( ostream_type & s ) const = 0;
virtual void write_to_stream( ostream_type & s ) const = 0;
void writeToStream( ostream_type & s ) const { write_to_stream(s); }

//!
//! Return spline type as a string pointer.
Expand Down
16 changes: 8 additions & 8 deletions src/Splines/SplineAkima2D.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand All @@ -28,15 +28,15 @@

namespace Splines {

//!
//!
//! Smooth Curve Fitting Based on Local Procedures
//!
//!
//! *Reference*
//!
//! - *Hiroshi Akima*, A Method of Bivariate Interpolation and
//! Smooth Surface Fitting for Irregularly Distributed Data Points.
//!
//! - *Hiroshi Akima*, A Method of Bivariate Interpolation and
//! Smooth Surface Fitting for Irregularly Distributed Data Points.
//! ACM Transactions on Mathematical Software, Vol.4, 148-164, 1978.
//!
//!
class Akima2Dspline : public BiCubicSplineBase {
void makeSpline() override;

Expand All @@ -51,7 +51,7 @@ namespace Splines {

~Akima2Dspline() override {}

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;
char const * type_name() const override;

};
Expand Down
8 changes: 4 additions & 4 deletions src/Splines/SplineBiCubic.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -61,7 +61,7 @@ namespace Splines {
{}

~BiCubicSplineBase() override {}

//!
//! \name Estimated derivatives at interpolation nodes
//!
Expand Down Expand Up @@ -95,7 +95,7 @@ namespace Splines {
real_type Dxx( real_type x, real_type y ) const override;
real_type Dxy( real_type x, real_type y ) const override;
real_type Dyy( real_type x, real_type y ) const override;
///@}
///@}
};

/*\
Expand Down Expand Up @@ -128,7 +128,7 @@ namespace Splines {

~BiCubicSpline() override {}

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;
char const * type_name() const override;

};
Expand Down
4 changes: 2 additions & 2 deletions src/Splines/SplineBiQuintic.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -114,7 +114,7 @@ namespace Splines {

~BiQuinticSpline() override {}

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;
char const * type_name() const override;

};
Expand Down
4 changes: 2 additions & 2 deletions src/Splines/SplineBilinear.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| |
| , __ , __ |
| /|/ \ /|/ \ |
| | __/ _ ,_ | __/ _ ,_ |
| | __/ _ ,_ | __/ _ ,_ |
| | \|/ / | | | | \|/ / | | | |
| |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
| /| /| |
Expand Down Expand Up @@ -60,7 +60,7 @@ namespace Splines {
real_type Dxy( real_type , real_type ) const override { return 0; }
real_type Dyy( real_type , real_type ) const override { return 0; }

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;
char const * type_name() const override;

};
Expand Down
2 changes: 1 addition & 1 deletion src/Splines/SplineConstant.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace Splines {
real_type id_DDD( integer, real_type ) const override { return 0; }
///@}

void writeToStream( ostream_type & ) const override;
void write_to_stream( ostream_type & ) const override;
unsigned type() const override { return CONSTANT_TYPE; }

// --------------------------- VIRTUALS -----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Splines/SplineLinear.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Splines {
real_type id_DD( integer, real_type ) const override { return 0; }
real_type id_DDD( integer, real_type ) const override { return 0; }

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;
unsigned type() const override { return LINEAR_TYPE; }

// --------------------------- VIRTUALS -----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Splines/SplineQuinticBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace Splines {
vector<real_type> & y_max
) const override;

void writeToStream( ostream_type & s ) const override;
void write_to_stream( ostream_type & s ) const override;

unsigned type() const override { return QUINTIC_TYPE; }

Expand Down
4 changes: 2 additions & 2 deletions src/Splines/Splines1D.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ namespace Splines {
//! Print spline coefficients.
//!
void
writeToStream( ostream_type & s ) const
{ return m_pSpline->writeToStream( s ); }
write_to_stream( ostream_type & s ) const
{ return m_pSpline->write_to_stream( s ); }

//!
//! Return spline typename.
Expand Down
4 changes: 2 additions & 2 deletions src/Splines/Splines2D.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ namespace Splines {
//! Print spline coefficients.
//!
void
writeToStream( ostream_type & s ) const
{ return m_spline_2D->writeToStream( s ); }
write_to_stream( ostream_type & s ) const
{ return m_spline_2D->write_to_stream( s ); }

//!
//! Return spline typename
Expand Down
Loading

0 comments on commit 2374e98

Please sign in to comment.