Commit 90fc33fd authored by incardon's avatar incardon

Fixing se_class1 run

parent fdbeb251
......@@ -3,7 +3,7 @@
AC_PREREQ(2.59)
AC_INIT(OpenFPM_data, 0.8.0, BUG-REPORT-ADDRESS)
AC_INIT(OpenFPM_data, 1.0.0, BUG-REPORT-ADDRESS)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/main.cpp])
......
......@@ -484,17 +484,29 @@ template<unsigned int dim, typename g> void test_layout_gridNd(g & c3, size_t sz
}
}
auto key_it = c3.getSubIterator(start,stop);
bool make_test = true;
while (key_it.isNext())
#ifdef SE_CLASS1
if (c3.size() == 0)
{make_test = false;}
#endif
if (make_test == true)
{
grid_key_dx<dim> kk = key_it.get();
auto key_it = c3.getSubIterator(start,stop);
BOOST_REQUIRE_EQUAL(c3.template get<P::x>(kk),0.0);
while (key_it.isNext())
{
grid_key_dx<dim> kk = key_it.get();
BOOST_REQUIRE_EQUAL(c3.template get<P::x>(kk),0.0);
c3.template get<P::x>(kk) = 1.0;
c3.template get<P::x>(kk) = 1.0;
++key_it;
++key_it;
}
}
}
}
......
......@@ -172,8 +172,10 @@ struct call_encapUnpack
template<typename obj_type, typename Mem>
struct call_packRequest_agg_functor
{
//! object to pack
const obj_type & obj;
//! offset of the packed memory
size_t & req;
call_packRequest_agg_functor(const obj_type & obj, size_t & req)
......@@ -196,6 +198,12 @@ struct call_packRequest_agg_functor
template<typename obj_type, typename Mem, int ... prp>
struct call_aggregatePackRequest
{
/*! \brief Pack the object
*
* \param obj object to pack
* \param req offset of the packed memory
*
*/
static inline void call_packRequest(const obj_type & obj, size_t & req)
{
//Property sequence into boost::mpl::range_c or boost::mpl::vector, depending on sizeof...(prp)
......@@ -232,10 +240,17 @@ struct call_pack_agg_functor
}
};
//Calls a packer in nested way
//! Calls a packer in nested way
template<typename obj_type, typename Mem, int ... prp>
struct call_aggregatePack
{
/*! \brief Call the packer
*
* \param obj object to pack
* \param mem memory where to pack
* \param sts information about the packing
*
*/
static inline void call_pack(const obj_type & obj, ExtPreAlloc<Mem> & mem, Pack_stat & sts)
{
//Property sequence into boost::mpl::range_c or boost::mpl::vector, depending on sizeof...(prp)
......@@ -253,10 +268,22 @@ struct call_aggregatePack
template<typename obj_type, typename Mem>
struct call_unpack_agg_functor
{
//! Memory where to pack
ExtPreAlloc<Mem> & mem;
//! object to pack
const obj_type & obj;
//! statistic about packing
Unpack_stat & ps;
/*! \brief constructor
*
* \param mem memory where to pack
* \param obj object to pack
* \param ps packing statistic
*
*/
call_unpack_agg_functor(ExtPreAlloc<Mem> & mem, const obj_type & obj, Unpack_stat & ps)
:mem(mem), obj(obj), ps(ps)
{
......@@ -273,10 +300,17 @@ struct call_unpack_agg_functor
}
};
//Calls an unpacker in nested way
//! Calls an unpacker in nested way
template<typename obj_type, typename Mem, int ... prp>
struct call_aggregateUnpack
{
/*! \brief constructor
*
* \param mem memory from where to unpack
* \param obj object to pack
* \param ps packing statistic
*
*/
static inline void call_unpack(const obj_type & obj, ExtPreAlloc<Mem> & mem, Unpack_stat & ps)
{
//Property sequence into boost::mpl::range_c or boost::mpl::vector, depending on sizeof...(prp)
......
......@@ -14,6 +14,7 @@
#define OBJECT_ADD false
#define VECTOR_ADD true
//! struct to merge two vectors
template<bool objv, typename vect_dst>
struct add_prp_impl
{
......@@ -28,7 +29,8 @@ struct add_prp_impl
* \tparam gp Grow policy of the source vector
* \tparam args one or more number that define which property to set-up
*
* \param v source vector
* \param v_src source vector
* \param v_dst destination vector
*
*/
template <typename S, typename M, typename gp, unsigned int impl, unsigned int ...args> inline static void add(const vector<S,M,typename memory_traits_lin<S>::type,memory_traits_lin,gp,impl> & v_src, vect_dst & v_dst)
......@@ -49,7 +51,7 @@ struct add_prp_impl
}
};
//! struct to merge two vectors
template<typename vect_dst>
struct add_prp_impl<OBJECT_ADD,vect_dst>
{
......@@ -848,7 +850,7 @@ public:
/*! \brief Check that two vectors are equal
*
* \param vector to compare
* \param v vector to compare
*
* \return true if they differs
*
......@@ -860,7 +862,7 @@ public:
/*! \brief Check that two vectors are not equal
*
* \param vector to compare
* \param v vector to compare
*
* \return true if the vector match
*
......@@ -870,7 +872,7 @@ public:
return base == v.base;
}
/*! \brief Get iterator
/*! \brief Get an iterator over all the elements of the vector
*
* \return an iterator
*
......@@ -883,7 +885,7 @@ public:
return vector_key_iterator(base.size());
}
/*! \brief Get iterator until a specified key
/*! \brief Get iterator until a specified element
*
* \param k key
*
......
......@@ -26,31 +26,35 @@ template<int ...> struct index_tuple{};
//! the array itself
template<class T, int... args> struct ArrayHolder_indexes {
//! convert variadic into a tuple struct containing the list
typedef index_tuple<args ... > type;
};
//! generate compile time index array
template<class T,long int N, size_t orig_N, template<size_t,size_t> class F, int... args>
struct generate_indexes_impl {
//! Metafunction to generate indexes
typedef typename generate_indexes_impl<T,N-1,orig_N, F, F<N,orig_N>::value, args...>::result result;
};
//! terminator of the variadic template
template<class T, size_t orig_N, template<size_t,size_t> class F, int... args>
struct generate_indexes_impl<T,0,orig_N, F, args...> {
//! generate the compile-time array
typedef typename ArrayHolder_indexes<T,F<0,orig_N>::value, args...>::type result;
};
//! In case of an empty list
template<class T, size_t orig_N, template<size_t,size_t> class F, int... args>
struct generate_indexes_impl<T,-1,orig_N, F, args...> {
//! empty array
typedef index_tuple<> result;
};
/*! \brief Main class to generate indexes data structure
*
*
* ### Metafunction definition
* ### Meta-function definition
* \snippet util_test.hpp Metafunction definition
* ### Usage
* \snippet util_test.hpp indexes array
......@@ -62,6 +66,7 @@ struct generate_indexes_impl<T,-1,orig_N, F, args...> {
*/
template<class T, long int N, template<size_t,size_t> class F>
struct generate_indexes {
//! generate compile time array
typedef typename generate_indexes_impl<T,N-1, N, F>::result result;
};
......@@ -71,18 +76,21 @@ struct generate_indexes {
//! the array itself
template<class T, unsigned long... args> struct ArrayHolder_constexpr {
//! compile-time array
static constexpr T data[sizeof...(args)] = { args... };
};
//! recursive meta-function to generate compile-time array
template<class T,size_t N, size_t orig_N, template<size_t,size_t> class F, unsigned... args>
struct generate_array_constexpr_impl {
//! recursive meta-function to generate compile-time array
typedef typename generate_array_constexpr_impl<T,N-1,orig_N, F, F<N,orig_N>::value, args...>::result result;
};
//! terminator of the variadic template
template<class T, size_t orig_N, template<size_t,size_t> class F, unsigned... args>
struct generate_array_constexpr_impl<T,0,orig_N, F, args...> {
//! Compile-time array
typedef ArrayHolder_constexpr<T,F<0,orig_N>::value, args...> result;
};
......@@ -108,6 +116,7 @@ struct generate_array_constexpr_impl<T,0,orig_N, F, args...> {
*/
template<class T, size_t N, template<size_t,size_t> class F>
struct generate_array_constexpr {
//! meta-function to generate compile time array
typedef typename generate_array_constexpr_impl<T,N-1, N, F>::result result;
};
......@@ -127,12 +136,14 @@ const T ArrayHolder<T,args...>::data[sizeof...(args)] = { args... };
//! Generate the array specializing ArrayHolder
template<class T,size_t N, size_t orig_N, template<size_t,size_t> class F, unsigned... args>
struct generate_array_impl {
//! recursive meta-function to generate compile-time array
typedef typename generate_array_impl<T,N-1,orig_N, F, F<N,orig_N>::value, args...>::result result;
};
//! terminator of the variadic template
template<class T, size_t orig_N, template<size_t,size_t> class F, unsigned... args>
struct generate_array_impl<T,0,orig_N, F, args...> {
//! compile-time array
typedef ArrayHolder<T,F<0,orig_N>::value, args...> result;
};
......@@ -164,12 +175,14 @@ struct generate_array {
//! Generate the array specializing ArrayHolder
template<class T, size_t N ,class F, unsigned... args>
struct generate_array_vector_impl {
//! recursive meta-function to generate compile-time array
typedef typename generate_array_vector_impl<T,N-1,F, boost::mpl::at<F,boost::mpl::int_<N> >::type::value , args...>::result result;
};
//! terminator of the variadic template
template<class T, class F, unsigned... args>
struct generate_array_vector_impl<T,1, F, args...> {
//! compile-time array generation
typedef ArrayHolder<T,boost::mpl::at<F,boost::mpl::int_<1> >::type::value, args...> result;
};
......@@ -179,7 +192,7 @@ struct generate_array_vector_impl<T,1, F, args...> {
*
* Usage:
*
* boost::mpl::vector<int_<4>,int<4>,......> v
* boost::mpl::vector<int_<4>,int_<4>,......> v
*
* typdef generate_array_vector<size_t,v>::result B;
*
......@@ -191,6 +204,7 @@ struct generate_array_vector_impl<T,1, F, args...> {
*/
template<class T, class F>
struct generate_array_vector {
//! generate compile-time array vector
typedef typename generate_array_vector_impl<T,boost::mpl::size<F>::value-1 , F>::result result;
};
......
......@@ -389,8 +389,6 @@ BOOST_AUTO_TEST_CASE( object_prop_copy )
}
//! [Metafunction definition]
BOOST_AUTO_TEST_CASE( generate_array )
{
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment