C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
cvecrmat.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: cvecrmat.inl,v 1.24 2014/01/30 17:23:44 cxsc Exp $ */
25 
26 // Here are definitions for cvector x rmatrix-Functions
27 #ifndef _CXSC_CVECRMAT_INL_INCLUDED
28 #define _CXSC_CVECRMAT_INL_INCLUDED
29 
30 namespace cxsc {
31 
32  INLINE cvector::cvector(const rmatrix &sl)
33 #if(CXSC_INDEX_CHECK)
34  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
35 #else
36  throw()
37 #endif
38  { _vmconstr<cvector,rmatrix,complex>(*this,sl); }
39  INLINE cvector::cvector(const rmatrix_slice &sl)
40 #if(CXSC_INDEX_CHECK)
41  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
42 #else
43  throw()
44 #endif
45  { _vmsconstr<cvector,rmatrix_slice,complex>(*this,sl); }
46  INLINE cvector::cvector(const rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
47  {
48  dat=new complex[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 cvector _cvector(const rmatrix &sl)
53 #if(CXSC_INDEX_CHECK)
54  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
55 #else
56  throw()
57 #endif
58  { return cvector(sl); }
59  INLINE cvector _cvector(const rmatrix_slice &sl)
60 #if(CXSC_INDEX_CHECK)
61  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
62 #else
63  throw()
64 #endif
65  { return cvector(sl); }
66 
67 // INLINE void accumulate(cdotprecision &dp, const rmatrix_subv & rv1, const cvector &rv2)
68 // #if(CXSC_INDEX_CHECK)
69 // throw(OP_WITH_WRONG_DIM)
70 // #else
71 // throw()
72 // #endif
73 // { _vmvaccu<cdotprecision,cvector,rmatrix_subv>(dp,rv2,rv1); }
74 // INLINE void accumulate(cdotprecision &dp, const cvector & rv1, const rmatrix_subv &rv2)
75 // #if(CXSC_INDEX_CHECK)
76 // throw(OP_WITH_WRONG_DIM)
77 // #else
78 // throw()
79 // #endif
80 // { _vmvaccu<cdotprecision,cvector,rmatrix_subv>(dp,rv1,rv2); }
81 // INLINE void accumulate(cidotprecision &dp, const rmatrix_subv & rv1, const cvector &rv2)
82 // #if(CXSC_INDEX_CHECK)
83 // throw(OP_WITH_WRONG_DIM)
84 // #else
85 // throw()
86 // #endif
87 // { _vmvaccu<cidotprecision,cvector,rmatrix_subv>(dp,rv2,rv1); }
88 // INLINE void accumulate(cidotprecision &dp, const cvector & rv1, const rmatrix_subv &rv2)
89 // #if(CXSC_INDEX_CHECK)
90 // throw(OP_WITH_WRONG_DIM)
91 // #else
92 // throw()
93 // #endif
94 // { _vmvaccu<cidotprecision,cvector,rmatrix_subv>(dp,rv1,rv2); }
95 //
96 // INLINE void accumulate(cdotprecision &dp, const rmatrix_subv & rv1, const cvector_slice &rv2)
97 // #if(CXSC_INDEX_CHECK)
98 // throw(OP_WITH_WRONG_DIM)
99 // #else
100 // throw()
101 // #endif
102 // { _vmvaccu<cdotprecision,cvector,rmatrix_subv>(dp,cvector(rv2),rv1); }
103 // INLINE void accumulate(cdotprecision &dp, const cvector_slice & rv1, const rmatrix_subv &rv2)
104 // #if(CXSC_INDEX_CHECK)
105 // throw(OP_WITH_WRONG_DIM)
106 // #else
107 // throw()
108 // #endif
109 // { _vmvaccu<cdotprecision,cvector,rmatrix_subv>(dp,cvector(rv1),rv2); }
110 // INLINE void accumulate(cidotprecision &dp, const rmatrix_subv & rv1, const cvector_slice &rv2)
111 // #if(CXSC_INDEX_CHECK)
112 // throw(OP_WITH_WRONG_DIM)
113 // #else
114 // throw()
115 // #endif
116 // { _vmvaccu<cidotprecision,cvector,rmatrix_subv>(dp,cvector(rv2),rv1); }
117 // INLINE void accumulate(cidotprecision &dp, const cvector_slice & rv1, const rmatrix_subv &rv2)
118 // #if(CXSC_INDEX_CHECK)
119 // throw(OP_WITH_WRONG_DIM)
120 // #else
121 // throw()
122 // #endif
123 // { _vmvaccu<cidotprecision,cvector,rmatrix_subv>(dp,cvector(rv1),rv2); }
124 
125  INLINE cvector &cvector::operator =(const rmatrix_subv &mv) throw() { return _vmvassign<cvector,rmatrix_subv,complex>(*this,mv); }
126  INLINE cvector_slice &cvector_slice::operator =(const rmatrix_subv &mv) throw() { return _vsvassign(*this,rvector(mv)); }
128 #if(CXSC_INDEX_CHECK)
129  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
130 #else
131  throw()
132 #endif
133  { return _vmassign<cvector,rmatrix,complex>(*this,m); }
135 #if(CXSC_INDEX_CHECK)
136  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
137 #else
138  throw()
139 #endif
140  { return _vmassign<cvector,rmatrix,complex>(*this,rmatrix(m)); }
142 #if(CXSC_INDEX_CHECK)
143  throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
144 #else
145  throw()
146 #endif
147  { return _vsvassign(*this,rvector(m)); }
149 #if(CXSC_INDEX_CHECK)
150  throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
151 #else
152  throw()
153 #endif
154  { return _vsvassign(*this,cvector(rmatrix(m))); }
155 
156  INLINE cvector operator *(const rmatrix &m,const cvector &v)
157 #if(CXSC_INDEX_CHECK)
158  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
159 #else
160  throw()
161 #endif
162  { return _mvcmult<rmatrix,cvector,cvector>(m,v); }
163  INLINE cvector operator *(const rmatrix_slice &ms,const cvector &v)
164 #if(CXSC_INDEX_CHECK)
165  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
166 #else
167  throw()
168 #endif
169  { return _msvcmult<rmatrix_slice,cvector,cvector>(ms,v); }
170  INLINE cvector operator *(const cvector &v,const rmatrix &m)
171 #if(CXSC_INDEX_CHECK)
172  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
173 #else
174  throw()
175 #endif
176  { return _vmcmult<cvector,rmatrix,cvector>(v,m); }
177  INLINE cvector operator *(const cvector &v,const rmatrix_slice &ms)
178 #if(CXSC_INDEX_CHECK)
179  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
180 #else
181  throw()
182 #endif
183  { return _vmscmult<cvector,rmatrix_slice,cvector>(v,ms); }
184  INLINE cvector &operator *=(cvector &v,const rmatrix &m)
185 #if(CXSC_INDEX_CHECK)
186  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
187 #else
188  throw()
189 #endif
190  { return _vmcmultassign<cvector,rmatrix,complex>(v,m); }
191  INLINE cvector &operator *=(cvector &v,const rmatrix_slice &ms)
192 #if(CXSC_INDEX_CHECK)
193  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
194 #else
195  throw()
196 #endif
197  { return _vmscmultassign<cvector,rmatrix_slice,complex>(v,ms); }
198 
199  INLINE cvector operator *(const cvector_slice &v,const rmatrix &m)
200 #if(CXSC_INDEX_CHECK)
201  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
202 #else
203  throw()
204 #endif
205  { return _vmcmult<cvector,rmatrix,cvector>(cvector(v),m); }
207 #if(CXSC_INDEX_CHECK)
208  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
209 #else
210  throw()
211 #endif
212  { return _vsmcmultassign<cvector_slice,rmatrix,complex>(*this,m); }
213 
214 } // namespace cxsc
215 
216 #endif
217 
The Data Type rmatrix_slice.
Definition: rmatrix.hpp:1442
cvector_slice & operator*=(const complex &r)
Implementation of multiplication and allocation operation.
Definition: cvector.inl:423
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
civector operator*(const cimatrix_subv &rv, const cinterval &s)
Implementation of multiplication operation.
Definition: cimatrix.inl:731
cvector & operator=(const cvector &rv)
Implementation of standard assigning operator.
Definition: cvector.inl:276
The Data Type cvector.
Definition: cvector.hpp:57
The Data Type rmatrix_subv.
Definition: rmatrix.hpp:53
The Data Type rvector.
Definition: rvector.hpp:57
cvector_slice & operator=(const scvector &sl)
Implementation of standard assigning operator.
Definition: scvector.hpp:1545
The Data Type rmatrix.
Definition: rmatrix.hpp:470
The Scalar Type complex.
Definition: complex.hpp:49
cvector()
Constructor of class cvector.
Definition: cvector.inl:31
The Data Type cvector_slice.
Definition: cvector.hpp:844
cimatrix & operator*=(cimatrix &m, const cinterval &c)
Implementation of multiplication and allocation operation.
Definition: cimatrix.inl:1605