Fix order on class members to match constructor initialization -Wreorder

Make all non-templated PrintVectors methods inline
parent 6db0c4e7
......@@ -111,17 +111,17 @@ public:
// Build the mesh and fill in the values
contourtree::Mesh2D_DEM_Triangulation<FieldType,StorageType,DeviceAdapter>
mesh(fieldArray, nRows, nCols, device);
mesh(fieldArray, nRows, nCols);
// Initialize the join tree so that all arcs point to maxima
contourtree::MergeTree<FieldType,StorageType,DeviceAdapter>
joinTree(fieldArray, nRows, nCols, nSlices, JOIN, device);
joinTree(fieldArray, nRows, nCols, nSlices, JOIN);
mesh.SetStarts(joinTree.extrema, JOIN);
joinTree.BuildRegularChains();
// Create the active topology graph from the regular graph
contourtree::ChainGraph<FieldType,StorageType,DeviceAdapter>
joinGraph(fieldArray, joinTree.extrema, JOIN, device);
joinGraph(fieldArray, joinTree.extrema, JOIN);
mesh.SetSaddleStarts(joinGraph, JOIN);
// Call join graph to finish computation
......@@ -129,13 +129,13 @@ public:
// Initialize the split tree so that all arcs point to maxima
contourtree::MergeTree<FieldType,StorageType,DeviceAdapter>
splitTree(fieldArray, nRows, nCols, nSlices, SPLIT, device);
splitTree(fieldArray, nRows, nCols, nSlices, SPLIT);
mesh.SetStarts(splitTree.extrema, SPLIT);
splitTree.BuildRegularChains();
// Create the active topology graph from the regular graph
contourtree::ChainGraph<FieldType,StorageType,DeviceAdapter>
splitGraph(fieldArray, splitTree.extrema, SPLIT, device);
splitGraph(fieldArray, splitTree.extrema, SPLIT);
mesh.SetSaddleStarts(splitGraph, SPLIT);
// Call split graph to finish computation
......@@ -144,9 +144,8 @@ public:
// Now compute the contour tree
contourtree::ContourTree<FieldType,StorageType,DeviceAdapter>
contourTree(fieldArray,
joinTree, joinGraph,
splitTree, splitGraph,
device);
joinTree, splitTree,
joinGraph, splitGraph);
contourTree.CollectSaddlePeak(saddlePeak);
}
......@@ -166,17 +165,17 @@ public:
{
// Build the mesh and fill in the values
contourtree::Mesh3D_DEM_Triangulation<FieldType,StorageType,DeviceAdapter>
mesh(fieldArray, nRows, nCols, nSlices, device);
mesh(fieldArray, nRows, nCols, nSlices);
// Initialize the join tree so that all arcs point to maxima
contourtree::MergeTree<FieldType,StorageType,DeviceAdapter>
joinTree(fieldArray, nRows, nCols, nSlices, JOIN_3D, device);
joinTree(fieldArray, nRows, nCols, nSlices, JOIN_3D);
mesh.SetStarts(joinTree.extrema, JOIN_3D);
joinTree.BuildRegularChains();
// Create the active topology graph from the regular graph
contourtree::ChainGraph<FieldType,StorageType,DeviceAdapter>
joinGraph(fieldArray, joinTree.extrema, JOIN_3D, device);
joinGraph(fieldArray, joinTree.extrema, JOIN_3D);
mesh.SetSaddleStarts(joinGraph, JOIN_3D);
// Call join graph to finish computation
......@@ -184,13 +183,13 @@ public:
// Initialize the split tree so that all arcs point to maxima
contourtree::MergeTree<FieldType,StorageType,DeviceAdapter>
splitTree(fieldArray, nRows, nCols, nSlices, SPLIT_3D, device);
splitTree(fieldArray, nRows, nCols, nSlices, SPLIT_3D);
mesh.SetStarts(splitTree.extrema, SPLIT_3D);
splitTree.BuildRegularChains();
// Create the active topology graph from the regular graph
contourtree::ChainGraph<FieldType,StorageType,DeviceAdapter>
splitGraph(fieldArray, splitTree.extrema, SPLIT_3D, device);
splitGraph(fieldArray, splitTree.extrema, SPLIT_3D);
mesh.SetSaddleStarts(splitGraph, SPLIT_3D);
// Call split graph to finish computation
......@@ -199,9 +198,8 @@ public:
// Now compute the contour tree
contourtree::ContourTree<FieldType,StorageType,DeviceAdapter>
contourTree(fieldArray,
joinTree, joinGraph,
splitTree, splitGraph,
device);
joinTree, splitTree,
joinGraph, splitGraph);
contourTree.CollectSaddlePeak(saddlePeak);
}
......
......@@ -176,8 +176,7 @@ public:
// constructor takes necessary references
ChainGraph(const vtkm::cont::ArrayHandle<T,StorageType> &Values,
vtkm::cont::ArrayHandle<vtkm::Id> &ArcArray,
bool IsJoinGraph,
DeviceAdapter Device) :
bool IsJoinGraph) :
values(Values),
arcArray(ArcArray),
isJoinGraph(IsJoinGraph) {}
......
......@@ -207,10 +207,9 @@ public:
// contour tree constructor
ContourTree(const vtkm::cont::ArrayHandle<T,StorageType> &Values,
MergeTree<T,StorageType,DeviceAdapter> &JoinTree,
ChainGraph<T,StorageType,DeviceAdapter> &JoinGraph,
MergeTree<T,StorageType,DeviceAdapter> &SplitTree,
ChainGraph<T,StorageType,DeviceAdapter> &SplitGraph,
DeviceAdapter Device);
ChainGraph<T,StorageType,DeviceAdapter> &JoinGraph,
ChainGraph<T,StorageType,DeviceAdapter> &SplitGraph);
// routines for computing the contour tree
// combines the list of active vertices for join & split trees
......@@ -281,14 +280,13 @@ template <typename T, typename StorageType, typename DeviceAdapter>
ContourTree<T,StorageType,DeviceAdapter>::ContourTree(
const vtkm::cont::ArrayHandle<T,StorageType> &Values,
MergeTree<T,StorageType,DeviceAdapter> &JoinTree,
ChainGraph<T,StorageType,DeviceAdapter> &JoinGraph,
MergeTree<T,StorageType,DeviceAdapter> &SplitTree,
ChainGraph<T,StorageType,DeviceAdapter> &SplitGraph,
DeviceAdapter Device)
ChainGraph<T,StorageType,DeviceAdapter> &JoinGraph,
ChainGraph<T,StorageType,DeviceAdapter> &SplitGraph)
: values(Values),
joinTree(JoinTree),
joinGraph(JoinGraph),
splitTree(SplitTree),
joinGraph(JoinGraph),
splitGraph(SplitGraph)
{
......@@ -895,7 +893,6 @@ void ContourTree<T,StorageType,DeviceAdapter>::CollectSaddlePeak(
} // per vertex
// Setting saddlePeak reference to the make_ArrayHandle directly does not work
vtkm::Id nSuperarcs = superarcVector.size();
vtkm::cont::ArrayHandle<vtkm::Pair<vtkm::Id,vtkm::Id> > tempArray = vtkm::cont::make_ArrayHandle(superarcVector);
// now sort it
......@@ -903,7 +900,7 @@ void ContourTree<T,StorageType,DeviceAdapter>::CollectSaddlePeak(
DeviceAlgorithm::Copy(tempArray, saddlePeak);
#ifdef DEBUG_PRINT
for (vtkm::Id superarc = 0; superarc < nSuperarcs; superarc++)
for (vtkm::UInt32 superarc = 0; superarc < superarcVector.size(); superarc++)
{
std::cout << std::setw(PRINT_WIDTH) << saddlePeak.GetPortalControl().Get(superarc).first << " ";
std::cout << std::setw(PRINT_WIDTH) << saddlePeak.GetPortalControl().Get(superarc).second << std::endl;
......
......@@ -133,11 +133,12 @@ class MergeTree
public:
typedef typename vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter> DeviceAlgorithm;
vtkm::Id nRows, nCols, nSlices, nVertices, nLogSteps;
// original data array
const vtkm::cont::ArrayHandle<T,StorageType> &values;
// size of mesh
vtkm::Id nRows, nCols, nSlices, nVertices, nLogSteps;
// whether it is join or split tree
bool isJoinTree;
......@@ -155,8 +156,7 @@ public:
vtkm::Id NRows,
vtkm::Id NCols,
vtkm::Id NSlices,
bool IsJoinTree,
DeviceAdapter Device);
bool IsJoinTree);
// routine that does pointer-doubling in the mergeArc array
void BuildRegularChains();
......@@ -181,8 +181,7 @@ MergeTree<T,StorageType,DeviceAdapter>::MergeTree(
vtkm::Id NRows,
vtkm::Id NCols,
vtkm::Id NSlices,
bool IsJoinTree,
DeviceAdapter Device) :
bool IsJoinTree) :
values(Values),
nRows(NRows),
nCols(NCols),
......
......@@ -108,20 +108,19 @@ class Mesh2D_DEM_Triangulation
public:
typedef typename vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter> DeviceAlgorithm;
// size of the mesh
vtkm::Id nRows, nCols, nVertices, nLogSteps;
// original data array
const vtkm::cont::ArrayHandle<T,StorageType> &values;
// size of the mesh
vtkm::Id nRows, nCols, nVertices, nLogSteps;
// Array with neighbourhood masks
vtkm::cont::ArrayHandle<vtkm::Id> neighbourhoodMask;
// constructor
Mesh2D_DEM_Triangulation(const vtkm::cont::ArrayHandle<T,StorageType> &Values,
vtkm::Id NRows,
vtkm::Id NCols,
DeviceAdapter Device);
vtkm::Id NCols);
// sets all vertices to point along an outgoing edge (except extrema)
void SetStarts(vtkm::cont::ArrayHandle<vtkm::Id> &chains,
......@@ -157,8 +156,7 @@ template<typename T, typename StorageType, typename DeviceAdapter>
Mesh2D_DEM_Triangulation<T,StorageType,DeviceAdapter>::Mesh2D_DEM_Triangulation(
const vtkm::cont::ArrayHandle<T,StorageType> &Values,
vtkm::Id NRows,
vtkm::Id NCols,
DeviceAdapter Device) :
vtkm::Id NCols) :
values(Values),
nRows(NRows),
nCols(NCols)
......
......@@ -116,12 +116,12 @@ public:
typedef typename vtkm::cont::ArrayHandle<vtkm::UInt16>::template
ExecutionTypes<DeviceAdapter>::PortalConst IdPortalType;
IdComponentPortalType neighbourTable; // (input) table for neighbour offsets
IdPortalType caseTable; // (input) case table for neighbours
vtkm::Id nRows; // (input) number of rows in 3D
vtkm::Id nCols; // (input) number of cols in 3D
vtkm::Id nSlices; // (input) number of cols in 3D
bool ascending; // (input) ascending or descending (join or split)
IdComponentPortalType neighbourTable; // (input) table for neighbour offsets
IdPortalType caseTable; // (input) case table for neighbours
// Constructor
VTKM_EXEC_CONT
......
......@@ -110,25 +110,24 @@ class Mesh3D_DEM_Triangulation
public:
typedef typename vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter> DeviceAlgorithm;
// size of the mesh
vtkm::Id nRows, nCols, nSlices, nVertices, nLogSteps;
// original data array
const vtkm::cont::ArrayHandle<T,StorageType> &values;
// size of the mesh
vtkm::Id nRows, nCols, nSlices, nVertices, nLogSteps;
// array with neighbourhood masks
vtkm::cont::ArrayHandle<vtkm::Id> neighbourhoodMask;
// case table information for finding neighbours
vtkm::cont::ArrayHandle<vtkm::UInt16> linkComponentCaseTable3D;
vtkm::cont::ArrayHandle<vtkm::IdComponent> neighbourOffsets3D;
vtkm::cont::ArrayHandle<vtkm::UInt16> linkComponentCaseTable3D;
// constructor
Mesh3D_DEM_Triangulation(const vtkm::cont::ArrayHandle<T,StorageType> &Values,
vtkm::Id NRows,
vtkm::Id NCols,
vtkm::Id NSlices,
DeviceAdapter Device);
vtkm::Id NSlices);
// sets all vertices to point along an outgoing edge (except extrema)
void SetStarts(vtkm::cont::ArrayHandle<vtkm::Id> &chains,
......@@ -144,8 +143,7 @@ Mesh3D_DEM_Triangulation<T,StorageType,DeviceAdapter>::Mesh3D_DEM_Triangulation(
const vtkm::cont::ArrayHandle<T,StorageType> &Values,
vtkm::Id NRows,
vtkm::Id NCols,
vtkm::Id NSlices,
DeviceAdapter Device) :
vtkm::Id NSlices) :
values(Values),
nRows(NRows),
nCols(NCols),
......
......@@ -110,12 +110,12 @@ public:
typedef typename vtkm::cont::ArrayHandle<vtkm::UInt16>::template
ExecutionTypes<DeviceAdapter>::PortalConst IdPortalType;
IdComponentPortalType neighbourTable; // (input) table for neighbour offsets
IdPortalType caseTable; // (input) case table for neighbours
vtkm::Id nRows; // (input) number of rows in 3D
vtkm::Id nCols; // (input) number of cols in 3D
vtkm::Id nSlices; // (input) number of cols in 3D
bool ascending; // (input) ascending or descending (join or split tree)
IdComponentPortalType neighbourTable; // (input) table for neighbour offsets
IdPortalType caseTable; // (input) case table for neighbours
// Constructor
VTKM_EXEC_CONT
......
......@@ -110,7 +110,7 @@ template<typename T, typename StorageType>
void printLabelledBlock(std::string label, const vtkm::cont::ArrayHandle<T, StorageType> &dVec, vtkm::Id nRows, vtkm::Id nColumns);
// utility routine to convert number to a string
std::string NumString(vtkm::Id number)
inline std::string NumString(vtkm::Id number)
{ // NumString()
char strBuf[20];
sprintf(strBuf, "%1d", (int) number);
......@@ -118,7 +118,7 @@ std::string NumString(vtkm::Id number)
} // NumString()
// base routines for printing label & prefix bars
void printLabel(std::string label)
inline void printLabel(std::string label)
{ // printLabel()
// print out the front end
std::cout << std::setw(PREFIX_WIDTH) << std::left << label;
......@@ -126,7 +126,7 @@ void printLabel(std::string label)
std::cout << std::right << "|";
} // printLabel()
void printSeparatingBar(vtkm::Id howMany)
inline void printSeparatingBar(vtkm::Id howMany)
{ // printSeparatingBar()
// print out the front end
std::cout << std::setw(PREFIX_WIDTH) << std::setfill('-') << "";
......@@ -147,13 +147,13 @@ void printDataType(T value)
} // printDataType
// routine to print out a single value
void printIndexType(vtkm::Id value)
inline void printIndexType(vtkm::Id value)
{ // printIndexType
std::cout << std::setw(PRINT_WIDTH) << value;
} // printIndexType
// header line
void printHeader(vtkm::Id howMany)
inline void printHeader(vtkm::Id howMany)
{ // printHeader()
if (howMany > printCols) howMany = printCols;
// print out a separating bar
......@@ -190,7 +190,7 @@ void printValues(std::string label, vtkm::cont::ArrayHandle<T,StorageType> &dVec
} // printValues()
// base routines for reading & writing host vectors
void printIndices(std::string label, vtkm::cont::ArrayHandle<vtkm::Id> &iVec, vtkm::Id nIndices)
inline void printIndices(std::string label, vtkm::cont::ArrayHandle<vtkm::Id> &iVec, vtkm::Id nIndices)
{
// -1 means full size
if (nIndices == -1)
......
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