17#ifndef __gt_internalenergy_h__
18#define __gt_internalenergy_h__
33 namespace Tractography {
43 DEBUG(
"Initialise computation of internal energy.");
57 if (par->hasPredecessor()) {
58 int a = (par->getPredecessor()->getPredecessor() == par) ? -1 : 1;
61 ep -= Particle::L * dir;
62 dEint +=
calcEnergy(pos, ep, par->getPredecessor()->getPosition(), par->getPredecessor()->getEndPoint(a));
64 if (par->hasSuccessor()) {
65 int a = (par->getSuccessor()->getPredecessor() == par) ? -1 : 1;
68 ep += Particle::L * dir;
69 dEint +=
calcEnergy(pos, ep, par->getSuccessor()->getPosition(), par->getSuccessor()->getEndPoint(a));
74 double stageRemove(
const Particle* par)
77 if (par->hasPredecessor()) {
78 int a = (par->getPredecessor()->getPredecessor() == par) ? -1 : 1;
81 if (par->hasSuccessor()) {
82 int a = (par->getSuccessor()->getPredecessor() == par) ? -1 : 1;
97 double getConnPot()
const
102 void setConnPot(
const double connpot)
118 return calcEnergy(P1->getPosition(), P1->getEndPoint(ep1), P2->getPosition(), P2->getEndPoint(ep2));
123 Point_t Xm = (pos1 + pos2) * 0.5;
124 double Ucon = ( (ep1 - Xm).squaredNorm() + (ep2 - Xm).squaredNorm() ) / (Particle::L * Particle::L);
double calcEnergy(const Particle *P1, const int ep1, const Particle *P2, const int ep2)
Math::RNG::Uniform< double > rng_uniform
void scanNeighbourhood(const Particle *p, const int alpha0, const double currTemp)
ParticleEnd pickNeighbour()
vector< ParticleEnd > neighbourhood
double calcEnergy(const Point_t &pos1, const Point_t &ep1, const Point_t &pos2, const Point_t &ep2)