FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_GraphReducer.cpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2007 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #include <fei_macros.hpp>
10 
11 #include <fei_GraphReducer.hpp>
12 #include <fei_TemplateUtils.hpp>
13 #include <fei_VectorSpace.hpp>
14 
15 #undef fei_file
16 #define fei_file "fei_GraphReducer.cpp"
17 #include <fei_ErrMacros.hpp>
18 
19 //----------------------------------------------------------------------------
22  : reducer_(reducer),
23  target_(target)
24 {
25 }
26 
27 //----------------------------------------------------------------------------
29 {
30 }
31 
32 //----------------------------------------------------------------------------
33 int fei::GraphReducer::addIndices(int row, int len, const int* indices)
34 {
35  reducer_->addGraphIndices(1, &row, len, indices, *target_);
36  return(0);
37 }
38 
39 //----------------------------------------------------------------------------
40 int fei::GraphReducer::addSymmetricIndices(int numIndices, int* indices,
41  bool diagonal)
42 {
43  reducer_->addSymmetricGraphIndices(numIndices, indices, diagonal, *target_);
44  return(0);
45 }
46 
47 //----------------------------------------------------------------------------
48 int fei::GraphReducer::writeLocalGraph(FEI_OSTREAM& os, bool debug,
49  bool prefixLinesWithPoundSign)
50 {
51  return(target_->writeLocalGraph(os, debug, prefixLinesWithPoundSign));
52 }
53 
54 //----------------------------------------------------------------------------
56 {
57  return(target_->writeRemoteGraph(os));
58 }
59 
60 //----------------------------------------------------------------------------
62 {
63  reducer_->assembleReducedGraph(target_.get(), false);
64  return(target_->gatherFromOverlap());
65 }
66 
int writeRemoteGraph(FEI_OSTREAM &os)
int writeLocalGraph(FEI_OSTREAM &os, bool debug=false, bool prefixLinesWithPoundSign=true)
int addIndices(int row, int len, const int *indices)
int addSymmetricIndices(int numIndices, int *indices, bool diagonal=false)
GraphReducer(fei::SharedPtr< fei::Reducer > reducer, fei::SharedPtr< fei::Graph > target)