LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::part::GridPartition< Data > Class Template Reference

A container of partitions organised in a width/depth rectangular grid. More...

#include "Partitions.h"

Inheritance diagram for geo::part::GridPartition< Data >:
geo::part::PartitionContainer< Data > geo::part::PartitionWithData< Data > geo::part::Partition< Data > geo::part::PartitionBase geo::part::AreaOwner

Public Types

using Partition_t = Partition< Data >
 Base type of the partition. More...
 
using Base_t = PartitionContainer< Data >
 Base class. More...
 
using Data_t = typename Partition_t::Data_t
 Type of contained data. More...
 
using Area_t = typename Partition_t::Area_t
 Type of covered area. More...
 
using Subpartitions_t = typename Base_t::Subpartitions_t
 
using AreaRangeMember_t = AreaOwner::AreaRangeMember_t
 

Public Member Functions

 GridPartition (Area_t const &area, Subpartitions_t &&subpartitions, unsigned int nDepthPartitions, unsigned int nWidthPartitions, Data_t *defData=nullptr)
 Creates a partition with a grid of subpartitions. More...
 
 GridPartition (Area_t const &area, Subpartitions_t &&subpartitions, unsigned int nDepthPartitions, Data_t *defData=nullptr)
 
virtual Data_tatPoint (double w, double d) const override
 Returns stored datum only if point is covered, nullptr otherwise. More...
 
virtual Data_tdata () const override
 Returns the datum directly stored (nullptr if none). More...
 
std::string describe (std::string indent, std::string firstIndent) const
 Returns a description of the partition. More...
 
std::string describe (std::string indent="") const
 Returns a description of the partition. More...
 
template<typename Pred >
void walk (Pred &&pred) const
 Applies pred to all partitions. More...
 
std::size_t nParts () const
 Returns the number of subparts in the partition (0 if simple element). More...
 
bool contains (double w, double d) const
 Returns whether the specified point is covered by this object. More...
 
Area_t const & area () const
 Returns the covered area. More...
 
template<typename Stream >
void dumpArea (Stream &&out) const
 Output the owned area into an output stream. More...
 

Protected Member Functions

std::size_t size () const
 Returns the number of contained subpartitions. More...
 
virtual Subpartitions_t const & parts () const override
 Returns a list of the subpartitions owned. More...
 
virtual std::string describeIntro () const
 Introduction to the description of the subpartitions. More...
 
std::string describeArea (std::string indent, std::string firstIndent) const
 Returns a description of the partition area. More...
 

Static Protected Member Functions

template<typename Pred >
static void walk (Partition_t const *start, Pred &&pred)
 

Protected Attributes

Subpartitions_t myParts
 List of subpartitions. More...
 

Static Protected Attributes

static Subpartitions_t const NoSubparts
 Subpartitions (if any). More...
 

Private Member Functions

std::size_t nWidthParts () const
 Number of partitions on width direction. More...
 
std::size_t nDepthParts () const
 
auto part (std::size_t iDepth, std::size_t iWidth) -> decltype(auto)
 
auto part (std::size_t iDepth, std::size_t iWidth) const -> decltype(auto)
 
virtual Partition_t const * findPart (double w, double d) const override
 Returns the only partition which could contain the specified depth. More...
 
std::vector< double > computeWidthSeps (unsigned int nD, unsigned int nW) const
 Computes and returns width separation levels proper for widthSeps. More...
 
std::vector< double > computeDepthSeps (unsigned int nD, unsigned int nW) const
 Computes and returns width separation levels proper for depthSeps. More...
 
virtual std::string doDescribe (std::string indent, std::string firstIndent) const override
 Prints the information about the partition grid. More...
 

Static Private Member Functions

template<PartitionBase::AreaRangeMember_t Range, typename BeginIter , typename EndIter >
static std::vector< double > detectSeparators (BeginIter b, EndIter e, std::size_t const nGroups, std::size_t const startDelta, std::size_t const stride)
 

Private Attributes

std::vector< double > widthSeps
 Separators for width dimension. More...
 
std::vector< double > depthSeps
 Separators for depth dimension. More...
 

Detailed Description

template<typename Data>
class geo::part::GridPartition< Data >

A container of partitions organised in a width/depth rectangular grid.

Definition at line 514 of file Partitions.h.

Member Typedef Documentation

template<typename Data >
using geo::part::GridPartition< Data >::Area_t = typename Partition_t::Area_t

Type of covered area.

