C-XSC - A C++ Class Library for Extended Scientific Computing 2.5.4
lx_civector.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_civector.hpp,v 1.9 2014/01/30 17:23:47 cxsc Exp $ */
25
26#ifndef _CXSC_LX_CIVECTOR_HPP_INCLUDED
27#define _CXSC_LX_CIVECTOR_HPP_INCLUDED
28
29#include <xscclass.hpp>
30#include <real.hpp>
31#include <except.hpp>
32#include "lx_cinterval.hpp"
33
34#include <iostream>
35
36namespace cxsc {
37
39
46{
47 private:
48 lx_cinterval *dat;
49 int l,u,size;
50
51 public:
52 //------ Konstruktoren ----------------------------------------------------
53
55 inline lx_civector () noexcept;
56
61 explicit inline lx_civector(int i) noexcept;
62
64 explicit inline lx_civector(int i1, int i2)
65#if(CXSC_INDEX_CHECK)
66 ;
67#else
68 noexcept;
69#endif
70
72 explicit inline lx_civector(const lx_cinterval &) noexcept;
74 explicit inline lx_civector(const l_cinterval &) noexcept;
76 explicit inline lx_civector(const cinterval &) noexcept;
78 explicit inline lx_civector(const lx_complex &) noexcept;
80 explicit inline lx_civector(const l_complex &) noexcept;
82 explicit inline lx_civector(const complex &) noexcept;
83
85 explicit inline lx_civector(const lx_interval &) noexcept;
87 explicit inline lx_civector(const l_interval &) noexcept;
89 explicit inline lx_civector(const interval &) noexcept;
91 explicit inline lx_civector(const lx_real &) noexcept;
93 explicit inline lx_civector(const l_real &) noexcept;
95 explicit inline lx_civector(const real &) noexcept;
96
98 inline lx_civector(const lx_civector &) noexcept;
99
100
102 inline lx_civector & operator = (const lx_civector &) noexcept;
103
105 inline lx_civector & operator =(const lx_cinterval &) noexcept;
107 inline lx_civector & operator =(const l_cinterval &) noexcept;
109 inline lx_civector & operator =(const cinterval &) noexcept;
111 inline lx_civector & operator =(const lx_complex &) noexcept;
113 inline lx_civector & operator =(const l_complex &) noexcept;
115 inline lx_civector & operator =(const complex &) noexcept;
116
118 inline lx_civector & operator =(const lx_interval &) noexcept;
120 inline lx_civector & operator =(const l_interval &) noexcept;
122 inline lx_civector & operator =(const interval &) noexcept;
124 inline lx_civector & operator =(const lx_real &) noexcept;
126 inline lx_civector & operator =(const l_real &) noexcept;
128 inline lx_civector & operator =(const real &) noexcept;
129
130 //--------- Destruktor ----------------------------------------------------
131 inline ~lx_civector() { delete [] dat; }
132
133
135 inline lx_cinterval & operator [](const int &i)
136#if(CXSC_INDEX_CHECK)
137 ;
138#else
139 noexcept;
140#endif
142 inline const lx_cinterval & operator [](const int &i) const
143#if(CXSC_INDEX_CHECK)
144;
145#else
146 noexcept;
147#endif
148
149//------ Standardfunktionen -----------------------------------------------
150
152friend inline int Lb(const lx_civector &a) noexcept { return a.l; }
154friend inline int Ub(const lx_civector &a) noexcept { return a.u; }
156friend inline int VecLen(const lx_civector &a) noexcept { return a.size; }
158friend inline lx_civector& SetLb(lx_civector &a, int l) noexcept
159{ a.l=l; a.u=l+a.size-1; return a; }
161friend inline lx_civector & SetUb(lx_civector &a, int u) noexcept
162{ a.u=u; a.l=u-a.size+1; return a; }
163
165friend inline void Resize(lx_civector &rv, int lb, int ub)
166#if(CXSC_INDEX_CHECK)
167 ;
168#else
169 noexcept;
170#endif
171
173friend inline void Resize(lx_civector &rv, int len)
174#if(CXSC_INDEX_CHECK)
175 ;
176#else
177 noexcept;
178#endif
179
180}; // End of class lx_civector
181
183inline void DoubleSize(lx_civector&) noexcept;
184
185inline void Resize(lx_civector &rv, int lb, int ub)
186#if(CXSC_INDEX_CHECK)
187 ;
188#else
189 noexcept;
190#endif
191
192 inline void Resize(lx_civector &rv, int len)
193#if(CXSC_INDEX_CHECK)
194 ;
195#else
196 noexcept;
197#endif
198
199} // End namespace cxsc
200
201
202#include "lx_civector.inl"
203
204#endif
The Scalar Type cinterval.
Definition cinterval.hpp:55
The Scalar Type complex.
Definition complex.hpp:50
The Scalar Type interval.
Definition interval.hpp:55
The Multiple-Precision Data Type l_cinterval.
The Multiple-Precision Data Type l_complex.
Definition l_complex.hpp:46
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_civector.
lx_civector & operator=(const lx_civector &) noexcept
Implementation of standard assigning operator.
lx_cinterval & operator[](const int &i) noexcept
Operator for accessing the single elements of the vector.
friend void Resize(lx_civector &rv, int lb, int ub) noexcept
Resizes the vector.
friend lx_civector & SetUb(lx_civector &a, int u) noexcept
Sets the upper bound of the vector.
friend int Ub(const lx_civector &a) noexcept
Returns the upper bound of the vector.
friend lx_civector & SetLb(lx_civector &a, int l) noexcept
Sets the lower bound of the vector.
friend int Lb(const lx_civector &a) noexcept
Returns the lower bound of the vector.
friend int VecLen(const lx_civector &a) noexcept
Returns the dimension of the vector.
lx_civector() noexcept
Constructor of class lx_civector.
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.