Added missing replication multiplicative factor
This commit is contained in:
parent
a0bf3dc2c2
commit
54d23331f3
@ -97,15 +97,15 @@ namespace CosmoTool {
|
||||
recursiveIntersectionCells<false>(info, root, 0);
|
||||
if (periodic)
|
||||
{
|
||||
ReplicateGenerator<float, N> replicate(x);
|
||||
ReplicateGenerator<float, N> r(x, replicate);
|
||||
|
||||
do
|
||||
{
|
||||
coords x_new;
|
||||
replicate.getPosition(info.x);
|
||||
r.getPosition(info.x);
|
||||
recursiveIntersectionCells<false>(info, root, 0);
|
||||
}
|
||||
while (replicate.next());
|
||||
while (r.next());
|
||||
}
|
||||
|
||||
return info.currentRank;
|
||||
@ -131,15 +131,15 @@ namespace CosmoTool {
|
||||
recursiveIntersectionCells<false>(info, root, 0);
|
||||
if (periodic)
|
||||
{
|
||||
ReplicateGenerator<float, N> replicate(x);
|
||||
ReplicateGenerator<float, N> r(x, replicate);
|
||||
|
||||
do
|
||||
{
|
||||
coords x_new;
|
||||
replicate.getPosition(info.x);
|
||||
r.getPosition(info.x);
|
||||
recursiveIntersectionCells<false>(info, root, 0);
|
||||
}
|
||||
while (replicate.next());
|
||||
while (r.next());
|
||||
}
|
||||
return info.currentRank;
|
||||
}
|
||||
@ -160,15 +160,15 @@ namespace CosmoTool {
|
||||
recursiveIntersectionCells<true>(info, root, 0);
|
||||
if (periodic)
|
||||
{
|
||||
ReplicateGenerator<float, N> replicate(x);
|
||||
ReplicateGenerator<float, N> r(x, replicate);
|
||||
|
||||
do
|
||||
{
|
||||
coords x_new;
|
||||
replicate.getPosition(info.x);
|
||||
r.getPosition(info.x);
|
||||
recursiveIntersectionCells<true>(info, root, 0);
|
||||
}
|
||||
while (replicate.next());
|
||||
while (r.next());
|
||||
}
|
||||
|
||||
return info.currentRank;
|
||||
@ -408,15 +408,15 @@ namespace CosmoTool {
|
||||
recursiveNearest(root, 0, x, R2, best);
|
||||
if (periodic)
|
||||
{
|
||||
ReplicateGenerator<float, N> replicate(x);
|
||||
ReplicateGenerator<float, N> r(x, replicate);
|
||||
|
||||
do
|
||||
{
|
||||
coords x_new;
|
||||
replicate.getPosition(x_new);
|
||||
r.getPosition(x_new);
|
||||
recursiveNearest(root, 0, x_new, R2, best);
|
||||
}
|
||||
while (replicate.next());
|
||||
while (r.next());
|
||||
}
|
||||
|
||||
return best;
|
||||
@ -491,15 +491,15 @@ namespace CosmoTool {
|
||||
recursiveMultipleNearest(info, root, 0);
|
||||
if (periodic)
|
||||
{
|
||||
ReplicateGenerator<float, N> replicate(x);
|
||||
ReplicateGenerator<float, N> r(x, replicate);
|
||||
|
||||
do
|
||||
{
|
||||
coords x_new;
|
||||
replicate.getPosition(info.x);
|
||||
r.getPosition(info.x);
|
||||
recursiveMultipleNearest(info, root, 0);
|
||||
}
|
||||
while (replicate.next());
|
||||
while (r.next());
|
||||
}
|
||||
|
||||
// std::cout << "Traversed = " << info.traversed << std::endl;
|
||||
@ -518,15 +518,15 @@ namespace CosmoTool {
|
||||
recursiveMultipleNearest(info, root, 0);
|
||||
if (periodic)
|
||||
{
|
||||
ReplicateGenerator<float, N> replicate(x);
|
||||
ReplicateGenerator<float, N> r(x, replicate);
|
||||
|
||||
do
|
||||
{
|
||||
coords x_new;
|
||||
replicate.getPosition(info.x);
|
||||
r.getPosition(info.x);
|
||||
recursiveMultipleNearest(info, root, 0);
|
||||
}
|
||||
while (replicate.next());
|
||||
while (r.next());
|
||||
}
|
||||
memcpy(distances, info.queue.getPriorities(), sizeof(CoordType)*N2);
|
||||
}
|
||||
|
@ -12,10 +12,12 @@ namespace CosmoTool
|
||||
{
|
||||
public:
|
||||
typedef Coord Coords[N];
|
||||
Coord replicate;
|
||||
|
||||
ReplicateGenerator(const Coords& x)
|
||||
ReplicateGenerator(const Coords& x, Coord shift)
|
||||
{
|
||||
face = 0;
|
||||
replicate = shift;
|
||||
numFaces = spower<N,long>(3);
|
||||
std::copy(x, x+N, x_base);
|
||||
}
|
||||
@ -34,7 +36,7 @@ namespace CosmoTool
|
||||
int c_face;
|
||||
c_face = q_face % 3;
|
||||
q_face /= 3;
|
||||
x_shifted[i] = x_base[i] + (c_face-1);
|
||||
x_shifted[i] = x_base[i] + (c_face-1)*replicate;
|
||||
no_move = no_move && (c_face == 1);
|
||||
}
|
||||
if (no_move)
|
||||
|
Loading…
Reference in New Issue
Block a user