/* * Advanced Simulation Library * * Copyright 2015 Avtech Scientific * * * This file is part of Advanced Simulation Library (ASL). * * ASL is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, version 3 of the License. * * ASL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with ASL. If not, see . * */ #ifndef ASLNUMMETHOD_H #define ASLNUMMETHOD_H #include #include namespace asl { /// Virtual class describes general interface for Numerical methods; /// \ingroup Numerics class NumMethod { public: /// Executes the numerical procedure virtual void execute() = 0; /// Builds the necesery internal data and kernels virtual void init() = 0; virtual ~NumMethod(); }; typedef std::shared_ptr SPNumMethod; template inline void initAll(std::vector &v); template inline void initAll(std::vector > & v); template inline void executeAll(std::vector &v); template inline void executeAll(std::vector > & v); //---------------------------- Implementation --------------------------- template void executeAll(std::vector &v) { for (unsigned int i(0); i < v.size(); ++i) v[i]->execute(); } template void executeAll(std::vector > &v) { for (unsigned int i(0); i < v.size(); ++i) v[i]->execute(); } template void initAll(std::vector &v) { for (unsigned int i(0); i < v.size(); ++i) v[i]->init(); } template void initAll(std::vector > &v) { for (unsigned int i(0); i < v.size(); ++i) v[i]->init(); } } //asl #endif //ASLNUMMETHOD_H