Definition at line 521 of file Partitions.h.

template<typename Data >
using geo::part::GridPartition< Data >::Base_t = PartitionContainer<Data>

Base class.

Definition at line 517 of file Partitions.h.

template<typename Data >
using geo::part::GridPartition< Data >::Data_t = typename Partition_t::Data_t

Type of contained data.

Definition at line 520 of file Partitions.h.

template<typename Data >
using geo::part::GridPartition< Data >::Partition_t = Partition<Data>

Base type of the partition.

Definition at line 516 of file Partitions.h.

template<typename Data >
using geo::part::GridPartition< Data >::Subpartitions_t = typename Base_t::Subpartitions_t

Definition at line 522 of file Partitions.h.

Constructor & Destructor Documentation

template<typename Data >
geo::part::GridPartition< Data >::GridPartition ( Area_t const &  area,
Subpartitions_t &&  subpartitions,
unsigned int  nDepthPartitions,
unsigned int  nWidthPartitions,
Data_t defData = nullptr 
)

Creates a partition with a grid of subpartitions.

Parameters
areatotal area covered by this partition
subpartitionsall subpartitions, row by row
nDepthPartitionsnumber of partitions on depth direction ("rows")
nWidthPartitionsnumber of partitions on width direction ("columns")
defDatapartition data for areas not covered by subpartitions

The content of the collection of subpartitions is stolen. The subpartitions in that collection are expected to be organized by row: (0;0), (0,1), (0,2)... where the first index spans nDepthPartitions values and the second one spans nWidthPartitions values.

Definition at line 934 of file Partitions.h.

References geo::part::PartitionContainer< Data >::size().

940  : Base_t(area, std::move(subpartitions), defData)
941  , widthSeps(computeWidthSeps(nDepthPartitions, nWidthPartitions))
942  , depthSeps(computeDepthSeps(nDepthPartitions, nWidthPartitions))
943 {
944  assert(nWidthPartitions * nDepthPartitions == Base_t::size());
945 } // geo::part::GridPartition<Data>::GridPartition()
std::vector< double > computeDepthSeps(unsigned int nD, unsigned int nW) const
Computes and returns width separation levels proper for depthSeps.
Definition: Partitions.h:1013
std::vector< double > depthSeps
Separators for depth dimension.
Definition: Partitions.h:556
std::vector< double > widthSeps
Separators for width dimension.
Definition: Partitions.h:555
std::vector< double > computeWidthSeps(unsigned int nD, unsigned int nW) const
Computes and returns width separation levels proper for widthSeps.
Definition: Partitions.h:1004
PartitionContainer< Data > Base_t
Base class.
Definition: Partitions.h:517
Area_t const & area() const
Returns the covered area.
Definition: Partitions.h:56
std::size_t size() const
Returns the number of contained subpartitions.
Definition: Partitions.h:340
template<typename Data >
geo::part::GridPartition< Data >::GridPartition ( Area_t const &  area,
Subpartitions_t &&  subpartitions,
unsigned int  nDepthPartitions,
Data_t defData = nullptr 
)

Constructor: autodetects nWidthPartitions from number of subpartitions.

Definition at line 949 of file Partitions.h.

References geo::part::GridPartition< Data >::doDescribe().

954  : GridPartition(
955  area, std::move(subpartitions), nDepthPartitions,
956  (nDepthPartitions? subpartitions.size()/nDepthPartitions: 0),
957  defData
958  )
959  {}
Area_t const & area() const
Returns the covered area.
Definition: Partitions.h:56
GridPartition(Area_t const &area, Subpartitions_t &&subpartitions, unsigned int nDepthPartitions, unsigned int nWidthPartitions, Data_t *defData=nullptr)
Creates a partition with a grid of subpartitions.
Definition: Partitions.h:934

Member Function Documentation

template<typename Data >
auto geo::part::PartitionContainer< Data >::atPoint ( double  w,
double  d 
) const
overridevirtualinherited

Returns stored datum only if point is covered, nullptr otherwise.

Reimplemented from geo::part::PartitionWithData< Data >.

Definition at line 841 of file Partitions.h.

References geo::part::PartitionContainer< Data >::doDescribe(), and part.

