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 
36 namespace 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 () throw();
56 
61  explicit inline lx_civector(int i) throw();
62 
64  explicit inline lx_civector(int i1, int i2)
65 #if(CXSC_INDEX_CHECK)
66  throw(ERROR_IVECTOR_WRONG_BOUNDARIES,ERROR_IVECTOR_NO_MORE_MEMORY);
67 #else
68  throw();
69 #endif
70 
72  explicit inline lx_civector(const lx_cinterval &) throw();
74  explicit inline lx_civector(const l_cinterval &) throw();
76  explicit inline lx_civector(const cinterval &) throw();
78  explicit inline lx_civector(const lx_complex &) throw();
80  explicit inline lx_civector(const l_complex &) throw();
82  explicit inline lx_civector(const complex &) throw();
83 
85  explicit inline lx_civector(const lx_interval &) throw();
87  explicit inline lx_civector(const l_interval &) throw();
89  explicit inline lx_civector(const interval &) throw();
91  explicit inline lx_civector(const lx_real &) throw();
93  explicit inline lx_civector(const l_real &) throw();
95  explicit inline lx_civector(const real &) throw();
96 
98  inline lx_civector(const lx_civector &) throw();
99 
100 
102  inline lx_civector & operator = (const lx_civector &) throw();
103 
105  inline lx_civector & operator =(const lx_cinterval &) throw();
107  inline lx_civector & operator =(const l_cinterval &) throw();
109  inline lx_civector & operator =(const cinterval &) throw();
111  inline lx_civector & operator =(const lx_complex &) throw();
113  inline lx_civector & operator =(const l_complex &) throw();
115  inline lx_civector & operator =(const complex &) throw();
116 
118  inline lx_civector & operator =(const lx_interval &) throw();
120  inline lx_civector & operator =(const l_interval &) throw();
122  inline lx_civector & operator =(const interval &) throw();
124  inline lx_civector & operator =(const lx_real &) throw();
126  inline lx_civector & operator =(const l_real &) throw();
128  inline lx_civector & operator =(const real &) throw();
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  throw(ERROR_IVECTOR_ELEMENT_NOT_IN_VEC);
138 #else
139  throw();
140 #endif
141  inline const lx_cinterval & operator [](const int &i) const
143 #if(CXSC_INDEX_CHECK)
144  throw(ERROR_IVECTOR_ELEMENT_NOT_IN_VEC);
145 #else
146  throw();
147 #endif
148 
149 //------ Standardfunktionen -----------------------------------------------
150 
152 friend inline int Lb(const lx_civector &a) throw() { return a.l; }
154 friend inline int Ub(const lx_civector &a) throw() { return a.u; }
156 friend inline int VecLen(const lx_civector &a) throw() { return a.size; }
158 friend inline lx_civector& SetLb(lx_civector &a, int l) throw()
159 { a.l=l; a.u=l+a.size-1; return a; }
161 friend inline lx_civector & SetUb(lx_civector &a, int u) throw()
162 { a.u=u; a.l=u-a.size+1; return a; }
163 
165 friend inline void Resize(lx_civector &rv, int lb, int ub)
166 #if(CXSC_INDEX_CHECK)
167  throw(ERROR__WRONG_BOUNDARIES<lx_civector>);
168 #else
169  throw();
170 #endif
171 
173 friend inline void Resize(lx_civector &rv, int len)
174 #if(CXSC_INDEX_CHECK)
175  throw(ERROR__WRONG_BOUNDARIES<lx_civector>);
176 #else
177  throw();
178 #endif
179 
180 }; // End of class lx_civector
181 
183 inline void DoubleSize(lx_civector&) throw();
184 
185 inline void Resize(lx_civector &rv, int lb, int ub)
186 #if(CXSC_INDEX_CHECK)
187  throw(ERROR__WRONG_BOUNDARIES<lx_civector>);
188 #else
189  throw();
190 #endif
191 
192  inline void Resize(lx_civector &rv, int len)
193 #if(CXSC_INDEX_CHECK)
194  throw(ERROR__WRONG_BOUNDARIES<lx_civector>);
195 #else
196  throw();
197 #endif
198 
199 } // End namespace cxsc
200 
201 
202 #include "lx_civector.inl"
203 
204 #endif
cxsc::lx_civector
The Multiple-Precision Data Type lx_civector.
Definition: lx_civector.hpp:45
cxsc::lx_civector::Resize
friend void Resize(lx_civector &rv, int lb, int ub)
Resizes the vector.
Definition: lx_civector.inl:329
cxsc::lx_civector::Ub
friend int Ub(const lx_civector &a)
Returns the upper bound of the vector.
Definition: lx_civector.hpp:154
cxsc::lx_civector::SetUb
friend lx_civector & SetUb(lx_civector &a, int u)
Sets the upper bound of the vector.
Definition: lx_civector.hpp:161
cxsc::interval
The Scalar Type interval.
Definition: interval.hpp:54
cxsc::lx_civector::operator=
lx_civector & operator=(const lx_civector &)
Implementation of standard assigning operator.
Definition: lx_civector.inl:143
cxsc::lx_civector::Lb
friend int Lb(const lx_civector &a)
Returns the lower bound of the vector.
Definition: lx_civector.hpp:152
cxsc::lx_civector::operator[]
lx_cinterval & operator[](const int &i)
Operator for accessing the single elements of the vector.
Definition: lx_civector.inl:272
cxsc::l_complex
The Multiple-Precision Data Type l_complex.
Definition: l_complex.hpp:45
cxsc::l_interval
The Multiple-Precision Data Type l_interval.
Definition: l_interval.hpp:71
cxsc
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
cxsc::l_real
The Multiple-Precision Data Type l_real.
Definition: l_real.hpp:77
cxsc::DoubleSize
void DoubleSize(cimatrix &A)
Doubles the size of the matrix.
Definition: cimatrix.cpp:83
cxsc::lx_civector::VecLen
friend int VecLen(const lx_civector &a)
Returns the dimension of the vector.
Definition: lx_civector.hpp:156
cxsc::l_cinterval
The Multiple-Precision Data Type l_cinterval.
Definition: l_cinterval.hpp:53
cxsc::cinterval
The Scalar Type cinterval.
Definition: cinterval.hpp:54
cxsc::lx_civector::SetLb
friend lx_civector & SetLb(lx_civector &a, int l)
Sets the lower bound of the vector.
Definition: lx_civector.hpp:158
cxsc::complex
The Scalar Type complex.
Definition: complex.hpp:49
cxsc::lx_civector::lx_civector
lx_civector()
Constructor of class lx_civector.
Definition: lx_civector.inl:29
cxsc::Resize
void Resize(cimatrix &A)
Resizes the matrix.
Definition: cimatrix.inl:1211
cxsc::real
The Scalar Type real.
Definition: real.hpp:113