Aboria

PrevUpHomeNext

API Overview

libaboria

Header: <Aboria.h>

Utility

Level 1 - Data structures

Table 2. Creating a particle set

Class Name

Description

Aboria::Particles

The main particle set container, implemented as a zipped set of vectors

Aboria::Variable

Objects of this class are normally never created. Instead, this class is used as a "tag" type, and is used to name variables that are added to the particle set

ABORIA_VARIABLE

This is a pre-processor macro that creates a Aboria::Variable class, use this rather than using Aboria::Variable directly


Table 3. Getting particles and variables

Class Name

Description

Aboria::getter_type

This is used to refer to an individual particle in a Aboria::Particles. It implements a tuple of values or references, or pointers, that are or point to the variables of that particle. When you use the Aboria::Particles::operator[] operator, you get a Aboria::getter_type that contains references to that particle's variables

Aboria::get

This function is used to "get" a variable from a Aboria::getter_type. It it used in a similar fashion to the std::get function, but takes a Aboria::Variable type as the template argument instead of an int

Aboria::zip_iterator

This class is an iterator for the Aboria::Particles class. It points to a single particle within the particle set. Dereferencing it gives you a Aboria::getter_type that contains references to the particle's variables


Table 4. Neighbourhood Search Data Structures

Class Name

Description

Aboria::CellList

This spatial data structure implements a cell list. That is, it divides the space into a regular grid of cells, or buckets, that contain particles. This is the default spatial data structure used within Aboria::Particles

Aboria::CellListOrdered

This is similar to CellList, but uses the ordering of the particles in Aboria::Particles to implement the cell list data structure. This makes it more suitable for parallel computation, but not suitable for particles that change their positions rapidly

Aboria::Kdtree

This implements a kdtree spatial data structure.

Aboria::KdtreeNanoflann

This implements a kdtree spatial data structure. Note that this wraps the Nanoflann library <https://github.com/jlblancoc/nanoflann> for tree construction, but Aboria routines are used for all queries.

Aboria::HyperOctree

This implements a hyper oct-tree data structure

Aboria::CellListQuery

Aboria::Particles::get_query returns a query object that can be used to query the spatial data structure for that particle set. This is the query object for the serial cell lists data structure

Aboria::CellListOrderedQuery

This is the query object for the Aboria::CellListOrdered data structure

Aboria::KdtreeQuery

This is the query object for the kd-tree data structure

Aboria::KdtreeNanoflannQuery

This is the query object for the kd-tree data structure

Aboria::HyperOctreeQuery

This is the query object for the hyper oct-tree data structure


Table 5. Internal Traits for Level 0 vector

Aboria::Traits<std::vector>

To use a STL compatible vector to construct a Aboria::Particles, a specialisation of Aboria::Traits must exist


Level 2 - Algorithms

Table 6. Neighbourhood Searching

Class Name

Description

Aboria::distance_search

performs a distance search around a given point, using a given p-norm for the distance measure

Aboria::euclidean_search

performs a distance search around a given point, using euclidean distance

Aboria::manhatten_search

performs a distance search around a given point, using manhatten distance

Aboria::chebyshev_search

performs a distance search around a given point, using chebyshev distance


Table 7. Kernel Approximations

Class Name

Description

Aboria::FastMultipoleMethod

Class used to perform a fast multipole method. Takes a set of expansions that are used to approximate the kernel function

Aboria::make_fmm

Helper class that returns a Aboria::FastMultipoleMethod

Aboria::make_black_box_expansion

Returns a set of expansions for the black box fast multipole method. Uses chebyshev interpolation to approximate a kernel function

Aboria::H2LibMatrix

Same as Aboria::FastMultipoleMethod, but stores the action of the kernel operator as a hierarchical H2 matrix using H2Lib, for repeated applications

Aboria::make_h2lib_matrix

Helper class that returns a Aboria::H2LibMatrix

Aboria::make_h2lib_black_box_expansion

Returns a set of expansions for the black box fast multipole method, designed to be used in conjunction with Aboria::H2LibMatrix


Level 3 - Kernel Operators

Table 8. Eigen Wrapping

Class Name

Description

Aboria::MatrixReplacement

This is a matrix replacement class that can be used within the Eigen linear algebra library. It follows the layout given in the Eigen documentation for matrix-free operators. Note that this "matrix" can only be used in a matrix-vector multiply with a standard Eigen vector, or in Eigen's iterative solvers


Table 9. Creating Eigen Kernel Operators

Class Name

Description

Aboria::create_dense_operator

Creates an instance of Aboria::MatrixReplacement. It takes a standard C++ function object or lambda expression

Aboria::create_sparse_operator

Creates an instance of Aboria::MatrixReplacement that implements a sparse matrix, where the elements are assumed zero for particle pairs that are separated by more than a given distance.

Aboria::create_zero_operator

Creates an instance of Aboria::MatrixReplacement that implements a zero matrix

Aboria::create_chebyshev_operator

Creates an instance of Aboria::MatrixReplacement. When multiplied by a vector, the result is approximated using Chebyshev interpolation. This operator assumes that the row and column particle sets do not change

Aboria::create_fmm_operator

Creates an instance of Aboria::MatrixReplacement. When multiplied by a vector, the result is approximated using the black-box fast multipole method

Aboria::create_h2_operator

Creates an instance of Aboria::MatrixReplacement that wraps a H2 hierarchical matrix. When multiplied by a vector, the result is approximated using the black-box fast multipole method. Unlike Aboria::create_fmm_operator, this operator assumes that the row and column particle sets do not change

Aboria::create_block_operator

Takes one or more Aboria::MatrixReplacement instances and forms a $N \times M$ block operator


Level 3 - Symbolic particle-based DSL

Table 10. Creating expression terminals

Class Name

Description

Aboria::Symbol

An object of this class is a symbolic reference to a particle's variable. It is similar to Aboria::Variable, but unlike Aboria::Variable, objects can be created with type Aboria::Symbol, and then participate in symbolic expressions

Aboria::Label

An object of this class is a symbolic reference to a particle set, and can participate in symbolic expressions

Aboria::create_dx

A function that creates a symbolic reference to the shortest difference between two particle's positions. It takes two ::Label objects as its arguments

Aboria::Accumulate

An object of this class is a symbolic reference to a accumulation (e.g. a summation) over a particle set


Table 11. Symbolic functions

Class Name

Description

Aboria::norm

A lazy function that calculates the 2-norm of a vector

Aboria::inf_norm

A lazy function that calculates the inf-norm of a vector

Aboria::dot

A lazy function that calculates the dot product of two vectors

Aboria::exp

A lazy function that calculates the result of std::exp on a scalar

Aboria::pow

A lazy function that calculates the result of std::pow on a scalar

Aboria::abs

A lazy function that calculates the result of std::abs on a scalar

Aboria::log

A lazy function that calculates the result of std::log on a scalar

Aboria::erf

A lazy function that calculates the result of std::erf on a scalar

Aboria::sign

A lazy function that calculates the result of std::sign on a scalar


libaboria

Header </home/travis/build/martinjrobins/Aboria/src/CellList.h>
Header </home/travis/build/martinjrobins/Aboria/src/CellListOrdered.h>
Header </home/travis/build/martinjrobins/Aboria/src/Chebyshev.h>
Header </home/travis/build/martinjrobins/Aboria/src/Evaluate.h>
Header </home/travis/build/martinjrobins/Aboria/src/FastMultipoleMethod.h>
Header </home/travis/build/martinjrobins/Aboria/src/Functions.h>
Header </home/travis/build/martinjrobins/Aboria/src/Get.h>
Header </home/travis/build/martinjrobins/Aboria/src/H2Lib.h>
Header </home/travis/build/martinjrobins/Aboria/src/Kdtree.h>
Header </home/travis/build/martinjrobins/Aboria/src/Kernels.h>
Header </home/travis/build/martinjrobins/Aboria/src/LatticeIterator.h>
Header </home/travis/build/martinjrobins/Aboria/src/Log.h>
Header </home/travis/build/martinjrobins/Aboria/src/NanoFlannAdaptor.h>
Header </home/travis/build/martinjrobins/Aboria/src/NeighbourSearchBase.h>
Header </home/travis/build/martinjrobins/Aboria/src/OctTree.h>
Header </home/travis/build/martinjrobins/Aboria/src/Operators.h>
Header </home/travis/build/martinjrobins/Aboria/src/Particles.h>
Header </home/travis/build/martinjrobins/Aboria/src/Search.h>
Header </home/travis/build/martinjrobins/Aboria/src/SpatialUtil.h>
Header </home/travis/build/martinjrobins/Aboria/src/Symbolic.h>
Header </home/travis/build/martinjrobins/Aboria/src/Traits.h>
Header </home/travis/build/martinjrobins/Aboria/src/Transform.h>
Header </home/travis/build/martinjrobins/Aboria/src/Utils.h>
Header </home/travis/build/martinjrobins/Aboria/src/Variable.h>
Header </home/travis/build/martinjrobins/Aboria/src/Vector.h>
namespace Aboria {
  template<typename Traits> struct CellListQuery;

  template<typename Traits> class CellList;
}
namespace Aboria {
  template<typename Traits> struct CellListOrdered_params;
  template<typename Traits> struct CellListOrderedQuery;

  template<typename Traits> class CellListOrdered;
}
namespace Aboria {
  template<unsigned int D, typename InputIterator, typename OutputIterator, 
           typename PositionIterator, typename Kernel> 
    void chebyshev_interpolation(InputIterator input_iterator_begin, 
                                 InputIterator input_iterator_end, 
                                 OutputIterator output_iterator_begin, 
                                 OutputIterator output_iterator_end, 
                                 PositionIterator source_positions_begin, 
                                 PositionIterator target_positions_begin, 
                                 Kernel kernel, unsigned int n);
}
namespace Aboria {
  template<typename VariableType, typename Functor, typename ExprRHS, 
           typename LabelType> 
    void evaluate_nonlinear(ExprRHS const &, LabelType &);
}
namespace Aboria {
  template<typename Expansions, typename Kernel, typename RowParticles, 
           typename ColParticles> 
    class FastMultipoleMethod;
  template<unsigned int D, unsigned int N, typename Function, 
           typename KernelHelper = detail::position_kernel_helper<D, Function>, 
           typename Block = typename KernelHelper::Block> 
    unspecified make_black_box_expansion(const Function & function);
  template<typename Expansions, typename Kernel, typename RowParticles, 
           typename ColParticles> 
    FastMultipoleMethod< Expansions, Kernel, RowParticles, ColParticles > 
    make_fmm(const RowParticles & row_particles, 
             const ColParticles & col_particles, 
             const Expansions & expansions, const Kernel & kernel);
}

