C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
civeccmat.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: civeccmat.inl,v 1.24 2014/01/30 17:23:44 cxsc Exp $ */
25 
26 // Here are definitions for civector x cmatrix-Functions
27 #ifndef _CXSC_CIVECCMAT_INL_INCLUDED
28 #define _CXSC_CIVECCMAT_INL_INCLUDED
29 
30 namespace cxsc {
31 
32  INLINE civector::civector(const cmatrix &sl)
33 #if(CXSC_INDEX_CHECK)
34  throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
35 #else
36  throw()
37 #endif
38  { _vmconstr<civector,cmatrix,cinterval>(*this,sl); }
40 #if(CXSC_INDEX_CHECK)
41  throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
42 #else
43  throw()
44 #endif
45  { _vmsconstr<civector,cmatrix_slice,cinterval>(*this,sl); }
46  INLINE civector::civector(const cmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
47  {
48  dat=new cinterval[size];
49  for (int i=0, j=v.start;i<v.size;i++,j+=v.offset)
50  dat[i]=v.dat[j];
51  }
52  INLINE civector _civector(const cmatrix &sl)
53 #if(CXSC_INDEX_CHECK)
54  throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
55 #else
56  throw()
57 #endif
58  { return civector(sl); }
59  INLINE civector _civector(const cmatrix_slice &sl)
60 #if(CXSC_INDEX_CHECK)
61  throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
62 #else
63  throw()
64 #endif
65  { return civector(sl); }
66 
67  INLINE void SetInf(civector &iv,const cmatrix_subv &rv)
68 #if(CXSC_INDEX_CHECK)
69  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
70 #else
71  throw()
72 #endif
73  { _vmvsetinf(iv,rv); }
74  INLINE void SetSup(civector &iv,const cmatrix_subv &rv)
75 #if(CXSC_INDEX_CHECK)
76  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
77 #else
78  throw()
79 #endif
80  { _vmvsetsup(iv,rv); }
81  INLINE void SetInf(civector_slice &iv,const cmatrix_subv &rv)
82 #if(CXSC_INDEX_CHECK)
83  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
84 #else
85  throw()
86 #endif
87  { _vsvsetinf(iv,cvector(rv)); }
88  INLINE void SetSup(civector_slice &iv,const cmatrix_subv &rv)
89 #if(CXSC_INDEX_CHECK)
90  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
91 #else
92  throw()
93 #endif
94  { _vsvsetsup(iv,cvector(rv)); }
95 
96  INLINE void UncheckedSetInf(civector &iv,const cmatrix_subv &rv)
97 #if(CXSC_INDEX_CHECK)
98  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
99 #else
100  throw()
101 #endif
102  { _vmvusetinf(iv,rv); }
103  INLINE void UncheckedSetSup(civector &iv,const cmatrix_subv &rv)
104 #if(CXSC_INDEX_CHECK)
105  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
106 #else
107  throw()
108 #endif
109  { _vmvusetsup(iv,rv); }
110  INLINE void UncheckedSetInf(civector_slice &iv,const cmatrix_subv &rv)
111 #if(CXSC_INDEX_CHECK)
112  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
113 #else
114  throw()
115 #endif
116  { _vsvusetinf(iv,cvector(rv)); }
117  INLINE void UncheckedSetSup(civector_slice &iv,const cmatrix_subv &rv)
118 #if(CXSC_INDEX_CHECK)
119  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
120 #else
121  throw()
122 #endif
123  { _vsvusetsup(iv,cvector(rv)); }
124 
125  INLINE civector &civector::operator =(const cmatrix_subv &mv) throw() { return _vmvassign<civector,cmatrix_subv,cinterval>(*this,mv); }
126  INLINE civector_slice &civector_slice::operator =(const cmatrix_subv &mv) throw() { return _vsvassign(*this,cvector(mv)); }
128 #if(CXSC_INDEX_CHECK)
129  throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
130 #else
131  throw()
132 #endif
133  { return _vmassign<civector,cmatrix,cinterval>(*this,m); }
135 #if(CXSC_INDEX_CHECK)
136  throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
137 #else
138  throw()
139 #endif
140  { return _vmassign<civector,cmatrix,cinterval>(*this,cmatrix(m)); }
142 #if(CXSC_INDEX_CHECK)
143  throw(ERROR__OP_WITH_WRONG_DIM<cvector>,ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
144 #else
145  throw()
146 #endif
147  { return _vsvassign(*this,cvector(m)); }
149 #if(CXSC_INDEX_CHECK)
150  throw(ERROR__OP_WITH_WRONG_DIM<cvector>,ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ)
151 #else
152  throw()
153 #endif
154  { return _vsvassign(*this,civector(cmatrix(m))); }
155 
156  INLINE civector operator *(const cmatrix &m,const civector &v)
157 #if(CXSC_INDEX_CHECK)
158  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
159 #else
160  throw()
161 #endif
162  { return _mvcimult<cmatrix,civector,civector>(m,v); }
163  INLINE civector operator *(const cmatrix_slice &ms,const civector &v)
164 #if(CXSC_INDEX_CHECK)
165  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
166 #else
167  throw()
168 #endif
169  { return _msvcimult<cmatrix_slice,civector,civector>(ms,v); }
170  INLINE civector operator *(const civector &v,const cmatrix &m)
171 #if(CXSC_INDEX_CHECK)
172  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
173 #else
174  throw()
175 #endif
176  { return _vmcimult<civector,cmatrix,civector>(v,m); }
177  INLINE civector operator *(const civector &v,const cmatrix_slice &ms)
178 #if(CXSC_INDEX_CHECK)
179  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
180 #else
181  throw()
182 #endif
183  { return _vmscimult<civector,cmatrix_slice,civector>(v,ms); }
184  INLINE civector &operator *=(civector &v,const cmatrix &m)
185 #if(CXSC_INDEX_CHECK)
186  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
187 #else
188  throw()
189 #endif
190  { return _vmcimultassign<civector,cmatrix,cinterval>(v,m); }
191  INLINE civector &operator *=(civector &v,const cmatrix_slice &ms)
192 #if(CXSC_INDEX_CHECK)
193  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
194 #else
195  throw()
196 #endif
197  { return _vmscimultassign<civector,cmatrix_slice,cinterval>(v,ms); }
198 
199  INLINE civector operator *(const civector_slice &v,const cmatrix &m)
200 #if(CXSC_INDEX_CHECK)
201  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
202 #else
203  throw()
204 #endif
205  { return _vmcimult<civector,cmatrix,civector>(civector(v),m); }
207 #if(CXSC_INDEX_CHECK)
208  throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM)
209 #else
210  throw()
211 #endif
212  { return _vsmcimultassign<civector_slice,cmatrix,cinterval>(*this,m); }
213 
214  INLINE civector operator *(const ivector &v,const cmatrix &m)
215 #if(CXSC_INDEX_CHECK)
216  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
217 #else
218  throw()
219 #endif
220  { return _vmcimult<ivector,cmatrix,civector>(v,m); }
221  INLINE civector operator *(const ivector &v,const cmatrix_slice &ms)
222 #if(CXSC_INDEX_CHECK)
223  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
224 #else
225  throw()
226 #endif
227  { return _vmscimult<ivector,cmatrix_slice,civector>(v,ms); }
228  INLINE civector operator *(const ivector_slice &v,const cmatrix &m)
229 #if(CXSC_INDEX_CHECK)
230  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
231 #else
232  throw()
233 #endif
234  { return _vmcimult<civector,cmatrix,civector>(civector(v),m); }
235  INLINE civector operator *(const cmatrix &m,const ivector &v)
236 #if(CXSC_INDEX_CHECK)
237  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
238 #else
239  throw()
240 #endif
241  { return _mvcimult<cmatrix,ivector,civector>(m,v); }
242  INLINE civector operator *(const cmatrix_slice &ms,const ivector &v)
243 #if(CXSC_INDEX_CHECK)
244  throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM)
245 #else
246  throw()
247 #endif
248  { return _msvcimult<cmatrix_slice,ivector,civector>(ms,v); }
249 
250 } // namespace cxsc
251 
252 #endif
253 
cxsc::civector_slice
The Data Type civector_slice.
Definition: civector.hpp:1015
cxsc::civector::operator=
civector & operator=(const civector &rv)
Implementation of standard assigning operator.
Definition: civector.inl:339
cxsc::cmatrix
The Data Type cmatrix.
Definition: cmatrix.hpp:514
cxsc::operator*=
cimatrix & operator*=(cimatrix &m, const cinterval &c)
Implementation of multiplication and allocation operation.
Definition: cimatrix.inl:1605
cxsc::cvector
The Data Type cvector.
Definition: cvector.hpp:58
cxsc::cmatrix_slice
The Data Type cmatrix_slice.
Definition: cmatrix.hpp:1203
cxsc::civector_slice::operator=
civector_slice & operator=(const scivector_slice &sl)
Implementation of standard assigning operator.
Definition: scivector.hpp:4688
cxsc::operator*
civector operator*(const cimatrix_subv &rv, const cinterval &s)
Implementation of multiplication operation.
Definition: cimatrix.inl:731
cxsc::ivector
The Data Type ivector.
Definition: ivector.hpp:55
cxsc
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
cxsc::civector::civector
civector()
Constructor of class civector.
Definition: civector.inl:31
cxsc::cmatrix_subv
The Data Type cmatrix_subv.
Definition: cmatrix.hpp:54
cxsc::cinterval
The Scalar Type cinterval.
Definition: cinterval.hpp:55
cxsc::civector
The Data Type civector.
Definition: civector.hpp:57
cxsc::civector_slice::operator*=
civector_slice & operator*=(const cinterval &r)
Implementation of multiplication and allocation operation.
Definition: civector.inl:720