C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
lrvecrmat.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: lrvecrmat.inl,v 1.25 2014/01/30 17:23:47 cxsc Exp $ */
25 
26 // Here are definitions for l_rvector x rmatrix-Functions
27 #ifndef _CXSC_LRVECRMAT_INL_INCLUDED
28 #define _CXSC_LRVECRMAT_INL_INCLUDED
29 
30 namespace cxsc {
31 
32  INLINE l_rvector::l_rvector(const rmatrix &sl)
33 #if(CXSC_INDEX_CHECK)
34 
35 #else
36  noexcept
37 #endif
38  { _vmconstr<l_rvector,rmatrix,l_real>(*this,sl); }
40 #if(CXSC_INDEX_CHECK)
41 
42 #else
43  noexcept
44 #endif
45  { _vmsconstr<l_rvector,rmatrix_slice,l_real>(*this,sl); }
46  INLINE l_rvector::l_rvector(const rmatrix_subv &v) noexcept:l(v.lb),u(v.ub),size(v.size)
47  {
48  dat=new l_real[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_rvector _l_rvector(const rmatrix &sl)
58 #if(CXSC_INDEX_CHECK)
59 
60 #else
61  noexcept
62 #endif
63  { return l_rvector(sl); }
70 #if(CXSC_INDEX_CHECK)
71 
72 #else
73  noexcept
74 #endif
75  { return l_rvector(sl); }
76 
77  INLINE void accumulate(dotprecision &dp, const rmatrix_subv & rv1, const l_rvector &rv2)
78 #if(CXSC_INDEX_CHECK)
79 
80 #else
81  noexcept
82 #endif
83  { _vmvaccu<dotprecision,l_rvector,rmatrix_subv>(dp,rv2,rv1); }
84  INLINE void accumulate(dotprecision &dp, const l_rvector & rv1, const rmatrix_subv &rv2)
85 #if(CXSC_INDEX_CHECK)
86 
87 #else
88  noexcept
89 #endif
90  { _vmvaccu<dotprecision,l_rvector,rmatrix_subv>(dp,rv1,rv2); }
91  INLINE void accumulate(idotprecision &dp, const rmatrix_subv & rv1, const l_rvector &rv2)
92 #if(CXSC_INDEX_CHECK)
93 
94 #else
95  noexcept
96 #endif
97  { _vmvaccu<idotprecision,l_rvector,rmatrix_subv>(dp,rv2,rv1); }
98  INLINE void accumulate(idotprecision &dp, const l_rvector & rv1, const rmatrix_subv &rv2)
99 #if(CXSC_INDEX_CHECK)
100 
101 #else
102  noexcept
103 #endif
104  { _vmvaccu<idotprecision,l_rvector,rmatrix_subv>(dp,rv1,rv2); }
105 
106  INLINE void accumulate(dotprecision &dp, const rmatrix_subv & rv1, const l_rvector_slice &rv2)
107 #if(CXSC_INDEX_CHECK)
108 
109 #else
110  noexcept
111 #endif
112  { _vmvaccu<dotprecision,l_rvector,rmatrix_subv>(dp,l_rvector(rv2),rv1); }
113  INLINE void accumulate(dotprecision &dp, const l_rvector_slice & rv1, const rmatrix_subv &rv2)
114 #if(CXSC_INDEX_CHECK)
115 
116 #else
117  noexcept
118 #endif
119  { _vmvaccu<dotprecision,l_rvector,rmatrix_subv>(dp,l_rvector(rv1),rv2); }
120  INLINE void accumulate(idotprecision &dp, const rmatrix_subv & rv1, const l_rvector_slice &rv2)
121 #if(CXSC_INDEX_CHECK)
122 
123 #else
124  noexcept
125 #endif
126  { _vmvaccu<idotprecision,l_rvector,rmatrix_subv>(dp,l_rvector(rv2),rv1); }
127  INLINE void accumulate(idotprecision &dp, const l_rvector_slice & rv1, const rmatrix_subv &rv2)
128 #if(CXSC_INDEX_CHECK)
129 
130 #else
131  noexcept
132 #endif
133  { _vmvaccu<idotprecision,l_rvector,rmatrix_subv>(dp,l_rvector(rv1),rv2); }
134 
135  INLINE l_rvector &l_rvector::operator =(const rmatrix_subv &mv) noexcept { return _vmvassign<l_rvector,rmatrix_subv,l_real>(*this,mv); }
136  INLINE l_rvector_slice &l_rvector_slice::operator =(const rmatrix_subv &mv) noexcept { return _vsvassign(*this,rvector(mv)); }
138 #if(CXSC_INDEX_CHECK)
139 
140 #else
141  noexcept
142 #endif
143  { return _vmassign<l_rvector,rmatrix,l_real>(*this,m); }
145 #if(CXSC_INDEX_CHECK)
146 
147 #else
148  noexcept
149 #endif
150  { return _vmassign<l_rvector,rmatrix,l_real>(*this,rmatrix(m)); }
152 #if(CXSC_INDEX_CHECK)
153 
154 #else
155  noexcept
156 #endif
157  { return _vsvassign(*this,rvector(m)); }
159 #if(CXSC_INDEX_CHECK)
160 
161 #else
162  noexcept
163 #endif
164  { return _vsvassign(*this,l_rvector(rmatrix(m))); }
165 
166  INLINE l_rvector operator *(const rmatrix &m,const l_rvector &v)
167 #if(CXSC_INDEX_CHECK)
168 
169 #else
170  noexcept
171 #endif
172  { return _mvlmult<rmatrix,l_rvector,l_rvector>(m,v); }
173  INLINE l_rvector operator *(const rmatrix_slice &ms,const l_rvector &v)
174 #if(CXSC_INDEX_CHECK)
175 
176 #else
177  noexcept
178 #endif
179  { return _msvlmult<rmatrix_slice,l_rvector,l_rvector>(ms,v); }
180  INLINE l_rvector operator *(const l_rvector &v,const rmatrix &m)
181 #if(CXSC_INDEX_CHECK)
182 
183 #else
184  noexcept
185 #endif
186  { return _vmlmult<l_rvector,rmatrix,l_rvector>(v,m); }
187  INLINE l_rvector operator *(const l_rvector &v,const rmatrix_slice &ms)
188 #if(CXSC_INDEX_CHECK)
189 
190 #else
191  noexcept
192 #endif
193  { return _vmslmult<l_rvector,rmatrix_slice,l_rvector>(v,ms); }
194  INLINE l_rvector &operator *=(l_rvector &v,const rmatrix &m)
195 #if(CXSC_INDEX_CHECK)
196 
197 #else
198  noexcept
199 #endif
200  { return _vmlmultassign<l_rvector,rmatrix,l_real>(v,m); }
202 #if(CXSC_INDEX_CHECK)
203 
204 #else
205  noexcept
206 #endif
207  { return _vmslmultassign<l_rvector,rmatrix_slice,l_real>(v,ms); }
208 
209  INLINE l_rvector operator *(const l_rvector_slice &v,const rmatrix &m)
210 #if(CXSC_INDEX_CHECK)
211 
212 #else
213  noexcept
214 #endif
215  { return _vmlmult<l_rvector,rmatrix,l_rvector>(l_rvector(v),m); }
217 #if(CXSC_INDEX_CHECK)
218 
219 #else
220  noexcept
221 #endif
222  { *this=*this*m; return *this; }
223 
224 } // namespace cxsc
225 
226 #endif
227 
The Data Type dotprecision.
Definition: dot.hpp:112
The Data Type idotprecision.
Definition: idot.hpp:48
The Multiple-Precision Data Type l_real.
Definition: l_real.hpp:78
The Multiple-Precision Data Type l_rvector_slice.
Definition: l_rvector.hpp:745
l_rvector_slice & operator=(const l_rvector_slice &sl) noexcept
Implementation of standard assigning operator.
Definition: l_rvector.inl:240
l_rvector_slice & operator*=(const l_real &r) noexcept
Implementation of multiplication and allocation operation.
Definition: l_rvector.inl:306
The Multiple-Precision Data Type l_rvector.
Definition: l_rvector.hpp:54
l_rvector() noexcept
Constructor of class l_rvector.
Definition: l_rvector.inl:31
l_rvector & operator=(const l_rvector &rv) noexcept
Implementation of standard assigning operator.
Definition: l_rvector.inl:235
The Data Type rmatrix_slice.
Definition: rmatrix.hpp:1443
The Data Type rmatrix_subv.
Definition: rmatrix.hpp:54
The Data Type rmatrix.
Definition: rmatrix.hpp:471
The Data Type rvector.
Definition: rvector.hpp:58
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29
INLINE l_rvector _l_rvector(const rmatrix_subv &rs) noexcept
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
Definition: l_rmatrix.inl:102
cimatrix & operator*=(cimatrix &m, const cinterval &c) noexcept
Implementation of multiplication and allocation operation.
Definition: cimatrix.inl:1605
civector operator*(const cimatrix_subv &rv, const cinterval &s) noexcept
Implementation of multiplication operation.
Definition: cimatrix.inl:731