ABORIA_UNARY_FUNCTION(function_name, function_to_wrap, domain)
ABORIA_BINARY_FUNCTION(function_name, function_to_wrap, domain)
ABORIA_TERNARY_FUNCTION(function_name, function_to_wrap, domain)
ABORIA_TAGGED_FUNCTION(name, tag)
namespace Aboria {
  struct norm_fun;
  struct inf_norm_fun;
  struct dot_fun;
  struct exp_fun;
  struct sqrt_fun;
  struct sign_fun;
  struct erf_fun;
  struct erfc_fun;
  struct log_fun;
  struct abs_fun;
  struct pow_fun;
  template<typename T> struct reflect_fun;
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, norm_fun, Expr const & >::type const 
    norm(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, inf_norm_fun, Expr const & >::type const 
    inf_norm(Expr const &);
  template<typename Expr1, typename Expr2> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, dot_fun, Expr1 const &, Expr2 const & >::type const 
    dot(Expr1 const &, Expr2 const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, exp_fun, Expr const & >::type const 
    exp(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, sqrt_fun, Expr const & >::type const 
    sqrt(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, sign_fun, Expr const & >::type const 
    sign(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, erf_fun, Expr const & >::type const 
    erf(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, erfc_fun, Expr const & >::type const 
    erfc(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, log_fun, Expr const & >::type const 
    log(Expr const &);
  template<typename Expr> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, abs_fun, Expr const & >::type const 
    abs(Expr const &);
  template<typename Expr1, typename Expr2> 
    proto::result_of::make_expr< proto::tag::function, SymbolicDomain, pow_fun, Expr1 const &, Expr2 const & >::type const 
    pow(Expr1 const &, Expr2 const &);
   ABORIA_TERNARY_FUNCTION(reflect_, reflect_fun< Expr3 >, SymbolicDomain);
}
namespace Aboria {
  template<typename Tuple, typename MplVector> struct getter_type;

  template<typename iterator_tuple_type, typename mpl_vector_type> 
    class zip_iterator;

  template<typename TupleType, typename MplVector> struct zip_pointer;

  template<typename MplVector, typename... Types> 
    struct getter_type<std::tuple< Types...>, MplVector>;
  template<typename MplVector, typename TT1, typename TT2, typename TT3, 
           typename TT4, typename TT5, typename TT6, typename TT7, 
           typename TT8, typename TT9> 
    struct getter_type<thrust::tuple< TT1, TT2, TT3, TT4, TT5, TT6, TT7, TT8, TT9 >, MplVector>;
  template<typename MplVector, typename... Types> 
    struct zip_pointer<std::tuple< Types *...>, MplVector>;
  template<typename MplVector, typename TT1, typename TT2, typename TT3, 
           typename TT4, typename TT5, typename TT6, typename TT7, 
           typename TT8, typename TT9> 
    struct zip_pointer<thrust::tuple< TT1, TT2, TT3, TT4, TT5, TT6, TT7, TT8, TT9 >, MplVector>;

  template<typename mpl_vector_type, typename... Types> 
    class zip_iterator<std::tuple< Types...>, mpl_vector_type>;
  template<typename mpl_vector_type, typename... Types> 
    class zip_iterator<thrust::tuple< Types...>, mpl_vector_type>;
  template<typename tuple_type, typename tuple_type2, 
           typename mpl_vector_type> 
    unspecified swap(getter_type< tuple_type, mpl_vector_type > x, 
                     getter_type< tuple_type2, mpl_vector_type > & y);
  template<typename tuple_type, typename tuple_type2, 
           typename mpl_vector_type> 
    unspecified swap(getter_type< tuple_type, mpl_vector_type > & x, 
                     getter_type< tuple_type2, mpl_vector_type > y);
  template<typename tuple_type, typename mpl_vector_type> 
    void swap(getter_type< tuple_type, mpl_vector_type > x, 
              getter_type< tuple_type, mpl_vector_type > y);
  template<typename Iterator> auto iterator_to_raw_pointer(const Iterator &);
  template<typename T, typename ValueType> 
    ValueType::template return_type< T >::type const & get(const ValueType &);
  template<typename T, typename ValueType> 
    ValueType::template return_type< T >::type & get(ValueType &);
  template<typename T, typename ValueType> 
    ValueType::template return_type< T >::type & get(ValueType &&);
  template<unsigned int N, typename ValueType> 
    unspecified get_by_index(const ValueType &);
  template<unsigned int N, typename ValueType> 
    unspecified get_by_index(ValueType &);
  template<unsigned int N, typename ValueType> 
    unspecified get_by_index(ValueType &&);
}
namespace Aboria {
  class H2Lib_LR_Decomposition;
  class H2LibCholeskyDecomposition;
  class HLib_LR_Decomposition;
  class HLibCholeskyDecomposition;
  class H2LibMatrix;
  class HLibMatrix;
  template<unsigned int D, typename Function, 
           typename KernelHelper = detail::position_kernel_helper<D, Function>, 
           typename Block = typename KernelHelper::Block> 
    unspecified make_h2lib_black_box_expansion(size_t order, 
                                               const Function & function);
  template<typename Expansions, typename Kernel, typename RowParticlesType, 
           typename ColParticlesType> 
    HLibMatrix make_h2lib_h_matrix(const RowParticlesType & row_particles, 
                                   const ColParticlesType & col_particles, 
                                   const Expansions & expansions, 
                                   const Kernel & kernel);
  template<typename Expansions, typename Kernel, typename RowParticlesType, 
           typename ColParticlesType> 
    H2LibMatrix make_h2lib_matrix(const RowParticlesType & row_particles, 
                                  const ColParticlesType & col_particles, 
                                  const Expansions & expansions, 
                                  const Kernel & kernel, const double eta);
}
namespace Aboria {
  template<typename Traits> struct KdtreeQuery;

  template<typename Traits> class Kdtree;
  template<typename Query> class KdtreeChildIterator;
}
namespace Aboria {
  template<typename RowElements, typename ColElements, typename F> 
    class KernelBase;
  template<typename RowElements, typename ColElements, typename F> 
    class KernelDense;
  template<typename RowElements, typename ColElements, typename F> 
    class KernelMatrix;
  template<typename RowElements, typename ColElements, typename PositionF, 
           size_t QuadratureOrder = 8, 
           typename F = detail::position_kernel<RowElements, ColElements, PositionF> > 
    class KernelChebyshev;
  template<typename RowElements, typename ColElements, typename PositionF, 
           typename F> 
    class KernelH2;
  template<typename RowElements, typename ColElements, typename PositionF, 
           typename F, unsigned int N> 
    class KernelFMM;
  template<typename RowElements, typename ColElements, typename FRadius, 
           typename FWithDx, 
           typename F = detail::sparse_kernel<RowElements, ColElements, FRadius, FWithDx> > 
    class KernelSparse;
  template<typename RowElements, typename ColElements, typename F, 
           typename RadiusFunction = detail::constant_radius<RowElements> > 
    class KernelSparseConst;
  template<typename RowElements, typename ColElements, 
           typename F = detail::zero_kernel<RowElements, ColElements> > 
    class KernelZero;
}
namespace Aboria {
  template<unsigned int D> class lattice_iterator;
}

ASSERT(condition, message)
ASSERT_CUDA(condition)
CHECK(condition, message)
CHECK_CUDA(condition, message)
ERROR(message)
ERROR_CUDA(message)
ABORIA_LOG_LEVEL
LOG(level, message)
LOG_CUDA(level, message)
LOG_CUDA1(level, message, variable)
LOG_CUDA2(level, message, variable1, variable2)
LOG_BOLD(level, message)
namespace Aboria {
  template<typename Traits> class KdtreeNanoflann;

  template<typename Traits> struct KdtreeNanoflannQuery;

  template<typename Traits> class nanoflann_child_iterator;
}
namespace Aboria {
  template<typename IteratorType> struct iterator_range;

  template<typename Derived, typename Traits, typename QueryType> 
    class neighbour_search_base;

  template<typename Traits> struct NeighbourQueryBase;

  template<typename Traits> class ranges_iterator;
  template<typename Traits> class linked_list_iterator;
  template<typename Traits, typename Iterator> class index_vector_iterator;
  template<typename Query> class depth_first_iterator;
  template<typename Query, int LNormNumber, typename Transform> 
    class tree_query_iterator;
  template<typename Query, int LNormNumber, typename Transform> 
    class lattice_iterator_within_distance;
  template<typename IteratorType> 
    iterator_range< IteratorType > 
    make_iterator_range(IteratorType &&, IteratorType &&);
}
namespace Aboria {
  template<typename Traits> struct HyperOctreeQuery;

  template<typename Traits> class HyperOctree;
  template<unsigned int D> class octree_child_iterator;
}
namespace Aboria {
  template<unsigned int NI, unsigned int NJ, typename Blocks> 
    class MatrixReplacement;
  template<typename RowParticles, typename ColParticles, typename F, 
           typename Kernel = KernelDense<RowParticles, ColParticles, F>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_dense_operator(const RowParticles &, const ColParticles &, 
                                   const F &);
  template<typename RowParticles, typename ColParticles, typename F, 
           typename Kernel = KernelMatrix<RowParticles, ColParticles, F>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_matrix_operator(const RowParticles &, 
                                    const ColParticles &, const F &);
  template<typename RowParticles, typename ColParticles, typename F, 
           typename Kernel = KernelChebyshev<RowParticles, ColParticles, F>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_chebyshev_operator(const RowParticles &, 
                                       const ColParticles &, 
                                       const unsigned int, const F &);
  template<unsigned int N, typename RowParticles, typename ColParticles, 
           typename PositionF, typename F, 
           typename Kernel = KernelFMM<RowParticles, ColParticles, PositionF, F, N>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_fmm_operator(const RowParticles &, const ColParticles &, 
                                 const PositionF &, const F &);
  template<typename RowParticles, typename ColParticles, typename PositionF, 
           typename F, 
           typename Kernel = KernelH2<RowParticles, ColParticles, PositionF, F>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_h2_operator(const RowParticles &, const ColParticles &, 
                                const int, const PositionF &, const F &, 
                                const double = 1.0);
  template<typename RowParticles, typename ColParticles, typename FRadius, 
           typename F, 
           typename Kernel = KernelSparse<RowParticles, ColParticles, FRadius, F>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>>, 
           typename  = typename std::enable_if<!std::is_arithmetic<FRadius>::value>::type> 
    Operator create_sparse_operator(const RowParticles &, 
                                    const ColParticles &, const FRadius &, 
                                    const F &);
  template<typename RowParticles, typename ColParticles, typename F, 
           typename Kernel = KernelSparseConst<RowParticles, ColParticles, F>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_sparse_operator(const RowParticles &, 
                                    const ColParticles &, const double, 
                                    const F &);
  template<typename RowParticles, typename ColParticles, 
           typename Kernel = KernelZero<RowParticles, ColParticles>, 
           typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>> > 
    Operator create_zero_operator(const RowParticles &, const ColParticles &);
  template<unsigned int NI, unsigned int NJ, typename... T> 
    MatrixReplacement< NI, NJ, std::tuple< typename std::tuple_element< 0, T >::type...> > 
    create_block_operator(const MatrixReplacement< 1, 1, T > &...);
}
namespace Aboria {
  template<typename VAR, unsigned int DomainD, 
           template< typename, typename > class VECTOR, 
           template< typename > class SearchMethod, typename TRAITS_USER> 
    class Particles;
}
namespace Aboria {
  template<typename Query, int LNormNumber, 
           typename Transform = IdentityTransform> 
    class search_iterator;
  template<typename Query> class bucket_pair_iterator;
  template<int LNormNumber, typename Query, 
           typename Transform = IdentityTransform, 
           typename SearchIterator = search_iterator<Query, LNormNumber, Transform> > 
    SearchIterator 
    distance_search(const Query &, const typename Query::double_d &, 
                    const double, const Transform & = Transform());
  template<typename Query, typename Transform = IdentityTransform, 
           typename SearchIterator = search_iterator<Query, -1, Transform> > 
    SearchIterator 
    chebyshev_search(const Query &, const typename Query::double_d &, 
                     const double, const Transform & = Transform());
  template<typename Query, typename Transform = IdentityTransform, 
           typename SearchIterator = search_iterator<Query, 1, Transform> > 
    SearchIterator 
    manhatten_search(const Query &, const typename Query::double_d &, 
                     const double, const Transform & = Transform());
  template<typename Query, typename Transform = IdentityTransform, 
           typename SearchIterator = search_iterator<Query, 2, Transform> > 
    SearchIterator 
    euclidean_search(const Query &, const typename Query::double_d &, 
                     const double, const Transform & = Transform());
  template<typename Query, typename Iterator = bucket_pair_iterator<Query> > 
    Iterator get_neighbouring_buckets(const Query &);
}
namespace Aboria {
  template<unsigned int D> struct bbox;
  template<unsigned int D> 
    std::ostream & operator<<(std::ostream &, const bbox< D > &);
  template<unsigned int D> 
    bool circle_intersect_line(const Vector< double, D > &, const double, 
                               const Vector< double, D > &, 
                               const Vector< double, D > &);
  template<unsigned int D> 
    bool circle_intersect_cube(const Vector< double, D > &, const double, 
                               const bbox< D > &);
}
namespace Aboria {
  template<typename T> struct Symbol;
  template<unsigned int I, typename P> struct Label;
  template<typename L1, typename L2> struct Dx;
  struct Normal;
  struct Uniform;
  template<typename T, unsigned int N> struct VectorSymbolic;
  template<typename T> struct Accumulate;
  template<typename T, int LNormNumber = 2, 
           typename Terminal = typename detail::accumulate_within_distance<              T, mpl::int_<LNormNumber>> > 
    struct AccumulateWithinDistance;
  template<typename T> struct min;
  template<typename T> struct max;
  template<typename Expr> unspecified deep_copy(Expr const &);
  template<typename Expr> unspecified eval(Expr &);
  template<typename Expr> unspecified eval(Expr &, unspecified);
  template<typename Expr, typename ParticleReference> 
    unspecified eval(Expr &, const ParticleReference &);
  template<typename Expr, typename AnyRef> 
    unspecified eval(Expr &, const AnyRef &);
  template<typename Expr> 
    unspecified eval(Expr &, unspecified, unspecified, unspecified);
  template<typename Expr, typename AnyRef> 
    unspecified eval(Expr &, unspecified, unspecified, const AnyRef &);
  template<typename Expr, typename AnyRef> 
    unspecified eval(Expr &, unspecified, const AnyRef &, unspecified);
  template<typename Expr, typename AnyDx, typename AnyRef1, typename AnyRef2> 
    unspecified eval(Expr &, const AnyDx &, const AnyRef1 &, const AnyRef2 &);
  template<typename Expr> unspecified is_trivially_zero(Expr &);

  // returns false for non constant expressions (might be not zero) 
  template<typename Expr> unspecified is_trivially_zero(Expr & expr);

  // returns true if the expression always evaluates to false
  template<typename IfExpr> unspecified is_trivially_false(IfExpr & expr);

  // returns false for non constant expressions (might be not false) 
  template<typename IfExpr> unspecified is_trivially_false(IfExpr & expr);

  // returns true if the expression always evaluates to true
  template<typename IfExpr> unspecified is_trivially_true(IfExpr & expr);

  // returns false for non constant expressions (might be not true) 
  template<typename IfExpr> unspecified is_trivially_true(IfExpr & expr);
  template<unsigned int I, typename P> Label< I, P > create_label(P & p);
  template<typename L1, typename L2> Dx< L1, L2 > create_dx(L1 &, L2 &);
}
namespace Aboria {
  struct default_traits;
  template<template< typename, typename > class VECTOR> struct Traits;

  template<> struct Traits<std::vector>;
  template<> struct Traits<thrust::device_vector>;
  template<> struct Traits<thrust::host_vector>;

  template<typename ARG, unsigned int DomainD, unsigned int SelfD, 
           typename TRAITS> 
    struct TraitsCommon;

  template<typename traits, unsigned int DomainD, unsigned int SelfD, 
           typename... TYPES> 
    struct TraitsCommon<std::tuple< TYPES...>, DomainD, SelfD, traits>;
}
namespace Aboria {
  struct IdentityTransform;

  template<unsigned int D, typename T> class LinearTransform;
  template<unsigned int D> class ScaleTransform;

  // create a LinearTransform
  template<unsigned int D, typename T> 
    LinearTransform< D, T > create_linear_transform(const T & transform);

  // create a ScaleTransform
  template<unsigned int D> 
    ScaleTransform< D > 
    create_scale_transform(const Vector< double, D > & scale);
}
namespace Aboria {
  template<typename T = void> 
    void vtkWriteGrid(const char *, int, 
                      vtkSmartPointer< vtkUnstructuredGrid >, 
                      const std::map< std::string, double > & = {});
  template<typename PTYPE, typename GTYPE, typename RNDGTYPE> 
    void create_n_particles_with_rejection_sampling(const unsigned int n, 
                                                    PTYPE & particles, 
                                                    const GTYPE & generator_fun, 
                                                    const Vector< double, 3 > & low, 
                                                    const Vector< double, 3 > & high, 
                                                    RNDGTYPE & generator);
  template<typename T> 
    void radial_distribution_function(const T & particles, const double min, 
                                      const double max, const int n, 
                                      std::vector< double > & out);

  // Assumes 2D particle set since we are drawing to a 2D canvas. 
  template<typename Particles_t, typename Transform = IdentityTransform> 
    void draw_particles_with_search(std::string filename, 
                                    const Particles_t & particles, 
                                    const std::vector< Vector< double, 2 >> & search_points, 
                                    double search_radius, 
                                    const Transform & transform = Transform());
}

ABORIA_VARIABLE(NAME, DATA_TYPE, NAME_STRING)
ABORIA_VARIABLE_VECTOR(NAME, DATA_TYPE, NAME_STRING)
namespace Aboria {
  template<typename T, typename NAME> struct Variable;
}

UNARY_OPERATOR(the_op)
OPERATOR(the_op)
COMPARISON(the_op)
COMPOUND_ASSIGN(the_op)
UFUNC(the_op)
namespace Aboria {
  template<typename T, unsigned int N> class Vector;

  template<typename T> struct is_vector;

  template<typename T, unsigned int N> struct is_vector<Vector< T, N >>;

  template<typename T> struct is_eigen_vector;

  template<typename T, int N> 
    struct is_eigen_vector<Eigen::Matrix< T, N, 1 >>;

  template<typename T, typename Enable = void> struct scalar;

  template<typename T> 
    struct scalar<T, typename std::enable_if< std::is_arithmetic< T >::value >::type>;
  template<typename T> 
    struct scalar<T, typename std::enable_if< is_vector< T >::value >::type>;

  template<typename T, typename Enable = void> struct dim;

  template<typename T> 
    struct dim<T, typename std::enable_if< std::is_arithmetic< T >::value >::type>;
  template<typename T> 
    struct dim<T, typename std::enable_if< is_vector< T >::value >::type>;

  typedef Vector< double, 1 > vdouble1;
  typedef Vector< double, 2 > vdouble2;
  typedef Vector< double, 3 > vdouble3;
  typedef Vector< double, 4 > vdouble4;
  typedef Vector< double, 5 > vdouble5;
  typedef Vector< double, 6 > vdouble6;
  typedef Vector< double, 7 > vdouble7;
  typedef Vector< int, 1 > vint1;
  typedef Vector< int, 2 > vint2;
  typedef Vector< int, 3 > vint3;
  typedef Vector< int, 4 > vint4;
  typedef Vector< int, 5 > vint5;
  typedef Vector< int, 6 > vint6;
  typedef Vector< int, 7 > vint7;
  typedef Vector< bool, 1 > vbool1;
  typedef Vector< bool, 2 > vbool2;
  typedef Vector< bool, 3 > vbool3;
  typedef Vector< bool, 4 > vbool4;
  typedef Vector< bool, 5 > vbool5;
  typedef Vector< bool, 6 > vbool6;
  typedef Vector< bool, 7 > vbool7;

  // returns arg.pow(exponent) 
  template<typename T, unsigned int N, typename EXP_T> 
    Vector< T, N > pow(Vector< T, N > arg, EXP_T exponent);

  // unary - operator for Vector class 
  template<typename T, unsigned int N> 
    Vector< double, N > operator-(const Vector< T, N > & arg1);

  // binary + operator for Vector class 
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T1>::value>::type> 
    Vector< double, N > 
    operator+(const T1 & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< double, N > 
    operator+(const Vector< T1, N > & arg1, const T2 & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > 
    operator+(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator+(const Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator+(const int & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator+(const Vector< int, N > & arg1, const int & arg2);

  // binary - operator for Vector class 
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T1>::value>::type> 
    Vector< double, N > 
    operator-(const T1 & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< double, N > 
    operator-(const Vector< T1, N > & arg1, const T2 & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > 
    operator-(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator-(const Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator-(const int & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator-(const Vector< int, N > & arg1, const int & arg2);

  // binary / operator for Vector class 
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T1>::value>::type> 
    Vector< double, N > 
    operator/(const T1 & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< double, N > 
    operator/(const Vector< T1, N > & arg1, const T2 & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > 
    operator/(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator/(const Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator/(const int & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator/(const Vector< int, N > & arg1, const int & arg2);

  // binary * operator for Vector class 
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T1>::value>::type> 
    Vector< double, N > 
    operator*(const T1 & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< double, N > 
    operator*(const Vector< T1, N > & arg1, const T2 & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > 
    operator*(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator*(const Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator*(const int & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > 
    operator*(const Vector< int, N > & arg1, const int & arg2);
  template<typename T, int N, unsigned int M> 
    Vector< T, N > 
    operator*(const Eigen::Matrix< T, N, int(M)> matrix, 
              const Vector< T, M > & arg);

  // binary > comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< bool, N > 
    operator>(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< bool, N > operator>(const Vector< T1, N > & arg1, const T2 & arg2);

  // binary < comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< bool, N > 
    operator<(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< bool, N > operator<(const Vector< T1, N > & arg1, const T2 & arg2);

  // binary <= comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< bool, N > 
    operator<=(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< bool, N > 
    operator<=(const Vector< T1, N > & arg1, const T2 & arg2);

  // binary >= comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< bool, N > 
    operator>=(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< bool, N > 
    operator>=(const Vector< T1, N > & arg1, const T2 & arg2);

  // binary == comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< bool, N > 
    operator==(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< bool, N > 
    operator==(const Vector< T1, N > & arg1, const T2 & arg2);

  // binary != comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< bool, N > 
    operator!=(const Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N, 
           typename  = typename std::enable_if<std::is_arithmetic<T2>::value>::type> 
    Vector< bool, N > 
    operator!=(const Vector< T1, N > & arg1, const T2 & arg2);

  // compound assign += comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & 
    operator+=(Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & operator+=(Vector< T1, N > & arg1, const T2 & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & 
    operator+=(Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & operator+=(Vector< int, N > & arg1, const int & arg2);

  // compound assign -= comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & 
    operator-=(Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & operator-=(Vector< T1, N > & arg1, const T2 & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & 
    operator-=(Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & operator-=(Vector< int, N > & arg1, const int & arg2);

  // compound assign *= comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & 
    operator*=(Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & operator*=(Vector< T1, N > & arg1, const T2 & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & 
    operator*=(Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & operator*=(Vector< int, N > & arg1, const int & arg2);

  // compound assign /= comparison operator for Vector class 
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & 
    operator/=(Vector< T1, N > & arg1, const Vector< T2, N > & arg2);
  template<typename T1, typename T2, unsigned int N> 
    Vector< double, N > & operator/=(Vector< T1, N > & arg1, const T2 & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & 
    operator/=(Vector< int, N > & arg1, const Vector< int, N > & arg2);
  template<int , int , unsigned int N> 
    Vector< int, N > & operator/=(Vector< int, N > & arg1, const int & arg2);
  template<typename T, int I> double norm(const Vector< T, I > &);

  // return arg1.squaredNorm() 
  template<typename T, int I> double squaredNorm(const Vector< T, I > & arg1);
  template<typename T1, typename T2, int I> 
    double dot(const Vector< T1, I > &, const Vector< T2, I > &);

  // cross-product function for 3D vectors 
  template<typename T> 
    Vector< T, 3 > 
    cross(const Vector< T, 3 > & arg1, const Vector< T, 3 > & arg2);

  // returns the input Vector x (for Eigen) 
  template<typename T, unsigned int N> 
    const Vector< T, N > & conj(const Vector< T, N > & x);

  // returns the input Vector x (for Eigen) 
  template<typename T, unsigned int N> 
    const Vector< T, N > & real(const Vector< T, N > & x);

  // returns imaginary component of Vector class (i.e. 0, for Eigen) 
  template<typename T, unsigned int N> 
    const Vector< T, N > imag(const Vector< T, N > & x);
  template<typename T, unsigned int N> 
    const Vector< T, N > abs(const Vector< T, N > &);

  // element-wise e_i*e_i function for Vector class 
  template<typename T, unsigned int N> 
    const Vector< T, N > abs2(const Vector< T, N > & x);

  // stream output operator for Vector class 
  template<typename T, unsigned int N> 
    std::ostream & operator<<(std::ostream & out, const Vector< T, N > & v);

  // stream input operator for Vector class 
  template<typename T, unsigned int N> 
    std::istream & operator>>(std::istream & out, Vector< T, N > & v);
}namespace boost {
  namespace serialization {
    template<typename Archive, typename S, int Rows_, int Cols_, int Ops_, 
             int MaxRows_, int MaxCols_> 
      void serialize(Archive & ar, 
                     Eigen::Matrix< S, Rows_, Cols_, Ops_, MaxRows_, MaxCols_ > & matrix, 
                     const unsigned int version);
    template<typename Archive, typename S, int Dim_, int Mode_, int Options_> 
      void serialize(Archive & ar, 
                     Eigen::Transform< S, Dim_, Mode_, Options_ > & transform, 
                     const unsigned int version);
  }
}

PrevUpHomeNext