Commit a6f5dc75 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

ART

-additional performance improvements by using references
parent 29f3adb9
......@@ -77,7 +77,7 @@ namespace ITAPropagationPathSim
const std::vector<std::shared_ptr<CRay>>& Rays() const { return vpRays; }
bool IsEmpty() const { return NTheta() == 0 || NPhi() == 0; }
bool Contains(std::shared_ptr<CRay> pRay) const { return std::find(vpRays.cbegin(), vpRays.cend(), pRay) == vpRays.cend(); }
bool Contains(const std::shared_ptr<CRay>& pRay) const { return std::find(vpRays.cbegin(), vpRays.cend(), pRay) == vpRays.cend(); }
//! Returns a ray grid containing the rays surrounding the given ray (including this ray).
/**
......
......@@ -78,7 +78,7 @@ namespace ITAPropagationPathSim
void AppendReflection(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp);
bool SameDirection(const CRay& other) const;
bool IsReflectionIdx(const unsigned int& idx) const;
bool IsReflectionIdx(const int idx) const;
};
}
}
......
......@@ -9,7 +9,7 @@ void CRayResolutionAdapter::Reset(const CRayGrid& rayGrid)
vpNewRaysOfLastAdaptation.clear();
}
bool CRayResolutionAdapter::ZoomIntoRay(std::shared_ptr<CRay> pRay)
bool CRayResolutionAdapter::ZoomIntoRay(const std::shared_ptr<CRay>& pRay)
{
vpNewRaysOfLastAdaptation.clear();
......@@ -24,6 +24,11 @@ bool CRayResolutionAdapter::ZoomIntoRay(std::shared_ptr<CRay> pRay)
return true;
}
//void CRayResolutionAdapter::AdvancedRayZooming(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition)
//{
//}
void CRayResolutionAdapter::DoubleRayResolution()
{
if (ConstRayVectorReference().size() <= 1)
......
......@@ -40,13 +40,14 @@ namespace ITAPropagationPathSim
void Reset(const CRayGrid& rayGrid);
CRayGrid RayGrid() { return *this; }
std::vector< std::shared_ptr<CRay> > Rays() { return CRayGrid::Rays(); }
std::vector< std::shared_ptr<CRay> > NewRaysOfLastAdaptation() { return vpNewRaysOfLastAdaptation; }
const std::vector< std::shared_ptr<CRay> >& Rays() { return CRayGrid::Rays(); }
const std::vector< std::shared_ptr<CRay> >& NewRaysOfLastAdaptation() { return vpNewRaysOfLastAdaptation; }
bool ZoomIntoRay(std::shared_ptr<CRay> pRay);
//bool ZoomIntoRay(std::shared_ptr<CRay> pRay, const int idxMinDist& = -1, const VistaVector3D& receiverPosition = VistaVector3D());
bool ZoomIntoRay(const std::shared_ptr<CRay>& pRay);
//bool ZoomIntoRay(const std::shared_ptr<CRay>& pRay, const int idxMinDist = -1, const VistaVector3D& receiverPosition = VistaVector3D());
private:
//void AdvancedRayZooming(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition);
void DoubleRayResolution();
std::vector<double> DoubleAngularResolution(const std::vector<double>& angleVector) const;
};
......
......@@ -52,7 +52,7 @@ namespace ITAPropagationPathSim
VistaVector3D VectorToVirtualReceiver( const VistaVector3D& point, const VistaVector3D& receiverPos, const int reflectionOrder );
float DistanceToVirtualReceiver( const VistaVector3D& point, const VistaVector3D& receiverPos, const int reflectionOrder );
//! Does a rough search for potential eigenrays directions for multiple reflection orders
class CInitialWorker : public Simulation::IAbortCriterion
{
private:
......@@ -78,6 +78,7 @@ namespace ITAPropagationPathSim
std::vector<CRayGrid> FinalizeResult(const CRayGrid& initialRayGrid);
};
//! Based on a result of CInitialWorker, this worker adaptively reduces the directional limits while increasing the resolution to find an eigenray of a specific reflection order
class CAdaptiveWorker : public Simulation::IAbortCriterion
{
private:
......
......@@ -36,7 +36,7 @@ bool CRay::SameDirection(const CRay& other) const
return InitialDirection() == other.InitialDirection();
}
bool CRay::IsReflectionIdx(const unsigned int& idx) const
bool CRay::IsReflectionIdx(const int idx) const
{
return std::find(iReflectionIndices.begin(), iReflectionIndices.end(), idx) != iReflectionIndices.end();
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment