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
26
namespace
rheolef
{
54
}
// namespace rheolef
55
56
# include "rheolef/compiler.h"
57
58
namespace
rheolef
{
59
60
// [verbatim_range]
61
struct
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]
68
protected
:
69
size_type
_start
,
_size
;
70
// [verbatim_range_cont]
71
};
72
// [verbatim_range_cont]
73
74
// -------------------------------
75
// inlined
76
// -------------------------------
77
78
inline
79
range::range
(
size_type
start,
size_type
stop)
80
: _start (start),
81
_size (stop - start)
82
{
83
check_macro
(
start
<= stop,
"invalid range ["
<<
_start
<<
":"
<<stop<<
"["
);
84
}
85
inline
range::size_type
range::start
()
const
{
return
_start
; }
86
inline
range::size_type
range::size
()
const
{
return
_size
; }
87
inline
range
range::all
() {
return
range
(0,
size_type
(-1)); }
88
89
}
// namespace rheolef
90
#endif
// _RHEO_RANGE_H
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
rheolef
This file is part of Rheolef.
Definition
compiler_eigen.h:39
rheolef::range
see the range page for the full documentation
Definition
range.h:61
rheolef::range::start
size_type start() const
Definition
range.h:85
rheolef::range::all
static range all()
Definition
range.h:87
rheolef::range::_start
size_type _start
Definition
range.h:69
rheolef::range::size
size_type size() const
Definition
range.h:86
rheolef::range::size_type
size_t size_type
Definition
range.h:62
rheolef::range::_size
size_type _size
Definition
range.h:69
rheolef::range::range
range(size_type start=0, size_type stop=0)
Definition
range.h:79