C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
liveclrmat.inl
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: liveclrmat.inl,v 1.25 2014/01/30 17:23:47 cxsc Exp $ */
25 
26 // Here are definitions for l_ivector x l_rmatrix-Functions
27 #ifndef _CXSC_LIVECLRMAT_INL_INCLUDED
28 #define _CXSC_LIVECLRMAT_INL_INCLUDED
29 
30 namespace cxsc {
31 
32  INLINE l_ivector::l_ivector(const l_rmatrix &sl)
33 #if(CXSC_INDEX_CHECK)
34  throw(ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
35 #else
36  throw()
37 #endif
38  { _vmconstr<l_ivector,l_rmatrix,l_interval>(*this,sl); }
40 #if(CXSC_INDEX_CHECK)
41  throw(ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
42 #else
43  throw()
44 #endif
45  { _vmsconstr<l_ivector,l_rmatrix_slice,l_interval>(*this,sl); }
46  INLINE l_ivector::l_ivector(const l_rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
47  {
48  dat=new l_interval[size];
49  for (int i=0, j=v.start;i<v.size;i++,j+=v.offset)
50  dat[i]=v.dat[j];
51  }
57  INLINE l_ivector _l_ivector(const l_rmatrix &sl)
58 #if(CXSC_INDEX_CHECK)
59  throw(ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
60 #else
61  throw()
62 #endif
63  { return l_ivector(sl); }
70 #if(CXSC_INDEX_CHECK)
71  throw(ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
72 #else
73  throw()
74 #endif
75  { return l_ivector(sl); }
76 
77  INLINE void accumulate(idotprecision &dp, const l_rmatrix_subv & rv1, const l_ivector &rv2)
78 #if(CXSC_INDEX_CHECK)
79  throw(OP_WITH_WRONG_DIM)
80 #else
81  throw()
82 #endif
83  { _vmvaccu<idotprecision,l_ivector,l_rmatrix_subv>(dp,rv2,rv1); }
84  INLINE void accumulate(idotprecision &dp, const l_ivector & rv1, const l_rmatrix_subv &rv2)
85 #if(CXSC_INDEX_CHECK)
86  throw(OP_WITH_WRONG_DIM)
87 #else
88  throw()
89 #endif
90  { _vmvaccu<idotprecision,l_ivector,l_rmatrix_subv>(dp,rv1,rv2); }
91 
92  INLINE void accumulate(idotprecision &dp, const l_rmatrix_subv & rv1, const l_ivector_slice &rv2)
93 #if(CXSC_INDEX_CHECK)
94  throw(OP_WITH_WRONG_DIM)
95 #else
96  throw()
97 #endif
98  { _vmvaccu<idotprecision,l_ivector,l_rmatrix_subv>(dp,l_ivector(rv2),rv1); }
99  INLINE void accumulate(idotprecision &dp, const l_ivector_slice & rv1, const l_rmatrix_subv &rv2)
100 #if(CXSC_INDEX_CHECK)
101  throw(OP_WITH_WRONG_DIM)
102 #else
103  throw()
104 #endif
105  { _vmvaccu<idotprecision,l_ivector,l_rmatrix_subv>(dp,l_ivector(rv1),rv2); }
106 
107  INLINE void SetInf(l_ivector &iv,const l_rmatrix_subv &rv)
108 #if(CXSC_INDEX_CHECK)
109  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
110 #else
111  throw()
112 #endif
113  { _vmvsetinf(iv,rv); }
114  INLINE void SetSup(l_ivector &iv,const l_rmatrix_subv &rv)
115 #if(CXSC_INDEX_CHECK)
116  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
117 #else
118  throw()
119 #endif
120  { _vmvsetsup(iv,rv); }
121  INLINE void SetInf(l_ivector_slice &iv,const l_rmatrix_subv &rv)
122 #if(CXSC_INDEX_CHECK)
123  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
124 #else
125  throw()
126 #endif
127  { _vsvsetinf(iv,l_rvector(rv)); }
128  INLINE void SetSup(l_ivector_slice &iv,const l_rmatrix_subv &rv)
129 #if(CXSC_INDEX_CHECK)
130  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
131 #else
132  throw()
133 #endif
134  { _vsvsetsup(iv,l_rvector(rv)); }
135 
136  INLINE void UncheckedSetInf(l_ivector &iv,const l_rmatrix_subv &rv)
137 #if(CXSC_INDEX_CHECK)
138  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
139 #else
140  throw()
141 #endif
142  { _vmvusetinf(iv,rv); }
143  INLINE void UncheckedSetSup(l_ivector &iv,const l_rmatrix_subv &rv)
144 #if(CXSC_INDEX_CHECK)
145  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
146 #else
147  throw()
148 #endif
149  { _vmvusetsup(iv,rv); }
150  INLINE void UncheckedSetInf(l_ivector_slice &iv,const l_rmatrix_subv &rv)
151 #if(CXSC_INDEX_CHECK)
152  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
153 #else
154  throw()
155 #endif
156  { _vsvusetinf(iv,l_rvector(rv)); }
157  INLINE void UncheckedSetSup(l_ivector_slice &iv,const l_rmatrix_subv &rv)
158 #if(CXSC_INDEX_CHECK)
159  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
160 #else
161  throw()
162 #endif
163  { _vsvusetsup(iv,l_rvector(rv)); }
164 
165  INLINE l_ivector &l_ivector::operator =(const l_rmatrix_subv &mv) throw() { return _vmvassign<l_ivector,l_rmatrix_subv,l_interval>(*this,mv); }
166  INLINE l_ivector_slice &l_ivector_slice::operator =(const l_rmatrix_subv &mv) throw() { return _vsvassign(*this,l_rvector(mv)); }
168 #if(CXSC_INDEX_CHECK)
169  throw(ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
170 #else
171  throw()
172 #endif
173  { return _vmassign<l_ivector,l_rmatrix,l_interval>(*this,m); }
175 #if(CXSC_INDEX_CHECK)
176  throw(ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
177 #else
178  throw()
179 #endif
180  { return _vmassign<l_ivector,l_rmatrix,l_interval>(*this,l_rmatrix(m)); }
182 #if(CXSC_INDEX_CHECK)
183  throw(ERROR__OP_WITH_WRONG_DIM<l_rvector>,ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
184 #else
185  throw()
186 #endif
187  { return _vsvassign(*this,l_rvector(m)); }
189 #if(CXSC_INDEX_CHECK)
190  throw(ERROR__OP_WITH_WRONG_DIM<l_rvector>,ERROR_LRMATRIX_TYPE_CAST_OF_THICK_OBJ)
191 #else
192  throw()
193 #endif
194  { return _vsvassign(*this,l_ivector(l_rmatrix(m))); }
195 
196  INLINE l_ivector operator *(const l_rmatrix &m,const l_ivector &v)
197 #if(CXSC_INDEX_CHECK)
198  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
199 #else
200  throw()
201 #endif
202  { return _mvlimult<l_rmatrix,l_ivector,l_ivector>(m,v); }
203  INLINE l_ivector operator *(const l_rmatrix_slice &ms,const l_ivector &v)
204 #if(CXSC_INDEX_CHECK)
205  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
206 #else
207  throw()
208 #endif
209  { return _msvlimult<l_rmatrix_slice,l_ivector,l_ivector>(ms,v); }
210  INLINE l_ivector operator *(const l_ivector &v,const l_rmatrix &m)
211 #if(CXSC_INDEX_CHECK)
212  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
213 #else
214  throw()
215 #endif
216  { return _vmlimult<l_ivector,l_rmatrix,l_ivector>(v,m); }
217  INLINE l_ivector operator *(const l_ivector &v,const l_rmatrix_slice &ms)
218 #if(CXSC_INDEX_CHECK)
219  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
220 #else
221  throw()
222 #endif
223  { return _vmslimult<l_ivector,l_rmatrix_slice,l_ivector>(v,ms); }
225 #if(CXSC_INDEX_CHECK)
226  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
227 #else
228  throw()
229 #endif
230  { return _vmlimultassign<l_ivector,l_rmatrix,l_interval>(v,m); }
232 #if(CXSC_INDEX_CHECK)
233  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
234 #else
235  throw()
236 #endif
237  { return _vmslimultassign<l_ivector,l_rmatrix_slice,l_interval>(v,ms); }
238 
239  INLINE l_ivector operator *(const l_ivector_slice &v,const l_rmatrix &m)
240 #if(CXSC_INDEX_CHECK)
241  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
242 #else
243  throw()
244 #endif
245  { return _vmlimult<l_ivector,l_rmatrix,l_ivector>(l_ivector(v),m); }
247 #if(CXSC_INDEX_CHECK)
248  throw(ERROR_LRMATRIX_OP_WITH_WRONG_DIM)
249 #else
250  throw()
251 #endif
252  { return _vsmlimultassign<l_ivector_slice,l_rmatrix,l_interval>(*this,m); }
253 
254  INLINE l_ivector operator *(const ivector &v,const l_rmatrix &m)
255 #if(CXSC_INDEX_CHECK)
256  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
257 #else
258  throw()
259 #endif
260  { return _vmlimult<ivector,l_rmatrix,l_ivector>(v,m); }
261  INLINE l_ivector operator *(const ivector &v,const l_rmatrix_slice &ms)
262 #if(CXSC_INDEX_CHECK)
263  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
264 #else
265  throw()
266 #endif
267  { return _vmslimult<ivector,l_rmatrix_slice,l_ivector>(v,ms); }
268  INLINE l_ivector operator *(const ivector_slice &v,const l_rmatrix &m)
269 #if(CXSC_INDEX_CHECK)
270  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
271 #else
272  throw()
273 #endif
274  { return _vmlimult<l_ivector,l_rmatrix,l_ivector>(l_ivector(v),m); }
275  INLINE l_ivector operator *(const l_rmatrix &m,const ivector &v)
276 #if(CXSC_INDEX_CHECK)
277  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
278 #else
279  throw()
280 #endif
281  { return _mvlimult<l_rmatrix,ivector,l_ivector>(m,v); }
282  INLINE l_ivector operator *(const l_rmatrix_slice &ms,const ivector &v)
283 #if(CXSC_INDEX_CHECK)
284  throw(ERROR_LIMATRIX_OP_WITH_WRONG_DIM)
285 #else
286  throw()
287 #endif
288  { return _msvlimult<l_rmatrix_slice,ivector,l_ivector>(ms,v); }
289 
290 } // namespace cxsc
291 
292 #endif
293 
cxsc::l_rmatrix_slice
The Multiple-Precision Data Type l_rmatrix_slice.
Definition: l_rmatrix.hpp:1000
cxsc::operator*=
cimatrix & operator*=(cimatrix &m, const cinterval &c)
Implementation of multiplication and allocation operation.
Definition: cimatrix.inl:1605
cxsc::l_rmatrix_subv
The Multiple-Precision Data Type l_rmatrix_subv.
Definition: l_rmatrix.hpp:47
cxsc::l_rmatrix
The Multiple-Precision Data Type l_rmatrix.
Definition: l_rmatrix.hpp:416
cxsc::idotprecision
The Data Type idotprecision.
Definition: idot.hpp:48
cxsc::l_ivector_slice::operator=
l_ivector_slice & operator=(const l_ivector_slice &sl)
Implementation of standard assigning operator.
Definition: l_ivector.inl:314
cxsc::ivector_slice
The Data Type ivector_slice.
Definition: ivector.hpp:963
cxsc::operator*
civector operator*(const cimatrix_subv &rv, const cinterval &s)
Implementation of multiplication operation.
Definition: cimatrix.inl:731
cxsc::l_interval
The Multiple-Precision Data Type l_interval.
Definition: l_interval.hpp:72
cxsc::ivector
The Data Type ivector.
Definition: ivector.hpp:55
cxsc::l_ivector::l_ivector
l_ivector()
Constructor of class l_ivector.
Definition: l_ivector.inl:31
cxsc
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
cxsc::l_rvector
The Multiple-Precision Data Type l_rvector.
Definition: l_rvector.hpp:54
cxsc::l_ivector_slice
The Multiple-Precision Data Type l_ivector_slice.
Definition: l_ivector.hpp:871
cxsc::_l_ivector
l_ivector _l_ivector(const l_interval &r)
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
Definition: l_ivector.inl:252
cxsc::l_ivector
The Multiple-Precision Data Type l_ivector.
Definition: l_ivector.hpp:55
cxsc::l_ivector::operator=
l_ivector & operator=(const l_ivector &rv)
Implementation of standard assigning operator.
Definition: l_ivector.inl:311
cxsc::l_ivector_slice::operator*=
l_ivector_slice & operator*=(const l_interval &r)
Implementation of multiplication and allocation operation.
Definition: l_ivector.inl:497