span.hpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2010-2011 Conrad Sanderson
3 // Copyright (C) 2011 Stanislav Funiak
4 //
5 // This file is part of the Armadillo C++ library.
6 // It is provided without any warranty of fitness
7 // for any purpose. You can redistribute this file
8 // and/or modify it under the terms of the GNU
9 // Lesser General Public License (LGPL) as published
10 // by the Free Software Foundation, either version 3
11 // of the License or (at your option) any later version.
12 // (see http://www.opensource.org/licenses for more info)
13 
14 
15 
18 
19 
20 struct span_alt {};
21 
22 
23 template<typename Dummy = int>
24 class span_base
25  {
26  public:
27  static const span_alt all;
28  };
29 
30 
31 template<typename Dummy>
33 
34 
35 class span : public span_base<>
36  {
37  public:
38 
41  bool whole;
42 
43  inline
44  span()
45  : whole(true)
46  {
47  }
48 
49 
50  inline
51  span(const span_alt&)
52  : whole(true)
53  {
54  }
55 
56  // TODO:
57  // if the "explicit" keyword is removed or commented out,
58  // the compiler will be able to automatically convert integers to an instance of the span class.
59  // this is useful for Cube::operator()(span&, span&, span&),
60  // but it might have unintended consequences or interactions elsewhere.
61  // as such, removal of "explicit" needs thorough testing.
62  inline
63  explicit
64  span(const uword in_a)
65  : a(in_a)
66  , b(in_a)
67  , whole(false)
68  {
69  }
70 
71  inline
72  span(const uword in_a, const uword in_b)
73  : a(in_a)
74  , b(in_b)
75  , whole(false)
76  {
77  }
78 
79  };
80 
81 
82 
uword b
Definition: span.hpp:40
bool whole
Definition: span.hpp:41
Definition: span.hpp:35
u32 uword
Definition: typedef.hpp:85
span(const uword in_a)
Definition: span.hpp:64
uword a
Definition: span.hpp:39
span()
Definition: span.hpp:44
span(const span_alt &)
Definition: span.hpp:51
static const span_alt all
Definition: span.hpp:27
span(const uword in_a, const uword in_b)
Definition: span.hpp:72


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:58