FEI Version of the Day
fei_GraphReducer.hpp
00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_GraphReducer_hpp_
00010 #define _fei_GraphReducer_hpp_
00011 
00012 #include <fei_iosfwd.hpp>
00013 #include <fei_SharedPtr.hpp>
00014 #include <fei_Graph.hpp>
00015 #include <fei_CommUtils.hpp>
00016 #include <fei_Reducer.hpp>
00017 #include <snl_fei_RaggedTable_specialize.hpp>
00018 
00019 namespace fei {
00020 
00022   class GraphReducer : public fei::Graph {
00023   public:
00025     GraphReducer(fei::SharedPtr<fei::Reducer> reducer,
00026                  fei::SharedPtr<fei::Graph> target);
00027 
00029     virtual ~GraphReducer();
00030 
00032     int addIndices(int row,
00033        int len,
00034        const int* indices);
00035 
00039     int addSymmetricIndices(int numIndices,
00040           int* indices,
00041           bool diagonal=false);
00042 
00044     int gatherFromOverlap();
00045 
00048     table_type* getLocalGraph()
00049       {
00050   return( target_->getLocalGraph());
00051       }
00052 
00054     std::vector<remote_table_type*>& getRemoteGraph()
00055       {
00056   return( target_->getRemoteGraph());
00057       }
00058 
00060     int writeLocalGraph(FEI_OSTREAM& os,
00061       bool debug=false,
00062       bool prefixLinesWithPoundSign=true);
00063 
00065     int writeRemoteGraph(FEI_OSTREAM& os);
00066 
00067   private:
00068     fei::SharedPtr<fei::Reducer> reducer_;
00069     fei::SharedPtr<fei::Graph> target_;
00070   };//class GraphReducer
00071 
00072 } //namespace fei
00073 
00074 #endif // _fei_GraphReducer_hpp_
00075 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends