Skip to content

Commit

Permalink
Merge pull request #85 from boostorg/develop
Browse files Browse the repository at this point in the history
Merge for 1.86
  • Loading branch information
mborland authored Jul 2, 2024
2 parents 1f4e47d + 0c4584c commit 1dd8f77
Show file tree
Hide file tree
Showing 28 changed files with 127 additions and 75 deletions.
67 changes: 47 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,53 @@ add_library(Boost::numeric_odeint ALIAS boost_numeric_odeint)

target_include_directories(boost_numeric_odeint INTERFACE include)

target_link_libraries(boost_numeric_odeint
INTERFACE
Boost::assert
Boost::compute
Boost::config
Boost::core
Boost::fusion
Boost::iterator
Boost::math
Boost::mpi
Boost::mpl
Boost::multi_array
Boost::numeric_ublas
Boost::preprocessor
Boost::range
Boost::throw_exception
Boost::type_traits
Boost::units
Boost::utility
)
if(BOOST_NUMERIC_ODEINT_NO_ADAPTORS)

target_link_libraries(boost_numeric_odeint
INTERFACE
Boost::assert
Boost::config
Boost::core
Boost::fusion
Boost::iterator
Boost::math
Boost::mpl
Boost::multi_array
Boost::numeric_ublas
Boost::preprocessor
Boost::range
Boost::static_assert
Boost::throw_exception
Boost::type_traits
Boost::units
Boost::utility
)

else()

target_link_libraries(boost_numeric_odeint
INTERFACE
Boost::assert
Boost::compute
Boost::config
Boost::core
Boost::fusion
Boost::iterator
Boost::math
Boost::mpi
Boost::mpl
Boost::multi_array
Boost::numeric_ublas
Boost::preprocessor
Boost::range
Boost::static_assert
Boost::throw_exception
Boost::type_traits
Boost::units
Boost::utility
)

endif()

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")

Expand Down
2 changes: 1 addition & 1 deletion doc/concepts/state_wrapper.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The `State Wrapper` concept describes the way odeint creates temporary state obj

[table
[[Name] [Expression] [Type] [Semantics]]
[[Get resizeability] [`is_resizeable< State >`] [`boost::false_type` or `boost::true_type`] [Returns `boost::true_type` if the `State` is resizeable, `boost::false_type` otherwise.]]
[[Get resizeability] [`is_resizeable< State >`] [`std::false_type` or `std::true_type`] [Returns `std::true_type` if the `State` is resizeable, `std::false_type` otherwise.]]
[[Create `WrappedState` type] [`state_wrapper< State >`] [`WrappedState`] [Creates the type for a `WrappedState` for the state type `State`]]
[[Constructor] [`WrappedState()`] [`WrappedState`] [Constructs a state wrapper with an empty state]]
[[Copy Constructor] [`WrappedState( w )`] [`WrappedState`] [Constructs a state wrapper with a state of the same size as the state in `w`]]
Expand Down
6 changes: 3 additions & 3 deletions doc/details_state_types_algebras_operations.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ First, the state has to be tagged as resizeable by specializing the struct
[table
[[Name] [Expression] [Type] [Semantics]]
[[Resizability] [`is_resizeable<State>::type`]
[`boost::true_type` or `boost::false_type`]
[Determines resizeability of the state type, returns `boost::true_type` if
[`std::true_type` or `std::false_type`]
[Determines resizeability of the state type, returns `std::true_type` if
the state is resizeable.]]
[[Resizability] [`is_resizeable<State>::value`]
[`bool`]
Expand Down Expand Up @@ -242,7 +242,7 @@ sized objects:
template<>
struct is_resizeable< gsl_vector* >
{
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

Expand Down
6 changes: 3 additions & 3 deletions examples/2d_lattice/vector_vector_resize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#define VECTOR_VECTOR_RESIZE_HPP

#include <vector>

#include <type_traits>
#include <boost/range.hpp>

namespace boost { namespace numeric { namespace odeint {

template<>
struct is_resizeable< std::vector< std::vector< double > > >
{
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

Expand Down Expand Up @@ -65,7 +65,7 @@ struct state_wrapper< std::vector< std::vector< double > > >
{
typedef std::vector< std::vector< double > > state_type;
typedef state_wrapper< state_type > state_wrapper_type;
typedef boost::true_type is_resizeable;
typedef std::true_type is_resizeable;

state_type m_v;

Expand Down
4 changes: 2 additions & 2 deletions examples/const_step_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const double b = 8.0 / 3.0;
struct lorenz
{
template< class State , class Deriv >
void operator()( const State &x , Deriv &dxdt , double t ) const
void operator()( const State &x , Deriv &dxdt , double ) const
{
dxdt[0] = sigma * ( x[1] - x[0] );
dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
Expand All @@ -51,7 +51,7 @@ struct lorenz



int main( int argc , char **argv )
int main()
{
typedef std::array< double , 3 > state_type;

Expand Down
2 changes: 1 addition & 1 deletion examples/list_lattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace boost { namespace numeric { namespace odeint {
template< >
struct is_resizeable< state_type >
{ // declare resizeability
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

Expand Down
2 changes: 1 addition & 1 deletion examples/my_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace boost { namespace numeric { namespace odeint {
template<size_t N>
struct is_resizeable< my_vector<N> >
{
typedef boost::true_type type;
typedef std::true_type type;
static const bool value = type::value;
};

Expand Down
4 changes: 2 additions & 2 deletions examples/stuart_landau.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct stuart_landau
stuart_landau( double eta = 1.0 , double alpha = 1.0 )
: m_eta( eta ) , m_alpha( alpha ) { }

void operator()( const state_type &x , state_type &dxdt , double t ) const
void operator()( const state_type &x , state_type &dxdt , double ) const
{
const complex< double > I( 0.0 , 1.0 );
dxdt = ( 1.0 + m_eta * I ) * x - ( 1.0 + m_alpha * I ) * norm( x ) * x;
Expand Down Expand Up @@ -71,7 +71,7 @@ struct streaming_observer



int main( int argc , char **argv )
int main()
{
//[ stuart_landau_integration
state_type x = complex< double >( 1.0 , 0.0 );
Expand Down
4 changes: 2 additions & 2 deletions examples/two_dimensional_phase_lattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class write_snapshots

write_snapshots( void ) : m_count( 0 ) { }

void operator()( const state_type &x , double t )
void operator()( const state_type &x , double )
{
map< size_t , string >::const_iterator it = m_snapshots.find( m_count );
if( it != m_snapshots.end() )
Expand Down Expand Up @@ -126,7 +126,7 @@ class write_snapshots
};


int main( int argc , char **argv )
int main()
{
size_t size1 = 128 , size2 = 128;
state_type x( size1 , size2 , 0.0 );
Expand Down
6 changes: 3 additions & 3 deletions examples/van_der_pol_stiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef boost::numeric::ublas::matrix< double > matrix_type;

struct vdp_stiff
{
void operator()( const vector_type &x , vector_type &dxdt , double t )
void operator()( const vector_type &x , vector_type &dxdt , double )
{
dxdt[0] = x[1];
dxdt[1] = -x[0] - mu * x[1] * (x[0]*x[0]-1.0);
Expand All @@ -42,7 +42,7 @@ struct vdp_stiff

struct vdp_stiff_jacobi
{
void operator()( const vector_type &x , matrix_type &J , const double &t , vector_type &dfdt )
void operator()( const vector_type &x , matrix_type &J , const double & , vector_type &dfdt )
{
J(0, 0) = 0.0;
J(0, 1) = 1.0;
Expand All @@ -55,7 +55,7 @@ struct vdp_stiff_jacobi
};


int main( int argc , char **argv )
int main()
{
//[ integrate_stiff_system
vector_type x( 2 );
Expand Down
4 changes: 3 additions & 1 deletion include/boost/numeric/odeint/external/blaze/blaze_resize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@

#include <blaze/math/dense/DynamicVector.h>

#include <type_traits>

namespace boost {
namespace numeric {
namespace odeint {

template< typename T , bool TF >
struct is_resizeable< blaze::DynamicVector< T , TF > >
{
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@

#include <boost/numeric/odeint/util/copy.hpp>

#include <type_traits>

namespace boost {
namespace numeric {
namespace odeint {

template< class T, class A >
struct is_resizeable< boost::compute::vector< T , A > >
{
struct type : public boost::true_type { };
struct type : public std::true_type { };
const static bool value = type::value;
};

Expand Down
7 changes: 4 additions & 3 deletions include/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/numeric/mtl/matrix/dense2D.hpp>
#include <boost/numeric/mtl/matrix/compressed2D.hpp>

#include <type_traits>

namespace boost {
namespace numeric {
Expand All @@ -33,21 +34,21 @@ namespace odeint {
template< class Value , class Parameters >
struct is_resizeable< mtl::dense_vector< Value , Parameters > >
{
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

template< class Value , class Parameters >
struct is_resizeable< mtl::dense2D< Value , Parameters > >
{
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

template< class Value , class Parameters >
struct is_resizeable< mtl::compressed2D< Value , Parameters > >
{
typedef boost::true_type type;
typedef std::true_type type;
const static bool value = type::value;
};

Expand Down
4 changes: 3 additions & 1 deletion include/boost/numeric/odeint/external/nt2/nt2_resize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

#include <boost/numeric/odeint/util/same_size.hpp>

#include <type_traits>

namespace boost { namespace numeric { namespace odeint {

template<typename T, typename S>
struct is_resizeable< nt2::container::table<T,S> >
{
typedef boost::true_type type;
typedef std::true_type type;
static const bool value = type::value;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <omp.h>
#include <vector>
#include <algorithm>
#include <type_traits>
#include <boost/range/adaptor/sliced.hpp>
#include <boost/numeric/odeint/util/copy.hpp>
#include <boost/numeric/odeint/util/split.hpp>
Expand Down Expand Up @@ -56,7 +57,7 @@ struct openmp_state : public std::vector< std::vector< T > >


template< class T >
struct is_resizeable< openmp_state< T > > : boost::true_type { };
struct is_resizeable< openmp_state< T > > : std::true_type { };


template< class T >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED

#include <type_traits>

#include <boost/range.hpp>

#include <thrust/device_vector.h>
Expand All @@ -38,7 +40,7 @@ namespace odeint {
template< class T , class A > \
struct is_resizeable< THRUST_VECTOR<T,A> > \
{ \
struct type : public boost::true_type { }; \
struct type : public std::true_type { }; \
const static bool value = type::value; \
}; \

Expand Down
6 changes: 4 additions & 2 deletions include/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED

#include <type_traits>

#include <vexcl/vector.hpp>
#include <vexcl/multivector.hpp>

Expand All @@ -36,7 +38,7 @@ namespace odeint {
* specializations for vex::vector< T >
*/
template< typename T >
struct is_resizeable< vex::vector< T > > : boost::true_type { };
struct is_resizeable< vex::vector< T > > : std::true_type { };

template< typename T >
struct resize_impl< vex::vector< T > , vex::vector< T > >
Expand Down Expand Up @@ -64,7 +66,7 @@ struct same_size_impl< vex::vector< T > , vex::vector< T > >
* specializations for vex::multivector< T >
*/
template< typename T , size_t N >
struct is_resizeable< vex::multivector< T , N > > : boost::true_type { };
struct is_resizeable< vex::multivector< T , N > > : std::true_type { };

template< typename T , size_t N >
struct resize_impl< vex::multivector< T , N > , vex::multivector< T , N > >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED

#include <type_traits>

#include <viennacl/vector.hpp>

#include <boost/numeric/odeint/util/is_resizeable.hpp>
Expand All @@ -35,7 +37,7 @@ namespace odeint {
* specializations for viennacl::vector< T >
*/
template< typename T >
struct is_resizeable< viennacl::vector< T > > : boost::true_type { };
struct is_resizeable< viennacl::vector< T > > : std::true_type { };

template< typename T >
struct resize_impl< viennacl::vector< T > , viennacl::vector< T > >
Expand Down
Loading

0 comments on commit 1dd8f77

Please sign in to comment.