BatchInterfaceAdaptStruct.h File Reference
#include <boost/fusion/sequence/intrinsic/swap.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/algorithm/transformation/transform.hpp>
#include <shark/Data/BatchInterface.h>
#include <boost/preprocessor/seq/transform.hpp>
#include "Impl/BoostFusion151DefineStructInl.hpp"

Go to the source code of this file.

Namespaces

 shark
 AbstractMultiObjectiveOptimizer.
 

Macros

#define SHARK_TRANSFORM_BATCH_ATTRIBUTES_TPL_IMPL(s, TYPE, ELEM)   ( typename Batch<BOOST_PP_TUPLE_ELEM(2, 0, ELEM)>::TYPE,BOOST_PP_TUPLE_ELEM(2, 1, ELEM))
 
#define SHARK_TRANSFORM_TUPLELIST_IMPL(s, data, ELEM)   BOOST_PP_TUPLE_ELEM(2, 0, ELEM),BOOST_PP_TUPLE_ELEM(2, 1, ELEM)
 
#define SHARK_TRANSFORM_TUPLELIST(ELEMS)   BOOST_PP_SEQ_TRANSFORM(SHARK_TRANSFORM_TUPLELIST_IMPL, _ , ELEMS)
 
#define SHARK_TRANSFORM_BATCH_ATTRIBUTES_TPL(TYPE, ATTRIBUTES)
 
#define SHARK_TRANSFORM_BATCH_ATTRIBUTES_IMPL(s, TYPE, ELEM)   ( Batch<BOOST_PP_TUPLE_ELEM(2, 0, ELEM)>::TYPE,BOOST_PP_TUPLE_ELEM(2, 1, ELEM))
 
#define SHARK_TRANSFORM_BATCH_ATTRIBUTES(TYPE, ATTRIBUTES)
 
#define SHARK_CREATE_BATCH_REFERENCES_TPL(ATTRIBUTES)
 creates default implementation for reference or const_reference types of Batches More...
 
#define SHARK_CREATE_BATCH_REFERENCES(ATTRIBUTES)
 
#define SHARK_CREATE_BATCH_ITERATORS()
 creates default typedefs for iterator or const_iterator types of Batches More...
 
#define SHARK_CREATE_BATCH_INTERFACE(NAME, ATTRIBUTES)
 This macro can be used to specialize a structure type easily to a batch type. More...
 
#define SHARK_CREATE_BATCH_INTERFACE_NO_TPL(NAME, ATTRIBUTES)
 This macro can be used to specialize a structure type easily to a batch type. More...
 

Functions

template<class S >
Sshark::fusionize (detail::FusionFacade< S > &facade)
 
template<class S >
S const & shark::fusionize (detail::FusionFacade< S > const &facade)
 
template<class S >
boost::disable_if< detail::isFusionFacade< S >, S & >::type shark::fusionize (S &facade)
 
template<class S >
boost::disable_if< detail::isFusionFacade< S >, S const &>::type shark::fusionize (S const &facade)
 

Macro Definition Documentation

◆ SHARK_CREATE_BATCH_INTERFACE

#define SHARK_CREATE_BATCH_INTERFACE (   NAME,
  ATTRIBUTES 
)

This macro can be used to specialize a structure type easily to a batch type.

Assume, that your input Data looks like: code> template<class T> struct DataType{ RealVector A; T B; }; /code> Than the Batch type should propably look like code> struct DataTypeBatch{ RealMatrix A; RealVector B; }; /code> In this case the macro can be used to generate a complete specialisation of Batch<DataType> code> define DataVars (RealVector, A)(double B)

SHARK_CREATE_BATCH_INTERFACE( DataType,DataVars) }; As any other batch model th result also offers iterators over the range of elements. In this case also boost::fusion support is added to the sequence. e.g. it is handled similar to any other tuple type (RealMatrix,RealVector). This is useful for MKL or Transfer kernels /code>

Definition at line 316 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_CREATE_BATCH_INTERFACE_NO_TPL

#define SHARK_CREATE_BATCH_INTERFACE_NO_TPL (   NAME,
  ATTRIBUTES 
)

