Commit 1fbf5161 authored by Matthias Messner's avatar Matthias Messner
parents 2430c1b7 d3e41e9c
......@@ -221,8 +221,9 @@ public:
* @param[in,out] output where to write the coordinate
* @param[in] inCoordinate the coordinate to write out
* @return the output for multiple << operators
*/
friend std::ostream& operator<<(std::ostream& output, const FTreeCoordinate& inCoordinate){
*/
template <class StreamClass>
friend StreamClass& operator<<(StreamClass& output, const FTreeCoordinate& inCoordinate){
output << "(" << inCoordinate.getX() << ", " << inCoordinate.getY() << ", " << inCoordinate.getZ() <<")";
return output; // for multiple << operators.
}
......
......@@ -70,14 +70,19 @@ class FFmmAlgorithmThreadProc : protected FAssertable {
const int OctreeHeight;
/** An interval is the morton index interval
* that a proc use (it holds data in this interval)
*/
struct Interval{
MortonIndex min;
MortonIndex max;
};
/** My interval */
Interval*const intervals;
/** All process intervals */
Interval*const workingIntervalsPerLevel;
/** Get an interval from proc id and level */
Interval& getWorkingInterval(const int level, const int proc){
return workingIntervalsPerLevel[OctreeHeight * proc + level];
}
......@@ -85,10 +90,12 @@ class FFmmAlgorithmThreadProc : protected FAssertable {
public:
/** Get current proc interval at level */
Interval& getWorkingInterval(const int level){
return getWorkingInterval(level, idProcess);
}
/** Does the current proc has some work at this level */
bool hasWorkAtLevel(const int level){
return idProcess == 0 || getWorkingInterval(level, idProcess - 1).max < getWorkingInterval(level, idProcess).max;
}
......
......@@ -191,7 +191,8 @@ public:
* @param[in] inPosition the position to write out
* @return the output for multiple << operators
*/
friend std::ostream& operator<<(std::ostream& output, const FComplexe& inC){
template <class StreamClass>
friend StreamClass& operator<<(StreamClass& output, const FComplexe& inC){
output << "(" << inC.getReal() << ", " << inC.getImag() << ")";
return output; // for multiple << operators.
}
......
......@@ -81,7 +81,7 @@ struct FMath{
/** To get pow */
template <class NumType>
static NumType pow(const NumType inValue, long power){
static NumType pow(const NumType inValue, int power){
NumType result = 1;
while(power-- > 0) result *= inValue;
return result;
......
......@@ -287,7 +287,8 @@ public:
* @param[in] inPosition the position to write out
* @return the output for multiple << operators
*/
friend std::ostream& operator<<(std::ostream& output, const FPoint& inPosition){
template <class StreamClass>
friend StreamClass& operator<<(StreamClass& output, const FPoint& inPosition){
output << "(" << inPosition.getX() << ", " << inPosition.getY() << ", " << inPosition.getZ() <<")";
return output; // for multiple << operators.
}
......
Markdown is supported
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