Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
range.h
Go to the documentation of this file.
1#ifndef _RHEO_RANGE_H
2#define _RHEO_RANGE_H
3//
4// This file is part of Rheolef.
5//
6// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7//
8// Rheolef is free software; you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation; either version 2 of the License, or
11// (at your option) any later version.
12//
13// Rheolef is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with Rheolef; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// =========================================================================
23// AUTHOR: Pierre.Saramito@imag.fr
24// DATE: 29 feb 2018
25
26namespace rheolef {
54} // namespace rheolef
55
56# include "rheolef/compiler.h"
57
58namespace rheolef {
59
60// [verbatim_range]
61struct range {
62 using size_type = size_t;
63 range (size_type start=0, size_type stop=0);
64 size_type start() const;
65 size_type size() const;
66 static range all();
67// [verbatim_range]
68protected:
70// [verbatim_range_cont]
71};
72// [verbatim_range_cont]
73
74// -------------------------------
75// inlined
76// -------------------------------
77
78inline
80 : _start (start),
81 _size (stop - start)
82{
83 check_macro (start <= stop, "invalid range ["<<_start<<":"<<stop<<"[");
84}
85inline range::size_type range::start() const { return _start; }
86inline range::size_type range::size() const { return _size; }
87inline range range::all() { return range(0, size_type (-1)); }
88
89} // namespace rheolef
90#endif // _RHEO_RANGE_H
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
see the range page for the full documentation
Definition range.h:61
size_type start() const
Definition range.h:85
static range all()
Definition range.h:87
size_type _start
Definition range.h:69
size_type size() const
Definition range.h:86
size_t size_type
Definition range.h:62
size_type _size
Definition range.h:69
range(size_type start=0, size_type stop=0)
Definition range.h:79