Chris@49: // Copyright (C) 2010-2012 NICTA (www.nicta.com.au) Chris@49: // Copyright (C) 2010-2012 Conrad Sanderson Chris@49: // Copyright (C) 2011 Stanislav Funiak Chris@49: // Chris@49: // This Source Code Form is subject to the terms of the Mozilla Public Chris@49: // License, v. 2.0. If a copy of the MPL was not distributed with this Chris@49: // file, You can obtain one at http://mozilla.org/MPL/2.0/. Chris@49: Chris@49: Chris@49: Chris@49: //! \addtogroup span Chris@49: //! @{ Chris@49: Chris@49: Chris@49: struct span_alt {}; Chris@49: Chris@49: Chris@49: template Chris@49: class span_base Chris@49: { Chris@49: public: Chris@49: static const span_alt all; Chris@49: }; Chris@49: Chris@49: Chris@49: template Chris@49: const span_alt span_base::all = span_alt(); Chris@49: Chris@49: Chris@49: class span : public span_base<> Chris@49: { Chris@49: public: Chris@49: Chris@49: uword a; Chris@49: uword b; Chris@49: bool whole; Chris@49: Chris@49: inline Chris@49: span() Chris@49: : whole(true) Chris@49: { Chris@49: } Chris@49: Chris@49: Chris@49: inline Chris@49: span(const span_alt&) Chris@49: : whole(true) Chris@49: { Chris@49: } Chris@49: Chris@49: // TODO: Chris@49: // if the "explicit" keyword is removed or commented out, Chris@49: // the compiler will be able to automatically convert integers to an instance of the span class. Chris@49: // this is useful for Cube::operator()(span&, span&, span&), Chris@49: // but it might have unintended consequences or interactions elsewhere. Chris@49: // as such, removal of "explicit" needs thorough testing. Chris@49: inline Chris@49: explicit Chris@49: span(const uword in_a) Chris@49: : a(in_a) Chris@49: , b(in_a) Chris@49: , whole(false) Chris@49: { Chris@49: } Chris@49: Chris@49: Chris@49: #if defined(ARMA_USE_CXX11) Chris@49: span(const double in_a) = delete; Chris@49: #endif Chris@49: Chris@49: Chris@49: inline Chris@49: span(const uword in_a, const uword in_b) Chris@49: : a(in_a) Chris@49: , b(in_b) Chris@49: , whole(false) Chris@49: { Chris@49: } Chris@49: Chris@49: }; Chris@49: Chris@49: Chris@49: Chris@49: //! @}