C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
rmatrix.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: rmatrix.inl,v 1.29 2014/01/30 17:23:48 cxsc Exp $ */
25 
26 #ifndef _CXSC_RMATRIX_INL_INCLUDED
27 #define _CXSC_RMATRIX_INL_INCLUDED
28 
29 #include "intmatrix.hpp"
30 
31 namespace cxsc {
32 
33 INLINE rmatrix::rmatrix() throw():dat(NULL),lb1(1),ub1(0),lb2(1),ub2(0),xsize(0),ysize(0)
34 {
35 }
36 
37 INLINE rmatrix::rmatrix(const real &r) throw():lb1(1),ub1(1),lb2(1),ub2(1),xsize(1),ysize(1)
38 {
39  dat=new real[1];
40  *dat=r;
41 }
42 
43 INLINE rmatrix::rmatrix(const rmatrix &rm) throw():lb1(rm.lb1),ub1(rm.ub1),lb2(rm.lb2),ub2(rm.ub2),xsize(rm.xsize),ysize(rm.ysize)
44 {
45  dat=new real[xsize*ysize];
46  for(int i=0;i<xsize*ysize;i++)
47  dat[i]=rm.dat[i];
48 }
49 
50 INLINE rmatrix::rmatrix(const int &m, const int &n)
51 #if(CXSC_INDEX_CHECK)
52  throw(ERROR_RMATRIX_WRONG_BOUNDARIES):lb1(1),ub1(m),lb2(1),ub2(n),xsize(n),ysize(m)
53 #else
54  throw():lb1(1),ub1(m),lb2(1),ub2(n),xsize(n),ysize(m)
55 #endif
56 {
57 #if(CXSC_INDEX_CHECK)
58  if((n<0)||(m<0)) cxscthrow(ERROR_RMATRIX_WRONG_BOUNDARIES("rmatrix::rmatrix(const int &m, const int &n)"));
59 #endif
60  dat=new real[m*n];
61 }
62 
63 INLINE rmatrix::rmatrix(const int &m1, const int &m2, const int &n1, const int &n2)
64 #if(CXSC_INDEX_CHECK)
65  throw(ERROR_RMATRIX_WRONG_BOUNDARIES):lb1(m1),ub1(m2),lb2(n1),ub2(n2),xsize(n2-n1+1),ysize(m2-m1+1)
66 #else
67  throw():lb1(m1),ub1(m2),lb2(n1),ub2(n2),xsize(n2-n1+1),ysize(m2-m1+1)
68 #endif
69 {
70 #if(CXSC_INDEX_CHECK)
71  if((m2<m1)||(n2<n1)) cxscthrow(ERROR_RMATRIX_WRONG_BOUNDARIES("rmatrix::rmatrix(const int &m1, const int &n1, const int &m2, const int &n2)"));
72 #endif
73  dat=new real[xsize*ysize];
74 }
75 
76 INLINE rvector::rvector(const rmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size)
77 {
78  dat=new real[size];
79  for (int i=0, j=v.start;i<v.size;i++,j+=v.offset)
80  dat[i]=v.dat[j];
81 }
82 
83 INLINE rmatrix::rmatrix(const rvector &v) throw():lb1(v.l),ub1(v.u),lb2(1),ub2(1),xsize(1),ysize(v.size)
84 {
85  dat=new real[v.size];
86  for(int i=0;i<v.size;i++)
87  dat[i]=v.dat[i];
88 }
89 
90 INLINE rmatrix::rmatrix(const rvector_slice &v) throw():lb1(v.start),ub1(v.end),lb2(1),ub2(1),xsize(1),ysize(v.size)
91 {
92  dat=new real[v.size];
93  for(int i=0,j=v.start-v.l;i<v.size;i++,j++)
94  dat[i]=v.dat[j];
95 }
96 
97 
98  INLINE rmatrix::rmatrix(const rmatrix_slice &sl) throw():lb1(sl.start1),ub1(sl.end1),lb2(sl.start2),ub2(sl.end2),xsize(sl.sxsize),ysize(sl.sysize)
99  {
100  int i,j;
101 
102  dat=new real[xsize*ysize];
103  for (i=0;i<ysize;i++)
104  {
105  for(j=0;j<xsize;j++)
106  {
107  dat[i*xsize+j]=sl.dat[(sl.offset1+i)*sl.mxsize+sl.offset2+j];
108  }
109  }
110  }
111 
112 INLINE rmatrix::rmatrix(const intmatrix& I) : lb1(Lb(I,1)),ub1(Ub(I,1)),lb2(Lb(I,2)),ub2(Ub(I,2)),xsize(RowLen(I)),ysize(ColLen(I)) {
113  dat=new real[xsize*ysize];
114  for(int i=0 ; i<ysize ; i++)
115  for(int j=0 ; j<xsize ; j++)
116  dat[i*xsize+j] = I[i+lb1][j+lb2];
117 }
118 
119  INLINE rmatrix_subv Row(rmatrix &m,const int &i)
120 #if(CXSC_INDEX_CHECK)
121  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
122 #else
123  throw()
124 #endif
125 
126  {
127  return m[i];
128  }
129 
130  INLINE rmatrix_subv Col(rmatrix &m,const int &i)
131 #if(CXSC_INDEX_CHECK)
132  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
133 #else
134  throw()
135 #endif
136 
137  {
138  return m[Col(i)];
139  }
140  INLINE rmatrix_subv Row(const rmatrix &m,const int &i)
141 #if(CXSC_INDEX_CHECK)
142  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
143 #else
144  throw()
145 #endif
146 
147  {
148  return m[i];
149  }
150 
151  INLINE rmatrix_subv Col(const rmatrix &m,const int &i)
152 #if(CXSC_INDEX_CHECK)
153  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
154 #else
155  throw()
156 #endif
157 
158  {
159  return m[Col(i)];
160  }
161 
162  INLINE real& rmatrix_subv::operator [](const int &i) const
163 #if(CXSC_INDEX_CHECK)
164  throw(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC)
165 #else
166  throw()
167 #endif
168  {
169 #if(CXSC_INDEX_CHECK)
170  if((i<lb)||(i>ub)) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC("real &rmatrix_subv::operator [](const int &i) const"));
171 #endif
172  return dat[start+((i-lb)*offset)];
173  }
174 
175  INLINE real& rmatrix_subv::operator [](const int &i)
176 #if(CXSC_INDEX_CHECK)
177  throw(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC)
178 #else
179  throw()
180 #endif
181  {
182 #if(CXSC_INDEX_CHECK)
183  if((i<lb)||(i>ub)) cxscthrow(ERROR_RVECTOR_ELEMENT_NOT_IN_VEC("real &rmatrix_subv::operator [](const int &i)"));
184 #endif
185  return dat[start+((i-lb)*offset)];
186  }
187 
188 
189 
190  INLINE rmatrix_subv rmatrix::operator [](const int &i) const
191 #if(CXSC_INDEX_CHECK)
192  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
193 #else
194  throw()
195 #endif
196  {
197 #if(CXSC_INDEX_CHECK)
198  if((i<lb1)||(i>ub1)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix::operator [](const int &i)"));
199 #endif
200  return rmatrix_subv(dat, lb2, ub2, xsize, xsize*(i-lb1),1);
201  }
202 
203  INLINE rmatrix_subv rmatrix::operator [](const cxscmatrix_column &i) const
204 #if(CXSC_INDEX_CHECK)
205  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
206 #else
207  throw()
208 #endif
209  {
210 #if(CXSC_INDEX_CHECK)
211  if((i.col()<lb2)||(i.col()>ub2)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix::operator [](const cxscmatrix_column &i)"));
212 #endif
213  return rmatrix_subv(dat, lb1, ub1, ysize, i.col()-lb2, xsize);
214  }
215 
216  INLINE rmatrix_slice rmatrix::operator ()(const int &m, const int &n)
217 #if(CXSC_INDEX_CHECK)
218  throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
219 #else
220  throw()
221 #endif
222  {
223 #if(CXSC_INDEX_CHECK)
224  if((m<1)||(n<1)||(m<lb1)||(n<lb2)||(m>ub1)||(n>ub2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG("rmatrix_slice rmatrix::operator ()(const int &m, const int &n)"));
225 #endif
226  return rmatrix_slice(*this,1,m,1,n);
227  }
228 
229  INLINE rmatrix_slice rmatrix::operator ()(const int &m1, const int &m2, const int &n1, const int &n2)
230 #if(CXSC_INDEX_CHECK)
231  throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
232 #else
233  throw()
234 #endif
235  {
236 #if(CXSC_INDEX_CHECK)
237  if((m1<lb1)||(n1<lb2)||(m2>ub1)||(n2>ub2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG("rmatrix_slice rmatrix::operator ()(const int &m1, const int &n1, const int &m2, const int &n2)"));
238 #endif
239  return rmatrix_slice(*this,m1,m2,n1,n2);
240  }
241 
242  INLINE rmatrix_subv rmatrix_slice::operator [](const int &i) const
243 #if(CXSC_INDEX_CHECK)
244  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
245 #else
246  throw()
247 #endif
248  {
249 #if(CXSC_INDEX_CHECK)
250  if((i<start1)||(i>end1)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix_slice::operator [](const int &i)"));
251 #endif
252  return rmatrix_subv(dat, start2, end2, sxsize, mxsize*(i-start1+offset1)+offset2,1);
253  }
254 
255  INLINE rmatrix_subv rmatrix_slice::operator [](const cxscmatrix_column &i) const
256 #if(CXSC_INDEX_CHECK)
257  throw(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT)
258 #else
259  throw()
260 #endif
261  {
262 #if(CXSC_INDEX_CHECK)
263  if((i.col()<start2)||(i.col()>end2)) cxscthrow(ERROR_RMATRIX_ROW_OR_COL_NOT_IN_MAT("rmatrix_subv rmatrix_slice::operator [](const cxscmatrix_column &i)"));
264 #endif
265  return rmatrix_subv(dat, start1, end1, sysize, offset1*mxsize+i.col()-start2+offset2, mxsize);
266  }
267 
268  INLINE rmatrix_slice rmatrix_slice::operator ()(const int &m, const int &n)
269 #if(CXSC_INDEX_CHECK)
270  throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
271 #else
272  throw()
273 #endif
274  {
275 #if(CXSC_INDEX_CHECK)
276  if((m<1)||(n<1)||(m<start1)||(n<start2)||(m>end1)||(n>end2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG("rmatrix_slice rmatrix_slice::operator ()(const int &m, const int &n)"));
277 #endif
278  return rmatrix_slice(*this,1,m,1,n);
279  }
280 
281  INLINE rmatrix_slice rmatrix_slice::operator ()(const int &m1, const int &m2, const int &n1, const int &n2)
282 #if(CXSC_INDEX_CHECK)
283  throw(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG)
284 #else
285  throw()
286 #endif
287  {
288 #if(CXSC_INDEX_CHECK)
289  if((m1<start1)||(n1<start2)||(m2>end1)||(n2>end2)) cxscthrow(ERROR_RMATRIX_SUB_ARRAY_TOO_BIG("rmatrix_slice rmatrix_slice::operator ()(const int &m1, const int &m2, const int &n1, const int &n2)"));
290 #endif
291  return rmatrix_slice(*this,m1,m2,n1,n2);
292  }
293 
295 #if(CXSC_INDEX_CHECK)
296  throw(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG)
297 #else
298  throw()
299 #endif
300 {
301 #if(CXSC_INDEX_CHECK)
302  if(1<lb||i>ub) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG("rmatrix_subv rmatrix_subv::operator ()(const int &i)"));
303 #endif
304  return rmatrix_subv(dat,1,i,i,start+(1-lb)*offset,offset);
305 }
306 
307 INLINE rmatrix_subv rmatrix_subv::operator ()(const int &i1,const int &i2)
308 #if(CXSC_INDEX_CHECK)
309  throw(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG)
310 #else
311  throw()
312 #endif
313 {
314 #if(CXSC_INDEX_CHECK)
315  if(i1<lb||i2>ub) cxscthrow(ERROR_RVECTOR_SUB_ARRAY_TOO_BIG("rmatrix_subv rmatrix_subv::operator ()(const int &i1,const int &i2)"));
316 #endif
317  return rmatrix_subv(dat,i1,i2,i2-i1+1,start+(i1-lb)*offset,offset);
318 }
319 
320 // the following is generated from .hpp
321 
322  INLINE rmatrix_subv &rmatrix_subv::operator =(const rmatrix_subv &rv) throw() { return _mvmvassign(*this,rv); }
323  INLINE rmatrix_subv &rmatrix_subv::operator =(const real &r) throw() { return _mvsassign(*this,r); }
325 #if(CXSC_INDEX_CHECK)
326  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
327 #else
328  throw()
329 #endif
330  { return _mvvassign(*this,v); }
332 #if(CXSC_INDEX_CHECK)
333  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
334 #else
335  throw()
336 #endif
337  { return _mvvassign(*this,rvector(v)); }
338  INLINE rmatrix &rmatrix::operator =(const real &r) throw() { return _msassign(*this,r); }
339  INLINE rmatrix &rmatrix::operator =(const rmatrix &m) throw() { return _mmassign<rmatrix,rmatrix,real>(*this,m,0); }
340  INLINE rmatrix &rmatrix::operator =(const rvector &v) throw() { return _mvassign<rmatrix,rvector,real>(*this,v); }
341  INLINE rmatrix &rmatrix::operator =(const rvector_slice &v) throw() { return _mvassign<rmatrix,rvector,real>(*this,rvector(v)); }
342  INLINE rmatrix::operator void*() throw() { return _mvoid(*this); }
344 #if(CXSC_INDEX_CHECK)
345  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
346 #else
347  throw()
348 #endif
349  { return _msmassign(*this,m); }
351 #if(CXSC_INDEX_CHECK)
352  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
353 #else
354  throw()
355 #endif
356  { return _msmsassign(*this,ms); }
357  INLINE rmatrix_slice &rmatrix_slice::operator =(const real &r) throw() { return _mssassign(*this,r); }
359 #if(CXSC_INDEX_CHECK)
360  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
361 #else
362  throw()
363 #endif
364  { return _msmassign(*this,rmatrix(v)); }
366 #if(CXSC_INDEX_CHECK)
367  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
368 #else
369  throw()
370 #endif
371  { return _msmassign(*this,rmatrix(rvector(v))); }
373 #if(CXSC_INDEX_CHECK)
374  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
375 #else
376  throw()
377 #endif
378  { return _msmassign(*this,rmatrix(rvector(v))); }
380 #if(CXSC_INDEX_CHECK)
381  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
382 #else
383  throw()
384 #endif
385  { return _msmplusassign(*this,m1); }
387 #if(CXSC_INDEX_CHECK)
388  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
389 #else
390  throw()
391 #endif
392  { return _msmsplusassign(*this,ms2); }
394 #if(CXSC_INDEX_CHECK)
395  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
396 #else
397  throw()
398 #endif
399  { return _msmminusassign(*this,m1); }
401 #if(CXSC_INDEX_CHECK)
402  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
403 #else
404  throw()
405 #endif
406  { return _msmsminusassign(*this,ms2); }
408 #if(CXSC_INDEX_CHECK)
409  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
410 #else
411  throw()
412 #endif
413  { return (*this=*this*m); }
415 #if(CXSC_INDEX_CHECK)
416  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
417 #else
418  throw()
419 #endif
420  { return (*this=*this*m); }
421  INLINE rmatrix_slice &rmatrix_slice::operator *=(const real &c) throw() { return _mssmultassign(*this,c); }
422  INLINE rmatrix_slice &rmatrix_slice::operator /=(const real &c) throw() { return _mssdivassign(*this,c); }
423  INLINE rmatrix_slice::operator void*() throw() { return _msvoid(*this); }
424  INLINE rvector operator /(const rmatrix_subv &rv, const real &s) throw() { return _mvsdiv<rmatrix_subv,real,rvector>(rv,s); }
425  INLINE rvector operator *(const rmatrix_subv &rv, const real &s) throw() { return _mvsmult<rmatrix_subv,real,rvector>(rv,s); }
426  INLINE rvector operator *(const real &s, const rmatrix_subv &rv) throw() { return _mvsmult<rmatrix_subv,real,rvector>(rv,s); }
427  INLINE rmatrix_subv &rmatrix_subv::operator *=(const real &c) throw() { return _mvsmultassign(*this,c); }
428  INLINE rmatrix_subv &rmatrix_subv::operator +=(const real &c) throw() { return _mvsplusassign(*this,c); }
429  INLINE rmatrix_subv &rmatrix_subv::operator -=(const real &c) throw() { return _mvsminusassign(*this,c); }
430  INLINE rmatrix_subv &rmatrix_subv::operator /=(const real &c) throw() { return _mvsdivassign(*this,c); }
431  INLINE rvector abs(const rmatrix_subv &mv) throw() { return _mvabs<rmatrix_subv,rvector>(mv); }
432  INLINE rvector &rvector::operator =(const rmatrix_subv &mv) throw() { return _vmvassign<rvector,rmatrix_subv,real>(*this,mv); }
433  INLINE rvector_slice &rvector_slice::operator =(const rmatrix_subv &mv) throw() { return _vsvassign(*this,rvector(mv)); }
434 
435 
436  INLINE real operator *(const rmatrix_subv & rv1, const rmatrix_subv &rv2)
437 #if(CXSC_INDEX_CHECK)
438  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
439 #else
440  throw()
441 #endif
442  { return _mvmvmult<rmatrix_subv,rmatrix_subv,real>(rv1,rv2); }
443  INLINE real operator *(const rvector & rv1, const rmatrix_subv &rv2)
444 #if(CXSC_INDEX_CHECK)
445  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
446 #else
447  throw()
448 #endif
449  { return _vmvmult<rvector,rmatrix_subv,real>(rv1,rv2); }
450  INLINE real operator *(const rmatrix_subv &rv1,const rvector &rv2)
451 #if(CXSC_INDEX_CHECK)
452  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
453 #else
454  throw()
455 #endif
456  { return _vmvmult<rvector,rmatrix_subv,real>(rv2,rv1); }
457  INLINE real operator *(const rvector_slice &sl,const rmatrix_subv &sv)
458 #if(CXSC_INDEX_CHECK)
459  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
460 #else
461  throw()
462 #endif
463  { return _vmvmult<rvector,rmatrix_subv,real>(rvector(sl),sv); }
464  INLINE real operator *(const rmatrix_subv &mv,const rvector_slice &vs)
465 #if(CXSC_INDEX_CHECK)
466  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
467 #else
468  throw()
469 #endif
470  { return _vmvmult<rvector,rmatrix_subv,real>(rvector(vs),mv); }
471  INLINE rvector operator +(const rmatrix_subv & rv1, const rmatrix_subv &rv2)
472 #if(CXSC_INDEX_CHECK)
473  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
474 #else
475  throw()
476 #endif
477  { return _mvmvplus<rmatrix_subv,rmatrix_subv,rvector>(rv1,rv2); }
478  INLINE rvector operator +(const rmatrix_subv &rv1,const rvector &rv2)
479 #if(CXSC_INDEX_CHECK)
480  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
481 #else
482  throw()
483 #endif
484  { return _mvvplus<rmatrix_subv,rvector,rvector>(rv1,rv2); }
485  INLINE rvector operator +(const rvector & rv1, const rmatrix_subv &rv2)
486 #if(CXSC_INDEX_CHECK)
487  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
488 #else
489  throw()
490 #endif
491  { return _mvvplus<rmatrix_subv,rvector,rvector>(rv2,rv1); }
492  INLINE rvector operator +(const rvector_slice &sl,const rmatrix_subv &mv)
493 #if(CXSC_INDEX_CHECK)
494  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
495 #else
496  throw()
497 #endif
498  { return _mvvplus<rmatrix_subv,rvector,rvector>(mv,rvector(sl)); }
499  INLINE rvector operator +(const rmatrix_subv &mv,const rvector_slice &sl)
500 #if(CXSC_INDEX_CHECK)
501  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
502 #else
503  throw()
504 #endif
505  { return _mvvplus<rmatrix_subv,rvector,rvector>(mv,rvector(sl)); }
507 #if(CXSC_INDEX_CHECK)
508  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
509 #else
510  throw()
511 #endif
512  { return _mvvplusassign(*this,rv); }
514 #if(CXSC_INDEX_CHECK)
515  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
516 #else
517  throw()
518 #endif
519  { return _mvvplusassign(*this,rvector(rv)); }
520  INLINE rvector operator -(const rmatrix_subv & rv1, const rmatrix_subv &rv2)
521 #if(CXSC_INDEX_CHECK)
522  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
523 #else
524  throw()
525 #endif
526  { return _mvmvminus<rmatrix_subv,rmatrix_subv,rvector>(rv1,rv2); }
527  INLINE rvector operator -(const rvector & rv1, const rmatrix_subv &rv2)
528 #if(CXSC_INDEX_CHECK)
529  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
530 #else
531  throw()
532 #endif
533  { return _vmvminus<rvector,rmatrix_subv,rvector>(rv1,rv2); }
534  INLINE rvector operator -(const rmatrix_subv &rv1,const rvector &rv2)
535 #if(CXSC_INDEX_CHECK)
536  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
537 #else
538  throw()
539 #endif
540  { return _mvvminus<rmatrix_subv,rvector,rvector>(rv1,rv2); }
541  INLINE rvector operator -(const rvector_slice &sl,const rmatrix_subv &mv)
542 #if(CXSC_INDEX_CHECK)
543  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
544 #else
545  throw()
546 #endif
547  { return _vmvminus<rvector,rmatrix_subv,rvector>(rvector(sl),mv); }
548  INLINE rvector operator -(const rmatrix_subv &mv,const rvector_slice &sl)
549 #if(CXSC_INDEX_CHECK)
550  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
551 #else
552  throw()
553 #endif
554  { return _mvvminus<rmatrix_subv,rvector,rvector>(mv,rvector(sl)); }
556 #if(CXSC_INDEX_CHECK)
557  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
558 #else
559  throw()
560 #endif
561  { return _mvvminusassign(*this,rv); }
563 #if(CXSC_INDEX_CHECK)
564  throw(ERROR_RVECTOR_OP_WITH_WRONG_DIM)
565 #else
566  throw()
567 #endif
568  { return _mvvminusassign(*this,rvector(rv)); }
574  INLINE rmatrix _rmatrix(const rmatrix &rm) throw() { return rm; }
580  INLINE rmatrix _rmatrix(const rvector &v) throw() { return rmatrix(v); }
586  INLINE rmatrix _rmatrix(const rvector_slice &v) throw() { return rmatrix(v); }
592  INLINE rmatrix _rmatrix(const real &r) throw() { return rmatrix(r); }
593  INLINE rmatrix &rmatrix::operator =(const rmatrix_slice &ms) throw() { return _mmsassign<rmatrix,rmatrix_slice,real>(*this,ms); }
594  INLINE int Lb(const rmatrix &rm, const int &i)
595 #if(CXSC_INDEX_CHECK)
596  throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
597 #else
598  throw()
599 #endif
600  { return _mlb(rm,i); }
601  INLINE int Ub(const rmatrix &rm, const int &i)
602 #if(CXSC_INDEX_CHECK)
603  throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
604 #else
605  throw()
606 #endif
607  { return _mub(rm,i); }
608  INLINE int Lb(const rmatrix_slice &rm, const int &i)
609 #if(CXSC_INDEX_CHECK)
610  throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
611 #else
612  throw()
613 #endif
614  { return _mslb(rm,i); }
615  INLINE int Ub(const rmatrix_slice &rm, const int &i)
616 #if(CXSC_INDEX_CHECK)
617  throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
618 #else
619  throw()
620 #endif
621  { return _msub(rm,i); }
622  INLINE rmatrix &SetLb(rmatrix &m, const int &i,const int &j)
623 #if(CXSC_INDEX_CHECK)
624  throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
625 #else
626  throw()
627 #endif
628  { return _msetlb(m,i,j); }
629  INLINE rmatrix &SetUb(rmatrix &m, const int &i,const int &j)
630 #if(CXSC_INDEX_CHECK)
631  throw(ERROR_RMATRIX_WRONG_ROW_OR_COL)
632 #else
633  throw()
634 #endif
635  { return _msetub(m,i,j); }
636 
637 
638  INLINE int RowLen ( const rmatrix& A ) // Length of the rows of a real matrix
639  { return Ub(A,2)-Lb(A,2)+1; } //------------------------------------
640 
641  INLINE int ColLen ( const rmatrix& A ) // Length of the columns of a real matrix
642  { return Ub(A,1)-Lb(A,1)+1; } //---------------------------------------
643 
644  INLINE int RowLen ( const rmatrix_slice& A ) // Length of the rows of a real matrix
645  { return Ub(A,2)-Lb(A,2)+1; } //------------------------------------
646 
647  INLINE int ColLen ( const rmatrix_slice& A ) // Length of the columns of a real matrix
648  { return Ub(A,1)-Lb(A,1)+1; } //---------------------------------------
649 
650  INLINE void Resize(rmatrix &A) throw() { _mresize(A); }
651  INLINE void Resize(rmatrix &A,const int &m, const int &n)
652 #if(CXSC_INDEX_CHECK)
653  throw(ERROR_RMATRIX_WRONG_BOUNDARIES)
654 #else
655  throw()
656 #endif
657  { _mresize<rmatrix,real>(A,m,n); }
658  INLINE void Resize(rmatrix &A,const int &m1, const int &m2,const int &n1,const int &n2)
659 #if(CXSC_INDEX_CHECK)
660  throw(ERROR_RMATRIX_WRONG_BOUNDARIES)
661 #else
662  throw()
663 #endif
664  { _mresize<rmatrix,real>(A,m1,m2,n1,n2); }
665  INLINE rmatrix abs(const rmatrix &m) throw() { return _mabs<rmatrix,rmatrix>(m); }
666  INLINE rmatrix abs(const rmatrix_slice &ms) throw() { return _msabs<rmatrix_slice,rmatrix>(ms); }
667  INLINE real::real(const rmatrix &m)
668 #if(CXSC_INDEX_CHECK)
669  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_RMATRIX_USE_OF_UNINITIALIZED_OBJ)
670 #else
671  throw()
672 #endif
673  { _smconstr(*this,m); }
674 // INLINE real real::_real(const rmatrix &m) throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ,ERROR_RMATRIX_USE_OF_UNINITIALIZED_OBJ) { _smconstr(*this,m); return *this; }
675  INLINE rmatrix operator *(const real &c, const rmatrix &m) throw() { return _smmult<real,rmatrix,rmatrix>(c,m); }
676  INLINE rmatrix operator *(const real &c, const rmatrix_slice &ms) throw() { return _smsmult<real,rmatrix_slice,rmatrix>(c,ms); }
677  INLINE rmatrix operator *(const rmatrix &m,const real &c) throw() { return _smmult<real,rmatrix,rmatrix>(c,m); }
678  INLINE rmatrix operator *(const rmatrix_slice &ms,const real &c) throw() { return _smsmult<real,rmatrix_slice,rmatrix>(c,ms); }
679  INLINE rmatrix &operator *=(rmatrix &m,const real &c) throw() { return _msmultassign(m,c); }
680  INLINE rmatrix operator /(const rmatrix &m,const real &c) throw() { return _msdiv<rmatrix,real,rmatrix>(m,c); }
681  INLINE rmatrix operator /(const rmatrix_slice &ms, const real &c) throw() { return _mssdiv<rmatrix_slice,real,rmatrix>(ms,c); }
682  INLINE rmatrix &operator /=(rmatrix &m,const real &c) throw() { return _msdivassign(m,c); }
683  INLINE rvector::rvector(const rmatrix &sl)
684 #if(CXSC_INDEX_CHECK)
685  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
686 #else
687  throw()
688 #endif
689  { _vmconstr<rvector,rmatrix,real>(*this,sl); }
690  INLINE rvector::rvector(const rmatrix_slice &sl)
691 #if(CXSC_INDEX_CHECK)
692  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
693 #else
694  throw()
695 #endif
696  { _vmsconstr<rvector,rmatrix_slice,real>(*this,sl); }
698 #if(CXSC_INDEX_CHECK)
699  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
700 #else
701  throw()
702 #endif
703  { return _vmassign<rvector,rmatrix,real>(*this,m); }
705 #if(CXSC_INDEX_CHECK)
706  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
707 #else
708  throw()
709 #endif
710  { return _vmassign<rvector,rmatrix,real>(*this,rmatrix(m)); }
712 #if(CXSC_INDEX_CHECK)
713  throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
714 #else
715  throw()
716 #endif
717  { return _vsvassign(*this,rvector(m)); }
719 #if(CXSC_INDEX_CHECK)
720  throw(ERROR__OP_WITH_WRONG_DIM<rvector>,ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
721 #else
722  throw()
723 #endif
724  { return _vsvassign(*this,rvector(rmatrix(m))); }
726 #if(CXSC_INDEX_CHECK)
727  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
728 #else
729  throw()
730 #endif
731  { return _mvvassign(*this,rvector(m)); }
733 #if(CXSC_INDEX_CHECK)
734  throw(ERROR_RMATRIX_TYPE_CAST_OF_THICK_OBJ)
735 #else
736  throw()
737 #endif
738  { return _mvvassign(*this,rvector(rmatrix(m))); }
739  INLINE rvector operator *(const rmatrix &m,const rvector &v)
740 #if(CXSC_INDEX_CHECK)
741  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
742 #else
743  throw()
744 #endif
745  { return _mvmult<rmatrix,rvector,rvector>(m,v); };
746  INLINE rvector operator *(const rmatrix_slice &ms,const rvector &v)
747 #if(CXSC_INDEX_CHECK)
748  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
749 #else
750  throw()
751 #endif
752  { return _msvmult<rmatrix_slice,rvector,rvector>(ms,v); }
753  INLINE rvector operator *(const rvector &v,const rmatrix &m)
754 #if(CXSC_INDEX_CHECK)
755  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
756 #else
757  throw()
758 #endif
759  { return _vmmult<rvector,rmatrix,rvector>(v,m); }
760  INLINE rvector operator *(const rvector &v,const rmatrix_slice &ms)
761 #if(CXSC_INDEX_CHECK)
762  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
763 #else
764  throw()
765 #endif
766  { return _vmsmult<rvector,rmatrix_slice,rvector>(v,ms); }
767  INLINE rvector &operator *=(rvector &v,const rmatrix &m)
768 #if(CXSC_INDEX_CHECK)
769  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
770 #else
771  throw()
772 #endif
773  { return _vmmultassign<rvector,rmatrix,real>(v,m); }
774  INLINE rvector &operator *=(rvector &v,const rmatrix_slice &ms)
775 #if(CXSC_INDEX_CHECK)
776  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
777 #else
778  throw()
779 #endif
780  { return _vmsmultassign<rvector,rmatrix_slice,real>(v,ms); }
782 #if(CXSC_INDEX_CHECK)
783  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
784 #else
785  throw()
786 #endif
787  { return _vsmmultassign<rvector_slice,rmatrix,real>(*this,m); }
788  INLINE rvector operator *(const rvector_slice &v,const rmatrix &m)
789 #if(CXSC_INDEX_CHECK)
790  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
791 #else
792  throw()
793 #endif
794  { return _vmmult<rvector,rmatrix,rvector>(rvector(v),m); }
795 
796  INLINE const rmatrix &operator +(const rmatrix &m) throw() { return m; }
797  INLINE rmatrix operator +(const rmatrix_slice &m) throw() { return rmatrix(m); }
798  INLINE rmatrix operator +(const rmatrix &m1,const rmatrix &m2)
799 #if(CXSC_INDEX_CHECK)
800  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
801 #else
802  throw()
803 #endif
804  { return _mmplus<rmatrix,rmatrix,rmatrix>(m1,m2); }
805  INLINE rmatrix operator +(const rmatrix &m,const rmatrix_slice &ms)
806 #if(CXSC_INDEX_CHECK)
807  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
808 #else
809  throw()
810 #endif
811  { return _mmsplus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
812  INLINE rmatrix operator +(const rmatrix_slice &ms,const rmatrix &m)
813 #if(CXSC_INDEX_CHECK)
814  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
815 #else
816  throw()
817 #endif
818  { return _mmsplus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
819  INLINE rmatrix operator +(const rmatrix_slice &m1,const rmatrix_slice &m2)
820 #if(CXSC_INDEX_CHECK)
821  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
822 #else
823  throw()
824 #endif
825  { return _msmsplus<rmatrix_slice,rmatrix_slice,rmatrix>(m1,m2); }
826  INLINE rmatrix &operator +=(rmatrix &m1,const rmatrix &m2)
827 #if(CXSC_INDEX_CHECK)
828  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
829 #else
830  throw()
831 #endif
832  { return _mmplusassign(m1,m2); }
833  INLINE rmatrix &operator +=(rmatrix &m1,const rmatrix_slice &ms)
834 #if(CXSC_INDEX_CHECK)
835  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
836 #else
837  throw()
838 #endif
839  { return _mmsplusassign(m1,ms); }
840  INLINE rmatrix operator -(const rmatrix &m) throw() { return _mminus(m); }
841  INLINE rmatrix operator -(const rmatrix_slice &m) throw() { return _msminus<rmatrix_slice,rmatrix>(m); }
842  INLINE rmatrix operator -(const rmatrix &m1,const rmatrix &m2)
843 #if(CXSC_INDEX_CHECK)
844  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
845 #else
846  throw()
847 #endif
848  { return _mmminus<rmatrix,rmatrix,rmatrix>(m1,m2); }
849  INLINE rmatrix operator -(const rmatrix &m,const rmatrix_slice &ms)
850 #if(CXSC_INDEX_CHECK)
851  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
852 #else
853  throw()
854 #endif
855  { return _mmsminus<rmatrix,rmatrix_slice,rmatrix>(m,ms); }
856  INLINE rmatrix operator -(const rmatrix_slice &ms,const rmatrix &m)
857 #if(CXSC_INDEX_CHECK)
858  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
859 #else
860  throw()
861 #endif
862  { return _msmminus<rmatrix_slice,rmatrix,rmatrix>(ms,m); }
863  INLINE rmatrix operator -(const rmatrix_slice &ms1,const rmatrix_slice &ms2)
864 #if(CXSC_INDEX_CHECK)
865  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
866 #else
867  throw()
868 #endif
869  { return _msmsminus<rmatrix_slice,rmatrix_slice,rmatrix>(ms1,ms2); }
870  INLINE rmatrix &operator -=(rmatrix &m1,const rmatrix &m2)
871 #if(CXSC_INDEX_CHECK)
872  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
873 #else
874  throw()
875 #endif
876  { return _mmminusassign(m1,m2); }
877  INLINE rmatrix &operator -=(rmatrix &m1,const rmatrix_slice &ms)
878 #if(CXSC_INDEX_CHECK)
879  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
880 #else
881  throw()
882 #endif
883  { return _mmsminusassign(m1,ms); }
884  INLINE rmatrix operator *(const rmatrix &m1, const rmatrix &m2)
885 #if(CXSC_INDEX_CHECK)
886  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
887 #else
888  throw()
889 #endif
890  { return _mmmult<rmatrix,rmatrix,rmatrix>(m1,m2); }
891  INLINE rmatrix operator *(const rmatrix &m1, const rmatrix_slice &ms)
892 #if(CXSC_INDEX_CHECK)
893  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
894 #else
895  throw()
896 #endif
897  { return _mmsmult<rmatrix,rmatrix_slice,rmatrix>(m1,ms); }
898  INLINE rmatrix operator *(const rmatrix_slice &ms, const rmatrix &m1)
899 #if(CXSC_INDEX_CHECK)
900  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
901 #else
902  throw()
903 #endif
904  { return _msmmult<rmatrix_slice,rmatrix,rmatrix>(ms,m1); }
905  INLINE rmatrix operator *(const rmatrix_slice &ms1, const rmatrix_slice &ms2)
906 #if(CXSC_INDEX_CHECK)
907  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
908 #else
909  throw()
910 #endif
911  { return _msmsmult<rmatrix_slice,rmatrix_slice,rmatrix>(ms1,ms2); }
912  INLINE rmatrix &operator *=(rmatrix &m1,const rmatrix &m2)
913 #if(CXSC_INDEX_CHECK)
914  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
915 #else
916  throw()
917 #endif
918  { return _mmmultassign<rmatrix,rmatrix,real>(m1,m2); }
919  INLINE rmatrix &operator *=(rmatrix &m1,const rmatrix_slice &ms)
920 #if(CXSC_INDEX_CHECK)
921  throw(ERROR_RMATRIX_OP_WITH_WRONG_DIM)
922 #else
923  throw()
924 #endif
925  { return _mmsmultassign<rmatrix,rmatrix_slice,real>(m1,ms); }
926  INLINE bool operator ==(const rmatrix &m1,const rmatrix &m2) throw() { return _mmeq(m1,m2); }
927  INLINE bool operator !=(const rmatrix &m1,const rmatrix &m2) throw() { return _mmneq(m1,m2); }
928  INLINE bool operator <(const rmatrix &m1,const rmatrix &m2) throw() { return _mmless(m1,m2); }
929  INLINE bool operator <=(const rmatrix &m1,const rmatrix &m2) throw() { return _mmleq(m1,m2); }
930  INLINE bool operator >(const rmatrix &m1,const rmatrix &m2) throw() { return _mmless(m2,m1); }
931  INLINE bool operator >=(const rmatrix &m1,const rmatrix &m2) throw() { return _mmleq(m2,m1); }
932  INLINE bool operator ==(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmseq(m1,ms); }
933  INLINE bool operator !=(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmsneq(m1,ms); }
934  INLINE bool operator <(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmsless(m1,ms); }
935  INLINE bool operator <=(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _mmsleq(m1,ms); }
936  INLINE bool operator >(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _msmless(ms,m1); }
937  INLINE bool operator >=(const rmatrix &m1,const rmatrix_slice &ms) throw() { return _msmleq(ms,m1); }
938  INLINE bool operator ==(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmseq(m1,m2); }
939  INLINE bool operator !=(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsneq(m1,m2); }
940  INLINE bool operator <(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsless(m1,m2); }
941  INLINE bool operator <=(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsleq(m1,m2); }
942  INLINE bool operator >(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsless(m2,m1); }
943  INLINE bool operator >=(const rmatrix_slice &m1,const rmatrix_slice &m2) throw() { return _msmsleq(m2,m1); }
944  INLINE bool operator !(const rmatrix &ms) throw() { return _mnot(ms); }
945  INLINE bool operator !(const rmatrix_slice &ms) throw() { return _msnot(ms); }
946  INLINE std::ostream &operator <<(std::ostream &s,const rmatrix &r) throw() { return _mout(s,r); }
947  INLINE std::ostream &operator <<(std::ostream &s,const rmatrix_slice &r) throw() { return _msout(s,r); }
948  INLINE std::istream &operator >>(std::istream &s,rmatrix &r) throw() { return _min(s,r); }
949  INLINE std::istream &operator >>(std::istream &s,rmatrix_slice &r) throw() { return _msin(s,r); }
950 
952  INLINE rmatrix rmatrix::operator()(const intvector& p, const intvector& q) {
953  rmatrix A(*this);
954  for(int i=0 ; i<ColLen(A) ; i++)
955  for(int j=0 ; j<RowLen(A) ; j++)
956  A[i+Lb(A,1)][j+Lb(A,2)] = (*this)[p[i+Lb(p)]+Lb(A,1)][q[j+Lb(q)]+Lb(A,2)];
957  return A;
958  }
959 
962  rmatrix A(*this);
963  for(int i=0 ; i<ColLen(A) ; i++)
964  A[i+Lb(A,1)] = (*this)[p[i+Lb(p)]+Lb(A,1)];
965  return A;
966  }
967 
970  intvector p = permvec(P);
971  return (*this)(p);
972  }
973 
975  INLINE rmatrix rmatrix::operator()(const intmatrix& P, const intmatrix& Q) {
976  intvector p = permvec(P);
977  intvector q = perminv(permvec(Q));
978  return (*this)(p,q);
979  }
980 
983  intvector p = permvec(P);
984  return (*this)(p);
985  }
986 
987 } // namespace cxsc
988 
989 #endif
990 
rmatrix_subv & operator=(const rmatrix_subv &rv)
Implementation of standard assigning operator.
Definition: rmatrix.inl:322
rmatrix & operator-=(const srmatrix &m)
Implementation of substraction and allocation operation.
Definition: srmatrix.hpp:1164
rmatrix_slice & operator/=(const real &c)
Implementation of division and allocation operation.
Definition: rmatrix.inl:422
The Data Type rmatrix_slice.
Definition: rmatrix.hpp:1442
cimatrix & operator/=(cimatrix &m, const cinterval &c)
Implementation of division and allocation operation.
Definition: cimatrix.inl:1623
The Data Type intmatrix.
Definition: intmatrix.hpp:313
rvector & operator=(const rvector &rv)
Implementation of standard assigning operator.
Definition: rvector.inl:254
rvector & operator()()
Operator for accessing the whole vector.
Definition: rvector.hpp:1027
int Lb(const cimatrix &rm, const int &i)
Returns the lower bound index.
Definition: cimatrix.inl:1156
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
rmatrix _rmatrix(const rmatrix &rm)
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC...
Definition: rmatrix.inl:574
cimatrix_subv Col(cimatrix &m, const int &i)
Returns one column of the matrix as a vector.
Definition: cimatrix.inl:242
cimatrix & SetLb(cimatrix &m, const int &i, const int &j)
Sets the lower bound index.
Definition: cimatrix.inl:1184
rmatrix & operator()()
Operator for accessing the whole matrix.
Definition: rmatrix.hpp:1416
rmatrix & operator+=(const srmatrix &m)
Implementation of addition and allocation operation.
Definition: srmatrix.hpp:1156
rmatrix_slice & operator*=(const srmatrix &m)
Implementation of multiplication and allocation operation.
Definition: srmatrix.hpp:1176
rmatrix_subv & operator/=(const real &c)
Implementation of division and allocation operation.
Definition: rmatrix.inl:430
The Data Type rvector_slice.
Definition: rvector.hpp:1063
cimatrix & SetUb(cimatrix &m, const int &i, const int &j)
Sets the upper bound index.
Definition: cimatrix.inl:1191
The Data Type rmatrix_subv.
Definition: rmatrix.hpp:53
The Data Type rvector.
Definition: rvector.hpp:57
rvector_slice & operator=(const rvector_slice &sl)
Implementation of standard assigning operator.
Definition: rvector.inl:258
rmatrix_subv operator[](const int &i) const
Operator for accessing a single row of the matrix.
Definition: rmatrix.inl:190
rvector_slice & operator*=(const real &r)
Implementation of multiplication and allocation operation.
Definition: rvector.inl:311
rmatrix_slice & operator+=(const srmatrix &m)
Implementation of multiplication and allocation operation.
Definition: srmatrix.hpp:1160
void Resize(cimatrix &A)
Resizes the matrix.
Definition: cimatrix.inl:1211
rmatrix_subv & operator-=(const real &c)
Implementation of subtraction and allocation operation.
Definition: rmatrix.inl:429
rmatrix_slice & operator-=(const srmatrix &m)
Implementation of multiplication and allocation operation.
Definition: srmatrix.hpp:1168
The Data Type rmatrix.
Definition: rmatrix.hpp:470
int ColLen(const cimatrix &)
Returns the column dimension.
Definition: cimatrix.inl:1202
rmatrix_subv & operator+=(const real &c)
Implementation of addition and allocation operation.
Definition: rmatrix.inl:428
rmatrix_slice & operator=(const srmatrix &m)
Implementation of standard assigning operator.
Definition: srmatrix.hpp:1151
rmatrix_subv & operator()()
Operator for accessing the whole vector.
Definition: rmatrix.hpp:337
real & operator[](const int &i) const
Operator for accessing the single elements of the vector (read-only)
Definition: rmatrix.inl:162
cimatrix_subv Row(cimatrix &m, const int &i)
Returns one row of the matrix as a vector.
Definition: cimatrix.inl:231
int RowLen(const cimatrix &)
Returns the row dimension.
Definition: cimatrix.inl:1199
rmatrix & operator*=(const srmatrix &m)
Implementation of multiplication and allocation operation.
Definition: srmatrix.hpp:1172
real(void)
Constructor of class real.
Definition: real.hpp:122
rmatrix_slice & operator()()
Operator for accessing the whole matrix.
Definition: rmatrix.hpp:2106
rmatrix_subv operator[](const int &i) const
Operator for accessing a single row of the matrix.
Definition: rmatrix.inl:242
rmatrix_subv & operator*=(const real &c)
Implementation of multiplication and allocation operation.
Definition: rmatrix.inl:427
rvector()
Constructor of class rvector.
Definition: rvector.inl:37
int Ub(const cimatrix &rm, const int &i)
Returns the upper bound index.
Definition: cimatrix.inl:1163
rmatrix()
Constructor of class rmatrix.
Definition: rmatrix.inl:33
rmatrix & operator=(const real &r)
Implementation of standard assigning operator.
Definition: rmatrix.inl:338
civector operator/(const cimatrix_subv &rv, const cinterval &s)
Implementation of division operation.
Definition: cimatrix.inl:730
The Scalar Type real.
Definition: real.hpp:113
The Data Type intvector.
Definition: intvector.hpp:51
ivector abs(const cimatrix_subv &mv)
Returns the absolute value of the matrix.
Definition: cimatrix.inl:737