// L============================================================================= // L This software is distributed under the MIT license. // L Copyright 2021 Péter Kardos // L============================================================================= #pragma once #include "../Matrix/MatrixImpl.hpp" #include "ZeroBuilder.hpp" namespace mathter { class ZeroBuilder { public: ZeroBuilder() = default; ZeroBuilder& operator=(const ZeroBuilder&) = delete; template operator Matrix() const { Matrix m; Set(m); return m; } private: template void Set(Matrix& m) const { for (auto& stripe : m.stripes) { Fill(stripe, T(0)); } } }; /// Creates a matrix with all elements zero. inline auto Zero() { return ZeroBuilder{}; } } // namespace mathter