This macro can be used to specialize a structure type easily to a batch type.

Assume, thjat your input Data looks like: code> struct DataType{ RealVector A; double B; }; /code> Than the Batch type should propably look like code> struct DataTypeBatch{ RealMatrix A; RealVector B; }; /code> In this case the macro can be used to generate a complete specialisation of Batch<DataType> code> define DataVars (RealVector, A)(double B)

SHARK_CREATE_BATCH_INTERFACE( DataType,DataVars) }; As any other batch model the result also offers iterators over the range of elements. In this case also boost::fusion support is added to the sequence. e.g. it is handled similar to any other tuple type (RealMatrix,RealVector). This is useful for MKL or Transfer kernels /code>

Definition at line 432 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_CREATE_BATCH_ITERATORS

#define SHARK_CREATE_BATCH_ITERATORS ( )
Value:
typedef ProxyIterator<type, value_type, reference > iterator;\
typedef ProxyIterator<const type, value_type, const_reference > const_iterator;\
iterator begin(){\
return iterator(*this,0);\
}\
const_iterator begin()const{\
return const_iterator(*this,0);\
}\
iterator end(){\
return iterator(*this,size());\
}\
const_iterator end()const{\
return const_iterator(*this,size());\
}\

creates default typedefs for iterator or const_iterator types of Batches

Definition at line 273 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_CREATE_BATCH_REFERENCES

#define SHARK_CREATE_BATCH_REFERENCES (   ATTRIBUTES)

Definition at line 229 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_CREATE_BATCH_REFERENCES_TPL

#define SHARK_CREATE_BATCH_REFERENCES_TPL (   ATTRIBUTES)

creates default implementation for reference or const_reference types of Batches

Definition at line 188 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_TRANSFORM_BATCH_ATTRIBUTES

#define SHARK_TRANSFORM_BATCH_ATTRIBUTES (   TYPE,
  ATTRIBUTES 
)
Value:
SHARK_TRANSFORM_TUPLELIST(BOOST_PP_SEQ_TRANSFORM(\
TYPE, BOOST_PP_CAT(SHARK_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)))

Definition at line 182 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_TRANSFORM_BATCH_ATTRIBUTES_IMPL

#define SHARK_TRANSFORM_BATCH_ATTRIBUTES_IMPL (   s,
  TYPE,
  ELEM 
)    ( Batch<BOOST_PP_TUPLE_ELEM(2, 0, ELEM)>::TYPE,BOOST_PP_TUPLE_ELEM(2, 1, ELEM))

Definition at line 179 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_TRANSFORM_BATCH_ATTRIBUTES_TPL

#define SHARK_TRANSFORM_BATCH_ATTRIBUTES_TPL (   TYPE,
  ATTRIBUTES 
)
Value:
SHARK_TRANSFORM_TUPLELIST(BOOST_PP_SEQ_TRANSFORM(\
TYPE, BOOST_PP_CAT(SHARK_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)))

Definition at line 174 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_TRANSFORM_BATCH_ATTRIBUTES_TPL_IMPL

#define SHARK_TRANSFORM_BATCH_ATTRIBUTES_TPL_IMPL (   s,
  TYPE,
  ELEM 
)    ( typename Batch<BOOST_PP_TUPLE_ELEM(2, 0, ELEM)>::TYPE,BOOST_PP_TUPLE_ELEM(2, 1, ELEM))

Definition at line 166 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_TRANSFORM_TUPLELIST

#define SHARK_TRANSFORM_TUPLELIST (   ELEMS)    BOOST_PP_SEQ_TRANSFORM(SHARK_TRANSFORM_TUPLELIST_IMPL, _ , ELEMS)

Definition at line 171 of file BatchInterfaceAdaptStruct.h.

◆ SHARK_TRANSFORM_TUPLELIST_IMPL

#define SHARK_TRANSFORM_TUPLELIST_IMPL (   s,
  data,
  ELEM 
)    BOOST_PP_TUPLE_ELEM(2, 0, ELEM),BOOST_PP_TUPLE_ELEM(2, 1, ELEM)

Definition at line 169 of file BatchInterfaceAdaptStruct.h.