843 {
844  if (!Base_t::contains(w, d)) return nullptr; // not our point at all
845  // it's ours; see if it belongs to a subpart
846  auto part = findPart(w, d);
847  return part? part->atPoint(w, d): Base_t::data();
848 } // geo::part::PartitionContainer<Data>::atPoint()
bool contains(double w, double d) const
Returns whether the specified point is covered by this object.
Definition: Partitions.h:52
TString part[npart]
Definition: Style.C:32
Float_t d
Definition: plot.C:237
virtual Partition_t const * findPart(double w, double d) const =0
Returns the only partition which could contain the specified width.
virtual Data_t * data() const override
Returns the datum directly stored (nullptr if none).
Definition: Partitions.h:289
Float_t w
Definition: plot.C:23
template<typename Data >
std::vector< double > geo::part::GridPartition< Data >::computeDepthSeps ( unsigned int  nD,
unsigned int  nW 
) const
private

Computes and returns width separation levels proper for depthSeps.

Definition at line 1013 of file Partitions.h.

References geo::part::PartitionContainer< Data >::parts().

Referenced by geo::part::GridPartition< Data >::computeWidthSeps().

1014 {
1015  return detectSeparators<&Area_t::depth>
1016  (Base_t::parts().cbegin(), Base_t::parts().cend(), nD, nW, 1U);
1017 } // geo::part::GridPartition<Data>::computeDepthSeps()
virtual Subpartitions_t const & parts() const override
Returns a list of the subpartitions owned.
Definition: Partitions.h:343
template<typename Data >
std::vector< double > geo::part::GridPartition< Data >::computeWidthSeps ( unsigned int  nD,
unsigned int  nW 
) const
private

Computes and returns width separation levels proper for widthSeps.

Definition at line 1004 of file Partitions.h.

References geo::part::GridPartition< Data >::computeDepthSeps(), and geo::part::PartitionContainer< Data >::parts().

Referenced by geo::part::GridPartition< Data >::findPart().

1005 {
1006  return detectSeparators<&Area_t::width>
1007  (Base_t::parts().cbegin(), Base_t::parts().cend(), nW, 1U, nW);
1008 } // geo::part::GridPartition<Data>::computeWidthSeps()
virtual Subpartitions_t const & parts() const override
Returns a list of the subpartitions owned.
Definition: Partitions.h:343
bool geo::part::AreaOwner::contains ( double  w,
double  d 
) const
inlineinherited

Returns whether the specified point is covered by this object.

Definition at line 52 of file Partitions.h.

References geo::part::AreaOwner::area(), and lar::util::simple_geo::Rectangle< Data >::contains().

53  { return area().contains(w, d); }
bool contains(Data_t w, Data_t d) const
Returns whether the specified point is in the area.
Definition: SimpleGeo.h:408
Float_t d
Definition: plot.C:237
Area_t const & area() const
Returns the covered area.
Definition: Partitions.h:56
Float_t w
Definition: plot.C:23
template<typename Data >
virtual Data_t* geo::part::PartitionWithData< Data >::data ( ) const
inlineoverridevirtualinherited

Returns the datum directly stored (nullptr if none).

Reimplemented from geo::part::Partition< Data >.

Definition at line 289 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::doDescribe().

289 { return myData; }
Data_t * myData
The contained datum.
Definition: Partitions.h:296
template<typename Data>
std::string geo::part::Partition< Data >::describe ( std::string  indent,
std::string  firstIndent 
) const
inlineinherited

Returns a description of the partition.

Definition at line 221 of file Partitions.h.

222  { return doDescribe(indent, firstIndent); }
virtual std::string doDescribe(std::string indent, std::string firstIndent) const
Returns a description of the partition.
Definition: Partitions.h:260
std::string indent(std::size_t const i)
template<typename Data>
std::string geo::part::Partition< Data >::describe ( std::string  indent = "") const
inlineinherited

Returns a description of the partition.

Definition at line 225 of file Partitions.h.

References art::detail::describe().

226  { return describe(indent, indent); }
std::string indent(std::size_t const i)
std::string describe(std::string indent, std::string firstIndent) const
Returns a description of the partition.
Definition: Partitions.h:221
std::string geo::part::PartitionBase::describeArea ( std::string  indent,
std::string  firstIndent 
) const
inlineprotectedinherited

Returns a description of the partition area.

Definition at line 606 of file Partitions.h.

References geo::part::AreaOwner::dumpArea(), and part.

Referenced by geo::part::Partition< Data >::doDescribe(), and geo::part::GridPartition< Data >::part().

