max@0: // Copyright (C) 2010-2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2010-2011 Conrad Sanderson max@0: // Copyright (C) 2011 Stanislav Funiak max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: max@0: //! \addtogroup span max@0: //! @{ max@0: max@0: max@0: struct span_alt {}; max@0: max@0: max@0: template max@0: class span_base max@0: { max@0: public: max@0: static const span_alt all; max@0: }; max@0: max@0: max@0: template max@0: const span_alt span_base::all = span_alt(); max@0: max@0: max@0: class span : public span_base<> max@0: { max@0: public: max@0: max@0: uword a; max@0: uword b; max@0: bool whole; max@0: max@0: inline max@0: span() max@0: : whole(true) max@0: { max@0: } max@0: max@0: max@0: inline max@0: span(const span_alt&) max@0: : whole(true) max@0: { max@0: } max@0: max@0: // TODO: max@0: // if the "explicit" keyword is removed or commented out, max@0: // the compiler will be able to automatically convert integers to an instance of the span class. max@0: // this is useful for Cube::operator()(span&, span&, span&), max@0: // but it might have unintended consequences or interactions elsewhere. max@0: // as such, removal of "explicit" needs thorough testing. max@0: inline max@0: explicit max@0: span(const uword in_a) max@0: : a(in_a) max@0: , b(in_a) max@0: , whole(false) max@0: { max@0: } max@0: max@0: inline max@0: span(const uword in_a, const uword in_b) max@0: : a(in_a) max@0: , b(in_b) max@0: , whole(false) max@0: { max@0: } max@0: max@0: }; max@0: max@0: max@0: max@0: //! @}