// @HEADER // ***************************************************************************** // Rapid Optimization Library (ROL) Package // // Copyright 2014 NTESS and the ROL contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef ROLSINGLETONTEUCHOSBATCHMANAGER_HPP #define ROLSINGLETONTEUCHOSBATCHMANAGER_HPP #include "ROL_TeuchosBatchManager.hpp" #include "ROL_SingletonVector.hpp" namespace ROL { template class SingletonTeuchosBatchManager : public TeuchosBatchManager { public: SingletonTeuchosBatchManager(const ROL::Ptr > &comm) : TeuchosBatchManager(comm) {} using TeuchosBatchManager::sumAll; void sumAll(Vector &input, Vector &output) { Real inval = dynamic_cast&>(input).getValue(); Real outval(0); TeuchosBatchManager::sumAll(&inval,&outval,1); dynamic_cast&>(output).setValue(outval); } }; } #endif