Loading...
Searching...
No Matches
range.h
Go to the documentation of this file.
#ifndef _RHEO_RANGE_H
#define _RHEO_RANGE_H
//
// This file is part of Rheolef.
//
// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
//
// Rheolef is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Rheolef is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rheolef; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// =========================================================================
// AUTHOR: Pierre.Saramito@imag.fr
// DATE: 29 feb 2018
namespace rheolef {
} // namespace rheolef
# include "rheolef/compiler.h"
namespace rheolef {
// [verbatim_range]
struct range {
using size_type = size_t;
range (size_type start=0, size_type stop=0);
size_type start() const;
size_type size() const;
static range all();
// [verbatim_range]
protected:
size_type _start, _size;
// [verbatim_range_cont]
};
// [verbatim_range_cont]
// -------------------------------
// inlined
// -------------------------------
inline
range::range (size_type start, size_type stop)
: _start (start),
_size (stop - start)
{
check_macro (start <= stop, "invalid range ["<<_start<<":"<<stop<<"[");
}
inline range::size_type range::start() const { return _start; }
inline range::size_type range::size() const { return _size; }
inline range range::all() { return range(0, size_type (-1)); }
} // namespace rheolef
#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::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