Skip to content
Snippets Groups Projects
Commit cc824903 authored by Markus Blatt's avatar Markus Blatt
Browse files

Finally got rid off the compiler warnings!

[[Imported from SVN: r279]]
parent c56a47e8
No related branches found
No related tags found
No related merge requests found
......@@ -329,7 +329,8 @@ namespace Dune
* @param graph The matrix graph to perform the search on.
*/
template<class G>
int breadthFirstSearch(const VertexDescriptor& start, int aggregate,
int breadthFirstSearch(const VertexDescriptor& start,
const AggregateDescriptor& aggregate,
G& graph) const;
/**
......@@ -342,7 +343,8 @@ namespace Dune
* @param visitedMap a map for marking the vertices as visited.
*/
template<class G, class VM>
int breadthFirstSearch(const VertexDescriptor& start, int aggregate,
int breadthFirstSearch(const VertexDescriptor& start,
const AggregateDescriptor& aggregate,
G& graph, VM& visitedMap) const;
/**
* @brief Breadth first search within an aggregate
......@@ -353,7 +355,7 @@ namespace Dune
* @param graph The matrix graph to perform the search on.
*
template<class G, class F1, class F2>
int breadthFirstSearch(const VertexDescriptor& start, int aggregate,
int breadthFirstSearch(const VertexDescriptor& start, AggregateDescriptor aggregate,
G& graph, F1& aggregateVisitor, F2& nongAggregateVisitor) const;
*/
/**
......@@ -374,7 +376,8 @@ namespace Dune
* aggregate. Use DummyVisitor these are of no interest.
*/
template<bool reset, class G, class F, class VM>
int breadthFirstSearch(const VertexDescriptor& start, int aggregate,
int breadthFirstSearch(const VertexDescriptor& start,
const AggregateDescriptor& aggregate,
G& graph,
F& aggregateVisitor,
VM& visitedMap) const;
......@@ -400,7 +403,8 @@ namespace Dune
* aggregate. Use DummyVisitor these are of no interest.
*/
template<bool remove, bool reset, class G, class L, class F1, class F2, class VM>
int breadthFirstSearch(const VertexDescriptor& start, int aggregate,
int breadthFirstSearch(const VertexDescriptor& start,
const AggregateDescriptor& aggregate,
G& graph, L& visited, F1& aggregateVisitor,
F2& nonAggregateVisitor,
VM& visitedMap) const;
......@@ -756,7 +760,7 @@ namespace Dune
/** @brief Mapping of vertices to aggregates. */
const AggregatesMap<Vertex>& aggregates_;
/** @brief The aggregate id we want to visit. */
int aggregate_;
AggregateDescriptor aggregate_;
/** @brief The visitor to use on the aggregate. */
Visitor& visitor_;
};
......@@ -1202,7 +1206,8 @@ namespace Dune
template<class V>
template<class G>
inline int AggregatesMap<V>::breadthFirstSearch(const V& start, int aggregate,
inline int AggregatesMap<V>::breadthFirstSearch(const V& start,
const AggregateDescriptor& aggregate,
G& graph) const
{
typename PropertyMapTypeSelector<VertexVisitedTag,G>::Type visitedMap = get(VertexVisitedTag(), graph);
......@@ -1213,7 +1218,8 @@ namespace Dune
template<class V>
template<class G, class VM>
inline int AggregatesMap<V>::breadthFirstSearch(const V& start, int aggregate,
inline int AggregatesMap<V>::breadthFirstSearch(const V& start,
const AggregateDescriptor& aggregate,
G& graph, VM& visitedMap) const
{
VertexList vlist;
......@@ -1224,7 +1230,8 @@ namespace Dune
template<class V>
template<bool reset, class G, class F,class VM>
inline int AggregatesMap<V>::breadthFirstSearch(const V& start, int aggregate,
inline int AggregatesMap<V>::breadthFirstSearch(const V& start,
const AggregateDescriptor& aggregate,
G& graph, F& aggregateVisitor,
VM& visitedMap) const
{
......@@ -1235,7 +1242,8 @@ namespace Dune
template<class V>
template<bool remove, bool reset, class G, class L, class F1, class F2, class VM>
int AggregatesMap<V>::breadthFirstSearch(const V& start, int aggregate,
int AggregatesMap<V>::breadthFirstSearch(const V& start,
const AggregateDescriptor& aggregate,
G& graph,
L& visited,
F1& aggregateVisitor,
......
......@@ -277,17 +277,17 @@ namespace Dune
} // end namespace Amg
template<typename G, typename EP>
struct PropertyMapTypeSelector<Amg::VertexVisitedTag,Amg::PropertiesGraph<G,Amg::VertexProperties,EP> >
template<typename G, typename EP, typename VM, typename EM>
struct PropertyMapTypeSelector<Amg::VertexVisitedTag,Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM> >
{
typedef Amg::PropertyGraphVertexPropertyMap<Amg::PropertiesGraph<G,Amg::VertexProperties,EP>, Amg::VertexProperties::VISITED> Type;
typedef Amg::PropertyGraphVertexPropertyMap<Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM>, Amg::VertexProperties::VISITED> Type;
};
template<typename G, typename EP>
typename PropertyMapTypeSelector<Amg::VertexVisitedTag,Amg::PropertiesGraph<G,Amg::VertexProperties,EP> >::Type
get(const Amg::VertexVisitedTag& tag, Amg::PropertiesGraph<G,Amg::VertexProperties,EP>& graph)
template<typename G, typename EP, typename VM, typename EM>
typename PropertyMapTypeSelector<Amg::VertexVisitedTag,Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM> >::Type
get(const Amg::VertexVisitedTag& tag, Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM>& graph)
{
return Amg::PropertyGraphVertexPropertyMap<Amg::PropertiesGraph<G,Amg::VertexProperties,EP>, Amg::VertexProperties::VISITED>(graph);
return Amg::PropertyGraphVertexPropertyMap<Amg::PropertiesGraph<G,Amg::VertexProperties,EP,VM,EM>, Amg::VertexProperties::VISITED>(graph);
}
namespace Amg
......
......@@ -451,11 +451,9 @@ namespace Dune
{
typedef typename Set::const_iterator Iterator;
Iterator end = connected.end();
for(Iterator entry = connected.begin(); entry != end; ++entry) {
int ientry = *entry;
int aggregate = aggregates_[*entry];
for(Iterator entry = connected.begin(); entry != end; ++entry)
row_.insert(*entry);
}
++row_;
}
......
This diff is collapsed.
......@@ -114,7 +114,7 @@ void fillValues(M& mat, int overlapStart, int overlapEnd, int start, int end)
for(ColIterator j = (*i).begin(); j != endi; ++j)
if(j.index() == i.index())
*j=dval;
else if(std::abs(j.index()-i.index())==1)
else if(j.index()+1==i.index() || i.index()+1==j.index())
*j=beps;
else
*j=bmone;
......@@ -184,7 +184,7 @@ public:
: aggregates_(aggregates), indexset_(indexset)
{}
inline const TG& operator[](std::ptrdiff_t index) const
inline const TG& operator[](std::size_t index) const
{
const T& aggregate = aggregates_[index];
const Dune::IndexPair<TG,Dune::ParallelLocalIndex<TA> >& pair = indexset_.pair(aggregate);
......@@ -257,7 +257,7 @@ void testCoarsenIndices()
typedef Dune::Amg::MatrixGraph<BCRSMat> MatrixGraph;
typedef Dune::Amg::SubGraph<Dune::Amg::MatrixGraph<BCRSMat>,std::vector<bool> > SubGraph;
typedef Dune::Amg::PropertiesGraph<SubGraph,Dune::Amg::VertexProperties,
Dune::Amg::EdgeProperties> PropertiesGraph;
Dune::Amg::EdgeProperties, Dune::IdentityMap, typename SubGraph::EdgeIndexMap> PropertiesGraph;
typedef typename PropertiesGraph::VertexDescriptor Vertex;
typedef Dune::Amg::Aggregates<PropertiesGraph> Aggregates;
typedef Dune::Amg::SymmetricCriterion<PropertiesGraph,BCRSMat,Dune::Amg::FirstDiagonal>
......@@ -274,7 +274,7 @@ void testCoarsenIndices()
*iter = (index->local().attribute()==overlap);
SubGraph sg(mg, excluded);
PropertiesGraph pg(sg);
PropertiesGraph pg(sg, Dune::IdentityMap(), sg.getEdgeIndexMap());
Aggregates aggregates;
Dune::Amg::AggregatesMap<Vertex> aggregatesMap(pg.maxVertex());
......@@ -311,7 +311,7 @@ void testCoarsenIndices()
Dune::Amg::printAggregates2d(aggregatesMap, n, N, std::cout);
communicator.template forward<AggregatesGatherScatter<int,int,GridFlag,101> >(gmap);
communicator.template forward<AggregatesGatherScatter<typename MatrixGraph::VertexDescriptor,int,GridFlag,101> >(gmap);
std::cout<<"Communicated: ";
Dune::Amg::printAggregates2d(aggregatesMap, n, N, std::cout);
......@@ -332,7 +332,7 @@ void testCoarsenIndices()
assert(N*N==mg.maxVertex());
bool visitedIterator[N*N];
for(int i=0; i < mg.maxVertex(); ++i)
for(std::size_t i=0; i < mg.maxVertex(); ++i)
visitedIterator[i]=false;
VisitedMap2 visitedMap2(visitedIterator, Dune::IdentityMap());
......@@ -348,6 +348,6 @@ void testCoarsenIndices()
int main(int argc, char **argv)
{
MPI_Init(&argc, &argv);
testCoarsenIndices<8,1>();
testCoarsenIndices<10,1>();
MPI_Finalize();
}
......@@ -491,7 +491,7 @@ void testGraph ()
SymmetricCriterion<PropertiesGraph,BCRSMat,FirstDiagonal> crit;
Dune::Amg::Aggregates<PropertiesGraph> aggregates;
Dune::Amg::AggregatesMap<int> aggregatesMap(pgraph.maxVertex());
Dune::Amg::AggregatesMap<PropertiesGraph::VertexDescriptor> aggregatesMap(pgraph.maxVertex());
aggregates.build(laplacian2d, pgraph, aggregatesMap, crit);
Dune::Amg::printAggregates2d(aggregatesMap, N, N, std::cout);
......@@ -513,7 +513,7 @@ void testAggregate(double eps)
typedef Dune::Amg::MatrixGraph<BCRSMat> BCRSGraph;
typedef Dune::Amg::SubGraph<BCRSGraph,std::vector<bool> > SubGraph;
typedef Dune::Amg::PropertiesGraph<BCRSGraph,Dune::Amg::VertexProperties,Dune::Amg::EdgeProperties> PropertiesGraph;
typedef Dune::Amg::PropertiesGraph<SubGraph,Dune::Amg::VertexProperties,Dune::Amg::EdgeProperties> SPropertiesGraph;
typedef Dune::Amg::PropertiesGraph<SubGraph,Dune::Amg::VertexProperties,Dune::Amg::EdgeProperties,Dune::IdentityMap,SubGraph::EdgeIndexMap> SPropertiesGraph;
BCRSGraph graph(mat);
PropertiesGraph pgraph(graph);
......@@ -526,7 +526,7 @@ void testAggregate(double eps)
}
SubGraph sgraph(graph, excluded);
SPropertiesGraph spgraph(sgraph);
SPropertiesGraph spgraph(sgraph, Dune::IdentityMap(), sgraph.getEdgeIndexMap());
using Dune::Amg::FirstDiagonal;
......@@ -541,7 +541,7 @@ void testAggregate(double eps)
SymmetricCriterion<SPropertiesGraph,BCRSMat, FirstDiagonal> scrit;
Dune::Amg::Aggregates<SPropertiesGraph> saggregates;
Dune::Amg::AggregatesMap<int> aggregatesMap(pgraph.maxVertex());
Dune::Amg::AggregatesMap<PropertiesGraph::VertexDescriptor> aggregatesMap(pgraph.maxVertex());
aggregates.build(mat, pgraph, aggregatesMap, crit);
......@@ -549,7 +549,7 @@ void testAggregate(double eps)
std::cout<<"Excluded!"<<std::endl;
Dune::Amg::AggregatesMap<int> saggregatesMap(pgraph.maxVertex());
Dune::Amg::AggregatesMap<SPropertiesGraph::VertexDescriptor> saggregatesMap(pgraph.maxVertex());
saggregates.build(mat, spgraph, saggregatesMap, scrit);
Dune::Amg::printAggregates2d(saggregatesMap, N, N, std::cout);
......
......@@ -23,6 +23,8 @@ int meassure(const T& selection)
typedef typename T::const_iterator iterator;
const iterator end = selection.end();
const iterator iterOrig = selection.begin();
int count=0;
Dune::Timer timer;
timer.reset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment