fei_GraphReducer.cpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2007 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 #include <fei_macros.hpp>
00010 
00011 #include <fei_GraphReducer.hpp>
00012 #include <fei_TemplateUtils.hpp>
00013 #include <fei_VectorSpace.hpp>
00014 
00015 #undef fei_file
00016 #define fei_file "fei_GraphReducer.cpp"
00017 #include <fei_ErrMacros.hpp>
00018 
00019 //----------------------------------------------------------------------------
00020 fei::GraphReducer::GraphReducer(fei::SharedPtr<fei::Reducer> reducer,
00021                               fei::SharedPtr<fei::Graph> target)
00022   : reducer_(reducer),
00023     target_(target)
00024 {
00025 }
00026 
00027 //----------------------------------------------------------------------------
00028 fei::GraphReducer::~GraphReducer()
00029 {
00030 }
00031 
00032 //----------------------------------------------------------------------------
00033 int fei::GraphReducer::addIndices(int row, int len, const int* indices)
00034 {
00035   reducer_->addGraphIndices(1, &row, len, indices, *target_);
00036   return(0);
00037 }
00038 
00039 //----------------------------------------------------------------------------
00040 int fei::GraphReducer::addSymmetricIndices(int numIndices, int* indices,
00041                                          bool diagonal)
00042 {
00043   reducer_->addSymmetricGraphIndices(numIndices, indices, diagonal, *target_);
00044   return(0);
00045 }
00046 
00047 //----------------------------------------------------------------------------
00048 int fei::GraphReducer::writeLocalGraph(FEI_OSTREAM& os, bool debug,
00049             bool prefixLinesWithPoundSign)
00050 {
00051   return(target_->writeLocalGraph(os, debug, prefixLinesWithPoundSign));
00052 }
00053 
00054 //----------------------------------------------------------------------------
00055 int fei::GraphReducer::writeRemoteGraph(FEI_OSTREAM& os)
00056 {
00057   return(target_->writeRemoteGraph(os));
00058 }
00059 
00060 //----------------------------------------------------------------------------
00061 int fei::GraphReducer::gatherFromOverlap()
00062 {
00063   reducer_->assembleReducedGraph(target_.get(), false);
00064   return(target_->gatherFromOverlap());
00065 }
00066 

Generated on Tue Jul 13 09:27:45 2010 for FEI by  doxygen 1.4.7