607 {
608  std::ostringstream sstr;
609  sstr << firstIndent << "partition covers ";
610  dumpArea(sstr);
611  return sstr.str();
612 } // geo::part::PartitionBase::describeArea()
void dumpArea(Stream &&out) const
Output the owned area into an output stream.
Definition: Partitions.h:60
template<typename Data >
std::string geo::part::PartitionContainer< Data >::describeIntro ( ) const
protectedvirtualinherited

Introduction to the description of the subpartitions.

Definition at line 875 of file Partitions.h.

References util::flags::to_string().

Referenced by geo::part::GridPartition< Data >::doDescribe().

875  {
876  return std::to_string(parts().size()) + " subpartitions";
877 } // geo::part::PartitionContainer<Data>::describeIntro()
std::size_t size() const
Returns the number of contained subpartitions.
Definition: Partitions.h:340
virtual Subpartitions_t const & parts() const override
Returns a list of the subpartitions owned.
Definition: Partitions.h:343
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
Definition: BitMask.h:187
template<typename Data >
template<geo::part::AreaOwner::AreaRangeMember_t Range, typename BeginIter , typename EndIter >
std::vector< double > geo::part::GridPartition< Data >::detectSeparators ( BeginIter  b,
EndIter  e,
std::size_t const  nGroups,
std::size_t const  startDelta,
std::size_t const  stride 
)
staticprivate

Definition at line 1025 of file Partitions.h.

References geo::part::Partition< Data >::nParts(), and geo::part::GridPartition< Data >::part().

1030  {
1031  /*
1032  * The iterators are better be random access.
1033  * The range [b,e[ is considered to be a 2D table stored row after row.
1034  * This function can operate on rows or columns, given the proper arguments.
1035  *
1036  * The full range is split in nGroups "groups" (e.g. rows or columns).
1037  * Each group g starts at the element g x startDelta.
1038  * All members of that group are stride elements far from each other.
1039  *
1040  * Be the table of size (d x w).
1041  * To process data row by row:
1042  * - the group is a row
1043  * - the number of groups is the number of rows: nGroups = d
1044  * - each group will have (d x w)/nGroups = w elements
1045  * - the start offset is the number of group times the size of it:
1046  * startDelta = w
1047  * - the elements are contiguous: stride = 1
1048  *
1049  * To process data column by column:
1050  * - the group is a column
1051  * - the number of groups is the number of columns: nGroups = w
1052  * - each group will have (d x w)/nGroups = d elements
1053  * - the start offset matches the number of group: startDelta = 1
1054  * - the elements are separated by a full row: stride = w
1055  *
1056  */
1057  // the separator is on the lower bound of selected range of the partition area
1058 
1059  static_assert(details::is_partition_ptr_iterator<BeginIter>(),
1060  "Begin iterator does not point to a pointer to partition type");
1061 
1062  details::PartitionRangeLowerBoundExtractor<Range> lowerBound;
1063 
1064  std::size_t const nParts = std::distance(b, e);
1065  std::size_t const nPartsInGroup = nParts / nGroups;
1066 
1067  auto const part
1068  = [b](std::size_t index){ return std::next(b, index)->get(); };
1069 
1070  std::vector<double> seps(nGroups);
1071  for (size_t g = 0; g < nGroups; ++g) {
1072 
1073  double& sep = seps[g];
1074 
1075  // indices of an element in the previous and next group, respectively
1076  std::size_t index = g * startDelta;
1077  sep = lowerBound(part(index));
1078 
1079  std::size_t const iend = index + nPartsInGroup * stride;
1080  while ((index += stride) < iend) {
1081  double const l = lowerBound(part(index));
1082  if (sep > l) sep = l;
1083  } // while (element)
1084 
1085  } // while (groups)
1086  return seps;
1087 } // geo::part::GridPartition<Data>::detectSeparators()
auto part(std::size_t iDepth, std::size_t iWidth) -> decltype(auto)
Definition: Partitions.h:563
std::size_t nParts() const
Returns the number of subparts in the partition (0 if simple element).
Definition: Partitions.h:249
Float_t e
Definition: plot.C:34
template<typename Data >
std::string geo::part::GridPartition< Data >::doDescribe ( std::string  indent,
std::string  firstIndent 
) const
overrideprivatevirtual

Prints the information about the partition grid.

Reimplemented from geo::part::PartitionContainer< Data >.

Definition at line 965 of file Partitions.h.

References geo::part::PartitionWithData< Data >::data(), geo::part::PartitionContainer< Data >::describeIntro(), geo::part::describePartitionData(), geo::part::GridPartition< Data >::nDepthParts(), geo::part::GridPartition< Data >::nWidthParts(), and geo::part::GridPartition< Data >::part().

Referenced by geo::part::GridPartition< Data >::GridPartition().

966 {
967  std::ostringstream sstr;
968  sstr << firstIndent << Base_t::describeIntro()
969  << " in a (WxD) = " << nWidthParts() << " x " << nDepthParts() << " grid";
970  if (Base_t::data()) {
971  sstr << ", and ";
973  }
974  for (std::size_t iDepth = 0; iDepth < nDepthParts(); ++iDepth) {
975  for (std::size_t iWidth = 0; iWidth < nWidthParts(); ++iWidth) {
976  sstr << "\n" << indent << " [" << iDepth << "][" << iWidth << "] "
977  << part(iDepth, iWidth)->describe(indent + " ", "");
978  } // for width
979  } // for depth
980 
981  return sstr.str();
982 } // geo::part::GridPartition<Data>::doDescribe()
void describePartitionData(Stream &&out, Data const *data, std::string indent="", std::string firstIndent="")
Describes a data object for Partition::describe() method.
Definition: Partitions.h:784
std::string indent(std::size_t const i)
std::size_t nWidthParts() const
Number of partitions on width direction.
Definition: Partitions.h:559
virtual Data_t * data() const override
Returns the datum directly stored (nullptr if none).
Definition: Partitions.h:289
auto part(std::size_t iDepth, std::size_t iWidth) -> decltype(auto)
Definition: Partitions.h:563
virtual std::string describeIntro() const
Introduction to the description of the subpartitions.
Definition: Partitions.h:875
std::size_t nDepthParts() const
Definition: Partitions.h:561
template<typename Stream >
void geo::part::AreaOwner::dumpArea ( Stream &&  out) const
inlineinherited

Output the owned area into an output stream.

Definition at line 60 of file Partitions.h.

References geo::part::AreaOwner::area().

Referenced by geo::part::PartitionBase::describeArea().

60 { std::forward<Stream>(out) << area(); }
Area_t const & area() const
Returns the covered area.
Definition: Partitions.h:56
template<typename Data >
auto geo::part::GridPartition< Data >::findPart ( double  w,
double  d 
) const
overrideprivatevirtual

Returns the only partition which could contain the specified depth.

Implements geo::part::PartitionContainer< Data >.

Definition at line 987 of file Partitions.h.

References geo::part::GridPartition< Data >::computeWidthSeps(), d, geo::part::GridPartition< Data >::depthSeps, geo::part::GridPartition< Data >::part(), w, and geo::part::GridPartition< Data >::widthSeps.

989 {
990  auto const iWidth = std::upper_bound(widthSeps.cbegin(), widthSeps.cend(), w);
991  if (iWidth == widthSeps.cbegin()) return nullptr;
992  auto const iDepth = std::upper_bound(depthSeps.cbegin(), depthSeps.cend(), d);
993  if (iDepth == depthSeps.cbegin()) return nullptr;
994  return part(
995  std::distance(depthSeps.cbegin(), iDepth) - 1U,
996  std::distance(widthSeps.cbegin(), iWidth) - 1U
997  ).get();
998 } // geo::part::GridPartition<Data>::findPart()
std::vector< double > depthSeps
Separators for depth dimension.
Definition: Partitions.h:556
std::vector< double > widthSeps
Separators for width dimension.
Definition: Partitions.h:555
Float_t d
Definition: plot.C:237
auto part(std::size_t iDepth, std::size_t iWidth) -> decltype(auto)
Definition: Partitions.h:563
Float_t w
Definition: plot.C:23
template<typename Data >
std::size_t geo::part::GridPartition< Data >::nDepthParts ( ) const
inlineprivate

Definition at line 561 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::doDescribe().

561 { return depthSeps.size(); }
std::vector< double > depthSeps
Separators for depth dimension.
Definition: Partitions.h:556
template<typename Data>
std::size_t geo::part::Partition< Data >::nParts ( ) const
inlineinherited

Returns the number of subparts in the partition (0 if simple element).

Definition at line 249 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::detectSeparators().

249 { return parts().size(); }
virtual Subpartitions_t const & parts() const
Returns a list of all subpartitions.
Definition: Partitions.h:256
template<typename Data >
std::size_t geo::part::GridPartition< Data >::nWidthParts ( ) const
inlineprivate

Number of partitions on width direction.

Number of partitions on depth direction.

Definition at line 559 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::doDescribe().

template<typename Data >
auto geo::part::GridPartition< Data >::part ( std::size_t  iDepth,
std::size_t  iWidth 
) -> decltype(auto)
inlineprivate

Definition at line 563 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::detectSeparators(), geo::part::GridPartition< Data >::doDescribe(), and geo::part::GridPartition< Data >::findPart().

564  { return Base_t::parts()[iDepth * nWidthParts() + iWidth]; }
virtual Subpartitions_t const & parts() const override
Returns a list of the subpartitions owned.
Definition: Partitions.h:343
std::size_t nWidthParts() const
Number of partitions on width direction.
Definition: Partitions.h:559
template<typename Data >
auto geo::part::GridPartition< Data >::part ( std::size_t  iDepth,
std::size_t  iWidth 
) const -> decltype(auto)
inlineprivate

Definition at line 565 of file Partitions.h.

References geo::part::PartitionBase::describeArea(), and e.

566  { return Base_t::parts()[iDepth * nWidthParts() + iWidth]; }
virtual Subpartitions_t const & parts() const override
Returns a list of the subpartitions owned.
Definition: Partitions.h:343
std::size_t nWidthParts() const
Number of partitions on width direction.
Definition: Partitions.h:559
template<typename Data >
virtual Subpartitions_t const& geo::part::PartitionContainer< Data >::parts ( ) const
inlineoverrideprotectedvirtualinherited

Returns a list of the subpartitions owned.

Reimplemented from geo::part::Partition< Data >.

Definition at line 343 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::computeDepthSeps(), and geo::part::GridPartition< Data >::computeWidthSeps().

343 { return myParts; }
Subpartitions_t myParts
List of subpartitions.
Definition: Partitions.h:337
template<typename Data >
std::size_t geo::part::PartitionContainer< Data >::size ( ) const
inlineprotectedinherited

Returns the number of contained subpartitions.

Definition at line 340 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::GridPartition().

340 { return parts().size(); }
virtual Subpartitions_t const & parts() const override
Returns a list of the subpartitions owned.
Definition: Partitions.h:343
template<typename Data>
template<typename Pred >
void geo::part::Partition< Data >::walk ( Pred &&  pred) const
inlineinherited

Applies pred to all partitions.

Template Parameters
Preda predicate type
Parameters
predthe predicate to be applied

The predicate pred is applied to this partition first, and then to all subpartitions in no specified order.

The predicate is any object behaving like a unary function of signature:

void predicate(Partition<Data> const& part);

If the predicate returns a value, that value is ignored. The predicate is forwarded while "walking" through the partitions.

Definition at line 246 of file Partitions.h.

References geo::part::Partition< Data >::walk().

Referenced by geo::DriftPartitions::computeCoverage(), and geo::part::Partition< Data >::walk().

246 { walk(this, pred); }
void walk(Pred &&pred) const
Applies pred to all partitions.
Definition: Partitions.h:246
template<typename Data >
template<typename Pred >
void geo::part::Partition< Data >::walk ( Partition_t const *  start,
Pred &&  pred 
)
staticprotectedinherited

Applies pred to start partition first, and then to all subpartitions.

Definition at line 804 of file Partitions.h.

References geo::part::PartitionWithData< Data >::doDescribe(), and geo::part::Partition< Data >::parts().

804  {
805  if (!start) return;
806  pred(*start);
807 
808  // recursive implementation
809  for (auto const& subPart: start->parts())
810  subPart->walk(std::forward<Pred>(pred));
811 
812 } // geo::part::Partition<Data>::walk()

Member Data Documentation

template<typename Data >
std::vector<double> geo::part::GridPartition< Data >::depthSeps
private

Separators for depth dimension.

Definition at line 556 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::findPart().

template<typename Data >
Subpartitions_t geo::part::PartitionContainer< Data >::myParts
protectedinherited

List of subpartitions.

Definition at line 337 of file Partitions.h.

template<typename Data>
geo::part::Partition< Data >::Subpartitions_t const geo::part::Partition< Data >::NoSubparts
staticprotectedinherited

Subpartitions (if any).

Definition at line 253 of file Partitions.h.

template<typename Data >
std::vector<double> geo::part::GridPartition< Data >::widthSeps
private

Separators for width dimension.

Definition at line 555 of file Partitions.h.

Referenced by geo::part::GridPartition< Data >::findPart().


The documentation for this class was generated from the following file: