C-XSC - A C++ Class Library for Extended Scientific Computing 2.5.4
lx_ivector.hpp
1/*
2** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
3**
4** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
5** Universitaet Karlsruhe, Germany
6** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
7** Universitaet Wuppertal, Germany
8**
9** This library is free software; you can redistribute it and/or
10** modify it under the terms of the GNU Library General Public
11** License as published by the Free Software Foundation; either
12** version 2 of the License, or (at your option) any later version.
13**
14** This library is distributed in the hope that it will be useful,
15** but WITHOUT ANY WARRANTY; without even the implied warranty of
16** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17** Library General Public License for more details.
18**
19** You should have received a copy of the GNU Library General Public
20** License along with this library; if not, write to the Free
21** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*/
23
24/* CVS $Id: lx_ivector.hpp,v 1.9 2014/01/30 17:23:47 cxsc Exp $ */
25
26#ifndef _CXSC_LX_IVECTOR_HPP_INCLUDED
27#define _CXSC_LX_IVECTOR_HPP_INCLUDED
28
29#include <except.hpp>
30#include "lx_interval.hpp"
31#include <iostream>
32
33namespace cxsc {
34
36
43{
44 private:
45 lx_interval *dat;
46 int l,u,size;
47
48 public:
49 //------ Konstruktoren ----------------------------------------------------
50
52 inline lx_ivector () noexcept;
53
58 explicit inline lx_ivector(int i) noexcept;
59
61 explicit inline lx_ivector(int i1, int i2)
62#if(CXSC_INDEX_CHECK)
63 ;
64#else
65 noexcept;
66#endif
67
69 explicit inline lx_ivector(const lx_interval &) noexcept;
71 explicit inline lx_ivector(const l_interval &) noexcept;
73 explicit inline lx_ivector(const interval &) noexcept;
75 explicit inline lx_ivector(const lx_real &) noexcept;
77 explicit inline lx_ivector(const l_real &) noexcept;
79 explicit inline lx_ivector(const real &) noexcept;
80
82 inline lx_ivector(const lx_ivector &) noexcept;
83
84
86 inline lx_ivector & operator = (const lx_ivector &) noexcept;
88 inline lx_ivector & operator =(const lx_interval &) noexcept;
90 inline lx_ivector & operator =(const l_interval &) noexcept;
92 inline lx_ivector & operator =(const interval &) noexcept;
94 inline lx_ivector & operator =(const lx_real &) noexcept;
96 inline lx_ivector & operator =(const l_real &) noexcept;
98 inline lx_ivector & operator =(const real &) noexcept;
99
100 //--------- Destruktor ----------------------------------------------------
101 inline ~lx_ivector() { delete [] dat; }
102
103
105 inline lx_interval & operator [](const int &i)
106#if(CXSC_INDEX_CHECK)
107 ;
108#else
109 noexcept;
110#endif
112 inline const lx_interval & operator [](const int &i) const
113#if(CXSC_INDEX_CHECK)
114;
115#else
116 noexcept;
117#endif
118
119//------ Standardfunktionen -----------------------------------------------
120
122friend inline int Lb(const lx_ivector &a) noexcept { return a.l; }
124friend inline int Ub(const lx_ivector &a) noexcept { return a.u; }
126friend inline int VecLen(const lx_ivector &a) noexcept { return a.size; }
128friend inline lx_ivector& SetLb(lx_ivector &a, int l) noexcept
129{ a.l=l; a.u=l+a.size-1; return a; }
131friend inline lx_ivector & SetUb(lx_ivector &a, int u) noexcept
132{ a.u=u; a.l=u-a.size+1; return a; }
133
135friend inline void Resize(lx_ivector &rv, int lb, int ub)
136#if(CXSC_INDEX_CHECK)
137 ;
138#else
139 noexcept;
140#endif
141
143friend inline void Resize(lx_ivector &rv, int len)
144#if(CXSC_INDEX_CHECK)
145 ;
146#else
147 noexcept;
148#endif
149
150}; // End of class lx_ivector
151
153inline void DoubleSize(lx_ivector&) noexcept;
154
155inline void Resize(lx_ivector &rv, int lb, int ub)
156#if(CXSC_INDEX_CHECK)
157 ;
158#else
159 noexcept;
160#endif
161
162 inline void Resize(lx_ivector &rv, int len)
163#if(CXSC_INDEX_CHECK)
164 ;
165#else
166 noexcept;
167#endif
168
169} // End namespace cxsc
170
171
172#include "lx_ivector.inl"
173
174#endif
The Scalar Type interval.
Definition interval.hpp:55
The Multiple-Precision Data Type l_interval.
The Multiple-Precision Data Type l_real.
Definition l_real.hpp:78
The Multiple-Precision Data Type lx_ivector.
lx_ivector & operator=(const lx_ivector &) noexcept
Implementation of standard assigning operator.
friend int Lb(const lx_ivector &a) noexcept
Returns the lower bound of the vector.
friend int VecLen(const lx_ivector &a) noexcept
Returns the dimension of the vector.
friend int Ub(const lx_ivector &a) noexcept
Returns the upper bound of the vector.
lx_interval & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
friend lx_ivector & SetLb(lx_ivector &a, int l) noexcept
Sets the lower bound of the vector.
lx_ivector() noexcept
Constructor of class lx_ivector.
friend void Resize(lx_ivector &rv, int lb, int ub) noexcept
Resizes the vector.
friend lx_ivector & SetUb(lx_ivector &a, int u) noexcept
Sets the upper bound of the vector.
The Scalar Type real.
Definition real.hpp:114
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition cdot.cpp:29
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
Definition cimatrix.cpp:83
void Resize(cimatrix &A) noexcept
Resizes the matrix.