C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: simatrix.hpp,v 1.20 2014/01/30 17:23:48 cxsc Exp $ */ 00025 00026 #ifndef _CXSC_SIMATRIX_HPP_INCLUDED 00027 #define _CXSC_SIMATRIX_HPP_INCLUDED 00028 00029 #include <interval.hpp> 00030 #include <imatrix.hpp> 00031 #include <ivector.hpp> 00032 #include <sivector.hpp> 00033 #include <vector> 00034 #include <algorithm> 00035 #include <iostream> 00036 #include <cidot.hpp> 00037 #include <sparseidot.hpp> 00038 #include <sparsematrix.hpp> 00039 #include <srmatrix.hpp> 00040 00041 namespace cxsc { 00042 00043 //definiert in srmatrix.hpp 00044 //enum STORAGE_TYPE{triplet,compressed_row,compressed_column}; 00045 00046 class simatrix_slice; 00047 class simatrix_subv; 00048 class scimatrix; 00049 class scimatrix_slice; 00050 class scimatrix_subv; 00051 00052 inline bool comp_pair_i(std::pair<int,interval> p1, std::pair<int,interval> p2) { 00053 return p1.first < p2.first; 00054 } 00055 00057 00069 class simatrix { 00070 00071 private: 00072 std::vector<int> p; 00073 std::vector<int> ind; 00074 std::vector<interval> x; 00075 int m; 00076 int n; 00077 int lb1,ub1,lb2,ub2; 00078 00079 public: 00080 00082 std::vector<int>& column_pointers() { 00083 return p; 00084 } 00085 00087 std::vector<int>& row_indices() { 00088 return ind; 00089 } 00090 00092 std::vector<interval>& values() { 00093 return x; 00094 } 00095 00097 const std::vector<int>& column_pointers() const { 00098 return p; 00099 } 00100 00102 const std::vector<int>& row_indices() const { 00103 return ind; 00104 } 00105 00107 const std::vector<interval>& values() const { 00108 return x; 00109 } 00110 00112 simatrix() { 00113 p.push_back(0); 00114 m = n = 0; 00115 lb1 = lb2 = ub1 = ub2 = 0; 00116 } 00117 00119 simatrix(const int r, const int c) : m(r),n(c),lb1(1),ub1(r),lb2(1),ub2(c) { 00120 p = std::vector<int>((n>0) ? n+1 : 1, 0); 00121 ind.reserve(2*(m+n)); 00122 x.reserve(2*(m+n)); 00123 00124 p[0] = 0; 00125 } 00126 00128 simatrix(const int r, const int c, const int e) : m(r),n(c),lb1(1),ub1(r),lb2(1),ub2(c) { 00129 p = std::vector<int>((n>0) ? n+1 : 1, 0); 00130 ind.reserve(e); 00131 x.reserve(e); 00132 00133 p[0] = 0; 00134 } 00135 00137 00143 simatrix(const int m, const int n, const int nnz, const intvector& rows, const intvector& cols, const ivector& values, const enum STORAGE_TYPE t = triplet) { 00144 if(t == triplet) { 00145 this->m = m; 00146 this->n = n; 00147 p = std::vector<int>(n+1,0); 00148 ind.reserve(nnz); 00149 x.reserve(nnz); 00150 lb1 = lb2 = 1; 00151 ub1 = m; ub2 = n; 00152 00153 std::vector<triplet_store<interval> > work; 00154 work.reserve(nnz); 00155 00156 for(int k=0 ; k<nnz ; k++) { 00157 work.push_back(triplet_store<interval>(rows[Lb(rows)+k],cols[Lb(cols)+k],values[Lb(values)+k])); 00158 } 00159 00160 sort(work.begin(), work.end()); 00161 00162 int i=0; 00163 00164 for(int j=0 ; j<n ; j++) { 00165 00166 while((unsigned int)i < work.size() && work[i].col == j ) { 00167 ind.push_back(work[i].row); 00168 x.push_back(work[i].val); 00169 i++; 00170 } 00171 00172 p[j+1] = i; 00173 } 00174 00175 } else if(t == compressed_row) { 00176 00177 this->m = m; 00178 this->n = n; 00179 p = std::vector<int>(n+1,0); 00180 ind.reserve(nnz); 00181 x.reserve(nnz); 00182 lb1 = lb2 = 1; 00183 ub1 = m; ub2 = n; 00184 00185 for(int i=0 ; i<n+1 ; i++) 00186 p[i] = rows[Lb(rows)+i]; 00187 00188 std::vector<triplet_store<interval> > work; 00189 work.reserve(nnz); 00190 00191 for(int j=0 ; j<n ; j++) { 00192 for(int k=p[j] ; k<p[j+1] ; k++) { 00193 work.push_back(triplet_store<interval>(j,cols[Lb(cols)+k],values[Lb(values)+k])); 00194 } 00195 } 00196 00197 sort(work.begin(), work.end()); 00198 00199 int i=0; 00200 00201 for(int j=0 ; j<n ; j++) { 00202 00203 while((unsigned int)i < work.size() && work[i].col == j ) { 00204 ind.push_back(work[i].row); 00205 x.push_back(work[i].val); 00206 i++; 00207 } 00208 00209 p[j+1] = i; 00210 } 00211 00212 } else if(t == compressed_column) { 00213 this->m = m; 00214 this->n = n; 00215 p = std::vector<int>(n+1,0); 00216 ind.reserve(nnz); 00217 x.reserve(nnz); 00218 lb1 = lb2 = 1; 00219 ub1 = m; ub2 = n; 00220 00221 for(int i=0 ; i<n+1 ; i++) 00222 p[i] = rows[Lb(rows)+i]; 00223 00224 std::vector<std::pair<int,interval> > work; 00225 work.reserve(n); 00226 00227 for(int j=0 ; j<n ; j++) { 00228 work.clear(); 00229 00230 for(int k=p[j] ; k<p[j+1] ; k++) { 00231 work.push_back(std::make_pair(cols[Lb(cols)+k],values[Lb(values)+k])); 00232 } 00233 00234 std::sort(work.begin(),work.end(),comp_pair_i); 00235 00236 for(unsigned int i=0 ; i<work.size() ; i++) { 00237 ind.push_back(work[i].first); 00238 x.push_back(work[i].second); 00239 } 00240 } 00241 00242 } 00243 00244 } 00245 00247 00254 simatrix(const int m, const int n, const int nnz, const int* rows, const int* cols, const interval* values, const enum STORAGE_TYPE t = triplet) { 00255 if(t == triplet) { 00256 this->m = m; 00257 this->n = n; 00258 p = std::vector<int>(n+1,0); 00259 ind.reserve(nnz); 00260 x.reserve(nnz); 00261 lb1 = lb2 = 1; 00262 ub1 = m; ub2 = n; 00263 00264 std::vector<triplet_store<interval> > work; 00265 work.reserve(nnz); 00266 00267 for(int k=0 ; k<nnz ; k++) { 00268 work.push_back(triplet_store<interval>(rows[k],cols[k],values[k])); 00269 } 00270 00271 sort(work.begin(), work.end()); 00272 00273 int i=0; 00274 00275 for(int j=0 ; j<n ; j++) { 00276 00277 while((unsigned int)i < work.size() && work[i].col == j ) { 00278 ind.push_back(work[i].row); 00279 x.push_back(work[i].val); 00280 i++; 00281 } 00282 00283 p[j+1] = i; 00284 } 00285 00286 } else if(t == compressed_row) { 00287 00288 this->m = m; 00289 this->n = n; 00290 p = std::vector<int>(n+1,0); 00291 ind.reserve(nnz); 00292 x.reserve(nnz); 00293 lb1 = lb2 = 1; 00294 ub1 = m; ub2 = n; 00295 00296 for(int i=0 ; i<n+1 ; i++) 00297 p[i] = rows[i]; 00298 00299 std::vector<triplet_store<interval> > work; 00300 work.reserve(nnz); 00301 00302 for(int j=0 ; j<n ; j++) { 00303 for(int k=p[j] ; k<p[j+1] ; k++) { 00304 work.push_back(triplet_store<interval>(j,cols[k],values[k])); 00305 } 00306 } 00307 00308 sort(work.begin(), work.end()); 00309 00310 int i=0; 00311 00312 for(int j=0 ; j<n ; j++) { 00313 00314 while((unsigned int)i < work.size() && work[i].col == j ) { 00315 ind.push_back(work[i].row); 00316 x.push_back(work[i].val); 00317 i++; 00318 } 00319 00320 p[j+1] = i; 00321 } 00322 00323 } else if(t == compressed_column) { 00324 this->m = m; 00325 this->n = n; 00326 p = std::vector<int>(n+1,0); 00327 ind.reserve(nnz); 00328 x.reserve(nnz); 00329 lb1 = lb2 = 1; 00330 ub1 = m; ub2 = n; 00331 00332 for(int i=0 ; i<n+1 ; i++) 00333 p[i] = rows[i]; 00334 00335 std::vector<std::pair<int,interval> > work; 00336 work.reserve(n); 00337 00338 for(int j=0 ; j<n ; j++) { 00339 work.clear(); 00340 00341 for(int k=p[j] ; k<p[j+1] ; k++) { 00342 work.push_back(std::make_pair(cols[k],values[k])); 00343 } 00344 00345 std::sort(work.begin(),work.end(),comp_pair_i); 00346 00347 for(unsigned int i=0 ; i<work.size() ; i++) { 00348 ind.push_back(work[i].first); 00349 x.push_back(work[i].second); 00350 } 00351 } 00352 00353 } 00354 00355 } 00356 00357 00359 simatrix(const srmatrix& A) : p(A.p), ind(A.ind), m(A.m), n(A.n), lb1(A.lb1), ub1(A.ub1), lb2(A.lb2), ub2(A.ub2) { 00360 x.reserve(A.get_nnz()); 00361 for(unsigned int i=0 ; i<A.x.size() ; i++) 00362 x.push_back(interval(A.x[i])); 00363 } 00364 00365 00367 simatrix(const rmatrix& A) : m(ColLen(A)),n(RowLen(A)),lb1(Lb(A,1)),ub1(Ub(A,1)),lb2(Lb(A,2)),ub2(Ub(A,2)) { 00368 p = std::vector<int>((n>0) ? n+1 : 1, 0); 00369 ind.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m); 00370 x.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m); 00371 00372 p[0] = 0; 00373 int nnz = 0; 00374 00375 for(int j=0 ; j<n ; j++) { 00376 for(int i=0 ; i<m ; i++) { 00377 if(A[i+lb1][j+lb2] != 0.0) { 00378 ind.push_back(i); 00379 x.push_back(interval(A[i+lb1][j+lb2])); 00380 nnz++; 00381 } 00382 } 00383 00384 p[j+1] = nnz; 00385 } 00386 00387 } 00388 00390 simatrix(const imatrix& A) : m(ColLen(A)),n(RowLen(A)),lb1(Lb(A,1)),ub1(Ub(A,1)),lb2(Lb(A,2)),ub2(Ub(A,2)) { 00391 p = std::vector<int>((n>0) ? n+1 : 1, 0); 00392 ind.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m); 00393 x.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m); 00394 00395 p[0] = 0; 00396 int nnz = 0; 00397 00398 for(int j=0 ; j<n ; j++) { 00399 for(int i=0 ; i<m ; i++) { 00400 if(A[i+lb1][j+lb2] != 0.0) { 00401 ind.push_back(i); 00402 x.push_back(interval(A[i+lb1][j+lb2])); 00403 nnz++; 00404 } 00405 } 00406 00407 p[j+1] = nnz; 00408 } 00409 00410 } 00411 00413 00416 simatrix(const int ms, const int ns, const imatrix& A) : m(ms), n(ns), lb1(1), ub1(ms), lb2(1), ub2(ns) { 00417 //Banded matrix constructor 00418 int nnz = RowLen(A)*ColLen(A); 00419 p = std::vector<int>((n>0) ? n+1 : 1, 0); 00420 ind.reserve(nnz); 00421 x.reserve(nnz); 00422 00423 std::vector<triplet_store<interval> > work; 00424 work.reserve(nnz); 00425 00426 00427 for(int i=0 ; i<ColLen(A) ; i++) { 00428 for(int j=Lb(A,2) ; j<=Ub(A,2) ; j++) { 00429 if(i+j >=0 && i+j < n) { 00430 work.push_back(triplet_store<interval>(i,i+j,A[i+Lb(A,1)][j])); 00431 } 00432 } 00433 } 00434 00435 sort(work.begin(), work.end()); 00436 00437 int i=0; 00438 00439 for(int j=0 ; j<n ; j++) { 00440 00441 while((unsigned int)i < work.size() && work[i].col == j ) { 00442 ind.push_back(work[i].row); 00443 x.push_back(work[i].val); 00444 i++; 00445 } 00446 00447 p[j+1] = i; 00448 } 00449 00450 } 00451 00453 simatrix(const srmatrix_slice&); 00455 simatrix(const simatrix_slice&); 00456 00458 void full(imatrix& A) const { 00459 A = imatrix(lb1,ub1,lb2,ub2); 00460 A = 0.0; 00461 for(int j=0 ; j<n ; j++) { 00462 for(int k=p[j] ; k<p[j+1] ; k++) { 00463 A[ind[k]+lb1][j+lb2] = x[k]; 00464 } 00465 } 00466 } 00467 00469 00473 void dropzeros() { 00474 std::vector<int> pnew(n+1,0); 00475 std::vector<int> indnew; 00476 std::vector<interval> xnew; 00477 int nnznew = 0; 00478 00479 for(int j=0 ; j<n ; j++) { 00480 for(int k=p[j] ; k<p[j+1] ; k++) { 00481 if(x[k] != 0.0) { 00482 xnew.push_back(x[k]); 00483 indnew.push_back(ind[k]); 00484 nnznew++; 00485 } 00486 } 00487 pnew[j+1] = nnznew; 00488 } 00489 00490 p = pnew; 00491 ind = indnew; 00492 x = xnew; 00493 } 00494 00495 00497 simatrix& operator=(const real& A) { 00498 return sp_ms_assign<simatrix,real,interval>(*this,A); 00499 } 00500 00502 simatrix& operator=(const interval& A) { 00503 return sp_ms_assign<simatrix,interval,interval>(*this,A); 00504 } 00505 00507 simatrix& operator=(const rmatrix& A) { 00508 return spf_mm_assign<simatrix,rmatrix,interval>(*this,A); 00509 } 00510 00512 simatrix& operator=(const imatrix& A) { 00513 return spf_mm_assign<simatrix,imatrix,interval>(*this,A); 00514 } 00515 00517 simatrix& operator=(const rmatrix_slice& A) { 00518 return spf_mm_assign<simatrix,rmatrix_slice,interval>(*this,A); 00519 } 00520 00522 simatrix& operator=(const imatrix_slice& A) { 00523 return spf_mm_assign<simatrix,imatrix_slice,interval>(*this,A); 00524 } 00525 00527 simatrix& operator=(const srmatrix& A) { 00528 m = A.m; 00529 n = A.n; 00530 p = A.p; 00531 ind = A.ind; 00532 x.clear(); 00533 x.reserve(A.get_nnz()); 00534 for(unsigned int i=0 ; i<A.x.size() ; i++) 00535 x.push_back(interval(A.x[i])); 00536 return *this; 00537 } 00538 00539 /* simatrix& operator=(const simatrix& A) { 00540 p = A.p; 00541 ind = A.ind; 00542 x = A.x; 00543 return *this; 00544 } */ 00545 00547 simatrix& operator=(const srmatrix_slice&); 00549 simatrix& operator=(const simatrix_slice&); 00550 00552 00558 const interval operator()(int i, int j) const { 00559 #if(CXSC_INDEX_CHECK) 00560 if(i<lb1 || i>ub1 || j<lb2 || j>ub2) 00561 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int)")); 00562 #endif 00563 interval r(0.0); 00564 for(int k=p[j-lb2] ; k<p[j-lb2+1] && ind[k]<=i-lb1 ; k++) { 00565 if(ind[k] == i-lb1) r = x[k]; 00566 } 00567 return r; 00568 } 00569 00571 00579 interval& element(int i, int j) { 00580 #if(CXSC_INDEX_CHECK) 00581 if(i<lb1 || i>ub1 || j<lb2 || j>ub2) 00582 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int)")); 00583 #endif 00584 int k; 00585 for(k=p[j-lb2] ; k<p[j-lb2+1] && ind[k]<=i-lb1 ; k++) { 00586 if(ind[k] == i-lb1) return x[k]; 00587 } 00588 00589 //Nicht gefunden, Element muss angelegt werden, da Schreibzugriff moeglich 00590 std::vector<int>::iterator ind_it = ind.begin() + k; 00591 std::vector<interval>::iterator x_it = x.begin() + k; 00592 ind.insert(ind_it, i-lb1); 00593 x_it = x.insert(x_it, interval(0.0)); 00594 for(k=j-lb2+1 ; k<(int)p.size() ; k++) 00595 p[k]++; 00596 00597 return *x_it; 00598 } 00599 00601 simatrix_subv operator[](const cxscmatrix_column&); 00603 simatrix_subv operator[](const int); 00605 const simatrix_subv operator[](const cxscmatrix_column&) const; 00607 const simatrix_subv operator[](const int) const; 00608 00610 simatrix_slice operator()(const int, const int , const int, const int); 00612 const simatrix_slice operator()(const int, const int , const int, const int) const; 00613 00615 simatrix operator()(const intvector& pervec, const intvector& q) { 00616 simatrix A(m,n,get_nnz()); 00617 intvector per = perminv(pervec); 00618 00619 int nnz=0; 00620 for(int k=0 ; k<n ; k++) { 00621 A.p[k] = nnz; 00622 00623 std::map<int,interval> work; 00624 for(int j=p[q[Lb(q)+k]] ; j<p[q[Lb(q)+k]+1] ; j++) 00625 work.insert(std::make_pair(per[Lb(per)+ind[j]], x[j])); 00626 00627 for(std::map<int,interval>::iterator it = work.begin() ; it != work.end() ; it++) { 00628 A.ind.push_back(it->first); 00629 A.x.push_back(it->second); 00630 } 00631 00632 nnz += work.size(); 00633 00634 } 00635 00636 A.p[n] = nnz; 00637 00638 return A; 00639 } 00640 00642 simatrix operator()(const intvector& pervec) { 00643 simatrix A(m,n,get_nnz()); 00644 intvector per = perminv(pervec); 00645 00646 for(int k=0 ; k<n ; k++) { 00647 A.p[k] = p[k]; 00648 00649 std::map<int,interval> work; 00650 for(int j=p[k] ; j<p[k+1] ; j++) 00651 work.insert(std::make_pair(per[Lb(per)+ind[j]], x[j])); 00652 00653 for(std::map<int,interval>::iterator it = work.begin() ; it != work.end() ; it++) { 00654 A.ind.push_back(it->first); 00655 A.x.push_back(it->second); 00656 } 00657 00658 } 00659 00660 A.p[n] = p[n]; 00661 00662 return A; 00663 } 00664 00666 simatrix operator()(const intmatrix& P, const intmatrix& Q) { 00667 intvector p = permvec(P); 00668 intvector q = perminv(permvec(Q)); 00669 return (*this)(p,q); 00670 } 00671 00673 simatrix operator()(const intmatrix& P) { 00674 intvector p = permvec(P); 00675 return (*this)(p); 00676 } 00677 00679 real density() const { 00680 return p[n]/((double)m*n); 00681 } 00682 00684 int get_nnz() const { 00685 return p[n]; 00686 } 00687 00689 simatrix& operator+=(const rmatrix& B) { 00690 return spf_mm_addassign<simatrix,rmatrix,imatrix>(*this,B); 00691 } 00692 00694 simatrix& operator+=(const imatrix& B) { 00695 return spf_mm_addassign<simatrix,imatrix,imatrix>(*this,B); 00696 } 00697 00699 simatrix& operator+=(const rmatrix_slice& B) { 00700 return spf_mm_addassign<simatrix,rmatrix_slice,imatrix>(*this,B); 00701 } 00702 00704 simatrix& operator+=(const imatrix_slice& B) { 00705 return spf_mm_addassign<simatrix,imatrix_slice,imatrix>(*this,B); 00706 } 00707 00709 simatrix& operator+=(const srmatrix& B) { 00710 return spsp_mm_addassign<simatrix,srmatrix,interval>(*this,B); 00711 } 00712 00714 simatrix& operator+=(const simatrix& B) { 00715 return spsp_mm_addassign<simatrix,simatrix,interval>(*this,B); 00716 } 00717 00719 simatrix& operator-=(const rmatrix& B) { 00720 return spf_mm_subassign<simatrix,rmatrix,imatrix>(*this,B); 00721 } 00722 00724 simatrix& operator-=(const imatrix& B) { 00725 return spf_mm_subassign<simatrix,imatrix,imatrix>(*this,B); 00726 } 00727 00729 simatrix& operator-=(const rmatrix_slice& B) { 00730 return spf_mm_subassign<simatrix,rmatrix_slice,imatrix>(*this,B); 00731 } 00732 00734 simatrix& operator-=(const imatrix_slice& B) { 00735 return spf_mm_subassign<simatrix,imatrix_slice,imatrix>(*this,B); 00736 } 00737 00739 simatrix& operator-=(const srmatrix& B) { 00740 return spsp_mm_subassign<simatrix,srmatrix,interval>(*this,B); 00741 } 00742 00744 simatrix& operator-=(const simatrix& B) { 00745 return spsp_mm_subassign<simatrix,simatrix,interval>(*this,B); 00746 } 00747 00749 simatrix& operator*=(const imatrix& B) { 00750 return spf_mm_multassign<simatrix,imatrix,sparse_idot,imatrix>(*this,B); 00751 } 00752 00754 simatrix& operator*=(const rmatrix& B) { 00755 return spf_mm_multassign<simatrix,rmatrix,sparse_idot,imatrix>(*this,B); 00756 } 00757 00759 simatrix& operator*=(const rmatrix_slice& B) { 00760 return spf_mm_multassign<simatrix,rmatrix_slice,sparse_idot,imatrix>(*this,B); 00761 } 00762 00764 simatrix& operator*=(const imatrix_slice& B) { 00765 return spf_mm_multassign<simatrix,imatrix_slice,sparse_idot,imatrix>(*this,B); 00766 } 00767 00769 simatrix& operator*=(const srmatrix& B) { 00770 return spsp_mm_multassign<simatrix,srmatrix,sparse_idot,interval>(*this,B); 00771 } 00772 00774 simatrix& operator*=(const simatrix& B) { 00775 return spsp_mm_multassign<simatrix,simatrix,sparse_idot,interval>(*this,B); 00776 } 00777 00779 simatrix& operator*=(const real& r) { 00780 return sp_ms_multassign(*this,r); 00781 } 00782 00784 simatrix& operator*=(const interval& r) { 00785 return sp_ms_multassign(*this,r); 00786 } 00787 00789 simatrix& operator/=(const real& r) { 00790 return sp_ms_divassign(*this,r); 00791 } 00792 00794 simatrix& operator/=(const interval& r) { 00795 return sp_ms_divassign(*this,r); 00796 } 00797 00799 simatrix& operator|=(const rmatrix& B) { 00800 return spf_mm_hullassign<simatrix,rmatrix,imatrix>(*this,B); 00801 } 00802 00804 simatrix& operator|=(const imatrix& B) { 00805 return spf_mm_hullassign<simatrix,imatrix,imatrix>(*this,B); 00806 } 00807 00809 simatrix& operator|=(const rmatrix_slice& B) { 00810 return spf_mm_hullassign<simatrix,rmatrix_slice,imatrix>(*this,B); 00811 } 00812 00814 simatrix& operator|=(const imatrix_slice& B) { 00815 return spf_mm_hullassign<simatrix,imatrix_slice,imatrix>(*this,B); 00816 } 00817 00819 simatrix& operator|=(const srmatrix& B) { 00820 return spsp_mm_hullassign<simatrix,srmatrix,interval>(*this,B); 00821 } 00822 00824 simatrix& operator|=(const simatrix& B) { 00825 return spsp_mm_hullassign<simatrix,simatrix,interval>(*this,B); 00826 } 00827 00829 simatrix& operator&=(const imatrix& B) { 00830 return spf_mm_intersectassign<simatrix,imatrix,imatrix>(*this,B); 00831 } 00832 00834 simatrix& operator&=(const imatrix_slice& B) { 00835 return spf_mm_intersectassign<simatrix,imatrix_slice,imatrix>(*this,B); 00836 } 00837 00839 simatrix& operator&=(const simatrix& B) { 00840 return spsp_mm_intersectassign<simatrix,simatrix,interval>(*this,B); 00841 } 00842 00843 friend void SetLb(simatrix&, const int, const int); 00844 friend void SetUb(simatrix&, const int, const int); 00845 friend int Lb(const simatrix&, int); 00846 friend int Ub(const simatrix&, int); 00847 friend int RowLen(const simatrix&); 00848 friend int ColLen(const simatrix&); 00849 friend srmatrix Inf(const simatrix&); 00850 friend srmatrix Sup(const simatrix&); 00851 friend simatrix Re(const scimatrix&); 00852 friend simatrix Im(const scimatrix&); 00853 friend simatrix abs(const simatrix&); 00854 friend srmatrix mid(const simatrix&); 00855 friend srmatrix diam(const simatrix&); 00856 friend simatrix abs(const scimatrix&); 00857 friend srmatrix absmin(const simatrix&); 00858 friend srmatrix absmax(const simatrix&); 00859 00860 friend simatrix transp(const simatrix&); 00861 friend simatrix Id(const simatrix&); 00862 friend srmatrix CompMat(const simatrix&); 00863 00864 friend std::istream& operator>>(std::istream&, simatrix_slice&); 00865 friend std::istream& operator>>(std::istream&, simatrix_subv&); 00866 00867 friend class srmatrix_slice; 00868 friend class srmatrix_subv; 00869 friend class srvector; 00870 friend class simatrix_slice; 00871 friend class simatrix_subv; 00872 friend class sivector; 00873 friend class scimatrix; 00874 friend class scimatrix_slice; 00875 friend class scimatrix_subv; 00876 friend class scivector; 00877 friend class rmatrix; 00878 friend class imatrix; 00879 friend class cimatrix; 00880 00881 #include "matrix_friend_declarations.inl" 00882 }; 00883 00884 inline imatrix::imatrix(const srmatrix& A) { 00885 dat = new interval[A.m*A.n]; 00886 lb1 = A.lb1; lb2 = A.lb2; ub1 = A.ub1; ub2 = A.ub2; 00887 xsize = A.n; 00888 ysize = A.m; 00889 *this = 0.0; 00890 for(int j=0 ; j<A.n ; j++) { 00891 for(int k=A.p[j] ; k<A.p[j+1] ; k++) { 00892 dat[A.ind[k]*A.n+j] = A.x[k]; 00893 } 00894 } 00895 } 00896 00897 inline imatrix::imatrix(const simatrix& A) { 00898 dat = new interval[A.m*A.n]; 00899 lb1 = A.lb1; lb2 = A.lb2; ub1 = A.ub1; ub2 = A.ub2; 00900 xsize = A.n; 00901 ysize = A.m; 00902 *this = 0.0; 00903 for(int j=0 ; j<A.n ; j++) { 00904 for(int k=A.p[j] ; k<A.p[j+1] ; k++) { 00905 dat[A.ind[k]*A.n+j] = A.x[k]; 00906 } 00907 } 00908 } 00909 00911 inline simatrix Id(const simatrix& A) { 00912 simatrix I(A.m, A.n, (A.m>A.n) ? A.m : A.n); 00913 I.lb1 = A.lb1; I.lb2 = A.lb2; 00914 I.ub1 = A.ub1; I.ub2 = A.ub2; 00915 00916 if(A.m < A.n) { 00917 for(int i=0 ; i<A.m ; i++) { 00918 I.p[i+1] = I.p[i] + 1; 00919 I.ind.push_back(i); 00920 I.x.push_back(interval(1.0)); 00921 } 00922 } else { 00923 for(int i=0 ; i<A.n ; i++) { 00924 I.p[i+1] = I.p[i] + 1; 00925 I.ind.push_back(i); 00926 I.x.push_back(interval(1.0)); 00927 } 00928 } 00929 00930 return I; 00931 } 00932 00934 inline simatrix transp(const simatrix& A) { 00935 simatrix B(A.n, A.m, A.get_nnz()); 00936 00937 //NIchtnullen pro Zeile bestimmen 00938 std::vector<int> w(A.m,0); 00939 for(unsigned int i=0 ; i<A.ind.size() ; i++) 00940 w[A.ind[i]]++; 00941 00942 //Spalten"pointer" setzen 00943 B.p.resize(A.m+1); 00944 B.p[0] = 0; 00945 for(unsigned int i=1 ; i<B.p.size() ; i++) 00946 B.p[i] = w[i-1] + B.p[i-1]; 00947 00948 //w vorbereiten 00949 w.insert(w.begin(), 0); 00950 for(unsigned int i=1 ; i<w.size() ; i++) { 00951 w[i] += w[i-1]; 00952 } 00953 00954 //neuer zeilenindex und wert wird gesetzt 00955 int q; 00956 B.ind.resize(A.get_nnz()); 00957 B.x.resize(A.get_nnz()); 00958 for(int j=0 ; j<A.n ; j++) { 00959 for(int k=A.p[j] ; k<A.p[j+1] ; k++) { 00960 q = w[A.ind[k]]++; 00961 B.ind[q] = j; 00962 B.x[q] = A.x[k]; 00963 } 00964 } 00965 00966 return B; 00967 } 00968 00970 00974 inline void SetLb(simatrix& A, const int i, const int j) { 00975 if(i==1) { 00976 A.lb1 = j; 00977 A.ub1 = j + A.m - 1; 00978 } else if(i==2) { 00979 A.lb2 = j; 00980 A.ub2 = j + A.n - 1; 00981 } 00982 } 00983 00985 00989 inline void SetUb(simatrix& A, const int i, const int j) { 00990 if(i==1) { 00991 A.ub1 = j; 00992 A.lb1 = j - A.m + 1; 00993 } else if(i==2) { 00994 A.ub2 = j; 00995 A.lb2 = j - A.n + 1; 00996 } 00997 } 00998 01000 01003 inline int Lb(const simatrix& A, int i) { 01004 if(i==1) 01005 return A.lb1; 01006 else if(i==2) 01007 return A.lb2; 01008 else 01009 return 1; 01010 } 01011 01013 01016 inline int Ub(const simatrix& A, int i) { 01017 if(i==1) 01018 return A.ub1; 01019 else if(i==2) 01020 return A.ub2; 01021 else 01022 return 1; 01023 } 01024 01026 inline int RowLen(const simatrix& A) { 01027 return A.n; 01028 } 01029 01031 inline int ColLen(const simatrix& A) { 01032 return A.m; 01033 } 01034 01036 inline void Resize(simatrix& A) { 01037 sp_m_resize(A); 01038 } 01039 01041 inline void Resize(simatrix& A, const int m, const int n) { 01042 sp_m_resize(A,m,n); 01043 } 01044 01046 inline void Resize(simatrix& A, const int l1, const int u1, const int l2, const int u2) { 01047 sp_m_resize(A,l1,u1,l2,u2); 01048 } 01049 01051 inline srmatrix Inf(const simatrix& A) { 01052 srmatrix res(A.m,A.n,A.get_nnz()); 01053 res.lb1 = A.lb1; 01054 res.lb2 = A.lb2; 01055 res.ub1 = A.ub1; 01056 res.ub2 = A.ub2; 01057 res.p = A.p; 01058 res.ind = A.ind; 01059 01060 for(int i=0 ; i<res.get_nnz() ; i++) 01061 res.x.push_back(Inf(A.x[i])); 01062 01063 res.dropzeros(); 01064 01065 return res; 01066 } 01067 01069 inline srmatrix Sup(const simatrix& A) { 01070 srmatrix res(A.m,A.n,A.get_nnz()); 01071 res.lb1 = A.lb1; 01072 res.lb2 = A.lb2; 01073 res.ub1 = A.ub1; 01074 res.ub2 = A.ub2; 01075 res.p = A.p; 01076 res.ind = A.ind; 01077 01078 for(int i=0 ; i<res.get_nnz() ; i++) 01079 res.x.push_back(Sup(A.x[i])); 01080 01081 res.dropzeros(); 01082 01083 return res; 01084 } 01085 01087 inline simatrix abs(const simatrix& A) { 01088 simatrix res(A.m,A.n,A.get_nnz()); 01089 res.lb1 = A.lb1; 01090 res.lb2 = A.lb2; 01091 res.ub1 = A.ub1; 01092 res.ub2 = A.ub2; 01093 res.p = A.p; 01094 res.ind = A.ind; 01095 01096 for(int i=0 ; i<res.get_nnz() ; i++) 01097 res.x.push_back(abs(A.x[i])); 01098 01099 res.dropzeros(); 01100 01101 return res; 01102 } 01103 01105 inline srmatrix absmin(const simatrix& A) { 01106 srmatrix res(A.m,A.n,A.get_nnz()); 01107 res.lb1 = A.lb1; 01108 res.lb2 = A.lb2; 01109 res.ub1 = A.ub1; 01110 res.ub2 = A.ub2; 01111 res.p = A.p; 01112 res.ind = A.ind; 01113 01114 for(int i=0 ; i<res.get_nnz() ; i++) 01115 res.x.push_back(AbsMin(A.x[i])); 01116 01117 res.dropzeros(); 01118 01119 return res; 01120 } 01121 01123 inline srmatrix absmax(const simatrix& A) { 01124 srmatrix res(A.m,A.n,A.get_nnz()); 01125 res.lb1 = A.lb1; 01126 res.lb2 = A.lb2; 01127 res.ub1 = A.ub1; 01128 res.ub2 = A.ub2; 01129 res.p = A.p; 01130 res.ind = A.ind; 01131 01132 for(int i=0 ; i<res.get_nnz() ; i++) 01133 res.x.push_back(AbsMax(A.x[i])); 01134 01135 res.dropzeros(); 01136 01137 return res; 01138 } 01139 01141 inline srmatrix CompMat(const simatrix& A) { 01142 srmatrix res(A.m,A.n,A.get_nnz()); 01143 res.lb1 = A.lb1; 01144 res.lb2 = A.lb2; 01145 res.ub1 = A.ub1; 01146 res.ub2 = A.ub2; 01147 res.p = A.p; 01148 res.ind = A.ind; 01149 res.p[A.n] = A.p[A.n]; 01150 01151 for(int j=0 ; j<res.n ; j++) { 01152 for(int k=A.p[j] ; k<A.p[j+1] ; k++) { 01153 if(A.ind[k] == j) 01154 res.x.push_back(AbsMin(A.x[k])); 01155 else 01156 res.x.push_back(-AbsMax(A.x[k])); 01157 } 01158 } 01159 01160 res.dropzeros(); 01161 01162 return res; 01163 } 01164 01166 inline srmatrix mid(const simatrix& A) { 01167 srmatrix res(A.m,A.n,A.get_nnz()); 01168 res.lb1 = A.lb1; 01169 res.lb2 = A.lb2; 01170 res.ub1 = A.ub1; 01171 res.ub2 = A.ub2; 01172 res.p = A.p; 01173 res.ind = A.ind; 01174 01175 for(int i=0 ; i<res.get_nnz() ; i++) 01176 res.x.push_back(mid(A.x[i])); 01177 01178 res.dropzeros(); 01179 01180 return res; 01181 } 01182 01184 inline srmatrix diam(const simatrix& A) { 01185 srmatrix res(A.m,A.n,A.get_nnz()); 01186 res.lb1 = A.lb1; 01187 res.lb2 = A.lb2; 01188 res.ub1 = A.ub1; 01189 res.ub2 = A.ub2; 01190 res.p = A.p; 01191 res.ind = A.ind; 01192 01193 for(int i=0 ; i<res.get_nnz() ; i++) 01194 res.x.push_back(diam(A.x[i])); 01195 01196 res.dropzeros(); 01197 01198 return res; 01199 } 01200 01201 01203 01209 inline imatrix operator*(const imatrix& A, const srmatrix& B) { 01210 return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(A,B); 01211 } 01212 01214 01220 inline imatrix operator*(const rmatrix& A, const simatrix& B) { 01221 return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(A,B); 01222 } 01223 01225 01231 inline imatrix operator*(const imatrix& A, const simatrix& B) { 01232 return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(A,B); 01233 } 01234 01236 01242 inline imatrix operator*(const simatrix& A, const rmatrix& B) { 01243 return spf_mm_mult<simatrix,rmatrix,imatrix,sparse_idot>(A,B); 01244 } 01245 01247 01253 inline imatrix operator*(const srmatrix& A, const imatrix& B) { 01254 return spf_mm_mult<srmatrix,imatrix,imatrix,sparse_idot>(A,B); 01255 } 01256 01258 01264 inline imatrix operator*(const simatrix& A, const imatrix& B) { 01265 return spf_mm_mult<simatrix,imatrix,imatrix,sparse_idot>(A,B); 01266 } 01267 01269 01275 inline imatrix operator*(const imatrix_slice& A, const srmatrix& B) { 01276 return fsp_mm_mult<imatrix_slice,srmatrix,imatrix,sparse_idot>(A,B); 01277 } 01278 01280 01286 inline imatrix operator*(const rmatrix_slice& A, const simatrix& B) { 01287 return fsp_mm_mult<rmatrix_slice,simatrix,imatrix,sparse_idot>(A,B); 01288 } 01289 01291 01297 inline imatrix operator*(const imatrix_slice& A, const simatrix& B) { 01298 return fsp_mm_mult<imatrix_slice,simatrix,imatrix,sparse_idot>(A,B); 01299 } 01300 01302 01308 inline imatrix operator*(const simatrix& A, const rmatrix_slice& B) { 01309 return spf_mm_mult<simatrix,rmatrix_slice,imatrix,sparse_idot>(A,B); 01310 } 01311 01313 01319 inline imatrix operator*(const srmatrix& A, const imatrix_slice& B) { 01320 return spf_mm_mult<srmatrix,imatrix_slice,imatrix,sparse_idot>(A,B); 01321 } 01322 01324 01330 inline imatrix operator*(const simatrix& A, const imatrix_slice& B) { 01331 return spf_mm_mult<simatrix,imatrix_slice,imatrix,sparse_idot>(A,B); 01332 } 01333 01335 01341 inline simatrix operator*(const simatrix& A, const srmatrix& B) { 01342 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(A,B); 01343 } 01344 01346 01352 inline simatrix operator*(const srmatrix& A, const simatrix& B) { 01353 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(A,B); 01354 } 01355 01357 01363 inline simatrix operator*(const simatrix& A, const simatrix& B) { 01364 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(A,B); 01365 } 01366 01368 inline simatrix operator/(const simatrix& A, const real& r) { 01369 return sp_ms_div<simatrix,real,simatrix>(A,r); 01370 } 01371 01373 inline simatrix operator/(const simatrix& A, const interval& r) { 01374 return sp_ms_div<simatrix,interval,simatrix>(A,r); 01375 } 01376 01378 inline simatrix operator/(const srmatrix& A, const interval& r) { 01379 return sp_ms_div<srmatrix,interval,simatrix>(A,r); 01380 } 01381 01383 inline simatrix operator*(const simatrix& A, const real& r) { 01384 return sp_ms_mult<simatrix,real,simatrix>(A,r); 01385 } 01386 01388 inline simatrix operator*(const simatrix& A, const interval& r) { 01389 return sp_ms_mult<simatrix,interval,simatrix>(A,r); 01390 } 01391 01393 inline simatrix operator*(const srmatrix& A, const interval& r) { 01394 return sp_ms_mult<srmatrix,interval,simatrix>(A,r); 01395 } 01396 01398 inline simatrix operator*(const real& r, const simatrix& A) { 01399 return sp_sm_mult<real,simatrix,simatrix>(r,A); 01400 } 01401 01403 inline simatrix operator*(const interval& r, const simatrix& A) { 01404 return sp_sm_mult<interval,simatrix,simatrix>(r,A); 01405 } 01406 01408 inline simatrix operator*(const interval& r, const srmatrix& A) { 01409 return sp_sm_mult<interval,srmatrix,simatrix>(r,A); 01410 } 01411 01413 01419 inline ivector operator*(const simatrix& A, const rvector& v) { 01420 return spf_mv_mult<simatrix,rvector,ivector,sparse_idot>(A,v); 01421 } 01422 01424 01430 inline ivector operator*(const srmatrix& A, const ivector& v) { 01431 return spf_mv_mult<srmatrix,ivector,ivector,sparse_idot>(A,v); 01432 } 01433 01435 01441 inline ivector operator*(const simatrix& A, const ivector& v) { 01442 return spf_mv_mult<simatrix,ivector,ivector,sparse_idot>(A,v); 01443 } 01444 01446 01452 inline ivector operator*(const simatrix& A, const rvector_slice& v) { 01453 return spf_mv_mult<simatrix,rvector_slice,ivector,sparse_idot>(A,v); 01454 } 01455 01457 01463 inline ivector operator*(const srmatrix& A, const ivector_slice& v) { 01464 return spf_mv_mult<srmatrix,ivector_slice,ivector,sparse_idot>(A,v); 01465 } 01466 01468 01474 inline ivector operator*(const simatrix& A, const ivector_slice& v) { 01475 return spf_mv_mult<simatrix,ivector_slice,ivector,sparse_idot>(A,v); 01476 } 01477 01479 01485 inline sivector operator*(const simatrix& A, const srvector& v) { 01486 return spsp_mv_mult<simatrix,srvector,sivector,sparse_idot,interval>(A,v); 01487 } 01488 01490 01496 inline sivector operator*(const srmatrix& A, const sivector& v) { 01497 return spsp_mv_mult<srmatrix,sivector,sivector,sparse_idot,interval>(A,v); 01498 } 01499 01501 01507 inline sivector operator*(const simatrix& A, const sivector& v) { 01508 return spsp_mv_mult<simatrix,sivector,sivector,sparse_idot,interval>(A,v); 01509 } 01510 01512 01518 inline sivector operator*(const simatrix& A, const srvector_slice& v) { 01519 return spsl_mv_mult<simatrix,srvector_slice,sivector,sparse_idot,interval>(A,v); 01520 } 01521 01523 01529 inline sivector operator*(const srmatrix& A, const sivector_slice& v) { 01530 return spsl_mv_mult<srmatrix,sivector_slice,sivector,sparse_idot,interval>(A,v); 01531 } 01532 01534 01540 inline sivector operator*(const simatrix& A, const sivector_slice& v) { 01541 return spsl_mv_mult<simatrix,sivector_slice,sivector,sparse_idot,interval>(A,v); 01542 } 01543 01545 01551 inline ivector operator*(const imatrix& A, const srvector& v) { 01552 return fsp_mv_mult<imatrix,srvector,ivector,sparse_idot>(A,v); 01553 } 01554 01556 01562 inline ivector operator*(const rmatrix& A, const sivector& v) { 01563 return fsp_mv_mult<rmatrix,sivector,ivector,sparse_idot>(A,v); 01564 } 01565 01567 01573 inline ivector operator*(const imatrix& A, const sivector& v) { 01574 return fsp_mv_mult<imatrix,sivector,ivector,sparse_idot>(A,v); 01575 } 01576 01578 01584 inline ivector operator*(const imatrix_slice& A, const srvector& v) { 01585 return fsp_mv_mult<imatrix_slice,srvector,ivector,sparse_idot>(A,v); 01586 } 01587 01589 01595 inline ivector operator*(const rmatrix_slice& A, const sivector& v) { 01596 return fsp_mv_mult<rmatrix_slice,sivector,ivector,sparse_idot>(A,v); 01597 } 01598 01600 01606 inline ivector operator*(const imatrix_slice& A, const sivector& v) { 01607 return fsp_mv_mult<imatrix_slice,sivector,ivector,sparse_idot>(A,v); 01608 } 01609 01611 01617 inline ivector operator*(const imatrix& A, const srvector_slice& v) { 01618 return fsl_mv_mult<imatrix,srvector_slice,ivector,sparse_idot>(A,v); 01619 } 01620 01622 01628 inline ivector operator*(const rmatrix& A, const sivector_slice& v) { 01629 return fsl_mv_mult<rmatrix,sivector_slice,ivector,sparse_idot>(A,v); 01630 } 01631 01633 01639 inline ivector operator*(const imatrix& A, const sivector_slice& v) { 01640 return fsl_mv_mult<imatrix,sivector_slice,ivector,sparse_idot>(A,v); 01641 } 01642 01644 01650 inline ivector operator*(const imatrix_slice& A, const srvector_slice& v) { 01651 return fsl_mv_mult<imatrix_slice,srvector_slice,ivector,sparse_idot>(A,v); 01652 } 01653 01655 01661 inline ivector operator*(const rmatrix_slice& A, const sivector_slice& v) { 01662 return fsl_mv_mult<rmatrix_slice,sivector_slice,ivector,sparse_idot>(A,v); 01663 } 01664 01666 01672 inline ivector operator*(const imatrix_slice& A, const sivector_slice& v) { 01673 return fsl_mv_mult<imatrix_slice,sivector_slice,ivector,sparse_idot>(A,v); 01674 } 01675 01677 inline imatrix operator+(const imatrix& A, const srmatrix& B) { 01678 return fsp_mm_add<imatrix,srmatrix,imatrix>(A,B); 01679 } 01680 01682 inline imatrix operator+(const rmatrix& A, const simatrix& B) { 01683 return fsp_mm_add<rmatrix,simatrix,imatrix>(A,B); 01684 } 01685 01687 inline imatrix operator+(const imatrix& A, const simatrix& B) { 01688 return fsp_mm_add<imatrix,simatrix,imatrix>(A,B); 01689 } 01690 01692 inline imatrix operator+(const simatrix& A, const rmatrix& B) { 01693 return spf_mm_add<simatrix,rmatrix,imatrix>(A,B); 01694 } 01695 01697 inline imatrix operator+(const srmatrix& A, const imatrix& B) { 01698 return spf_mm_add<srmatrix,imatrix,imatrix>(A,B); 01699 } 01700 01702 inline imatrix operator+(const simatrix& A, const imatrix& B) { 01703 return spf_mm_add<simatrix,imatrix,imatrix>(A,B); 01704 } 01705 01707 inline imatrix operator+(const imatrix_slice& A, const srmatrix& B) { 01708 return fsp_mm_add<imatrix_slice,srmatrix,imatrix>(A,B); 01709 } 01710 01712 inline imatrix operator+(const rmatrix_slice& A, const simatrix& B) { 01713 return fsp_mm_add<rmatrix_slice,simatrix,imatrix>(A,B); 01714 } 01715 01717 inline imatrix operator+(const imatrix_slice& A, const simatrix& B) { 01718 return fsp_mm_add<imatrix_slice,simatrix,imatrix>(A,B); 01719 } 01720 01722 inline imatrix operator+(const simatrix& A, const rmatrix_slice& B) { 01723 return spf_mm_add<simatrix,rmatrix_slice,imatrix>(A,B); 01724 } 01725 01727 inline imatrix operator+(const srmatrix& A, const imatrix_slice& B) { 01728 return spf_mm_add<srmatrix,imatrix_slice,imatrix>(A,B); 01729 } 01730 01732 inline imatrix operator+(const simatrix& A, const imatrix_slice& B) { 01733 return spf_mm_add<simatrix,imatrix_slice,imatrix>(A,B); 01734 } 01735 01737 inline simatrix operator+(const simatrix& A, const srmatrix& B) { 01738 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(A,B); 01739 } 01740 01742 inline simatrix operator+(const srmatrix& A, const simatrix& B) { 01743 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(A,B); 01744 } 01745 01747 inline simatrix operator+(const simatrix& A, const simatrix& B) { 01748 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(A,B); 01749 } 01750 01752 inline imatrix operator-(const imatrix& A, const srmatrix& B) { 01753 return fsp_mm_sub<imatrix,srmatrix,imatrix>(A,B); 01754 } 01755 01757 inline imatrix operator-(const rmatrix& A, const simatrix& B) { 01758 return fsp_mm_sub<rmatrix,simatrix,imatrix>(A,B); 01759 } 01760 01762 inline imatrix operator-(const imatrix& A, const simatrix& B) { 01763 return fsp_mm_sub<imatrix,simatrix,imatrix>(A,B); 01764 } 01765 01767 inline imatrix operator-(const simatrix& A, const rmatrix& B) { 01768 return spf_mm_sub<simatrix,rmatrix,imatrix>(A,B); 01769 } 01770 01772 inline imatrix operator-(const srmatrix& A, const imatrix& B) { 01773 return spf_mm_sub<srmatrix,imatrix,imatrix>(A,B); 01774 } 01775 01777 inline imatrix operator-(const simatrix& A, const imatrix& B) { 01778 return spf_mm_sub<simatrix,imatrix,imatrix>(A,B); 01779 } 01780 01782 inline imatrix operator-(const imatrix_slice& A, const srmatrix& B) { 01783 return fsp_mm_sub<imatrix_slice,srmatrix,imatrix>(A,B); 01784 } 01785 01787 inline imatrix operator-(const rmatrix_slice& A, const simatrix& B) { 01788 return fsp_mm_sub<rmatrix_slice,simatrix,imatrix>(A,B); 01789 } 01790 01792 inline imatrix operator-(const imatrix_slice& A, const simatrix& B) { 01793 return fsp_mm_sub<imatrix_slice,simatrix,imatrix>(A,B); 01794 } 01795 01797 inline imatrix operator-(const simatrix& A, const rmatrix_slice& B) { 01798 return spf_mm_sub<simatrix,rmatrix_slice,imatrix>(A,B); 01799 } 01800 01802 inline imatrix operator-(const srmatrix& A, const imatrix_slice& B) { 01803 return spf_mm_sub<srmatrix,imatrix_slice,imatrix>(A,B); 01804 } 01805 01807 inline imatrix operator-(const simatrix& A, const imatrix_slice& B) { 01808 return spf_mm_sub<simatrix,imatrix_slice,imatrix>(A,B); 01809 } 01810 01812 inline simatrix operator-(const simatrix& A, const srmatrix& B) { 01813 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(A,B); 01814 } 01815 01817 inline simatrix operator-(const srmatrix& A, const simatrix& B) { 01818 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(A,B); 01819 } 01820 01822 inline simatrix operator-(const simatrix& A, const simatrix& B) { 01823 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(A,B); 01824 } 01825 01827 inline imatrix operator|(const imatrix& A, const srmatrix& B) { 01828 return fsp_mm_hull<imatrix,srmatrix,imatrix>(A,B); 01829 } 01830 01832 inline imatrix operator|(const rmatrix& A, const simatrix& B) { 01833 return fsp_mm_hull<rmatrix,simatrix,imatrix>(A,B); 01834 } 01835 01837 inline imatrix operator|(const imatrix& A, const simatrix& B) { 01838 return fsp_mm_hull<imatrix,simatrix,imatrix>(A,B); 01839 } 01840 01842 inline imatrix operator|(const simatrix& A, const rmatrix& B) { 01843 return spf_mm_hull<simatrix,rmatrix,imatrix>(A,B); 01844 } 01845 01847 inline imatrix operator|(const srmatrix& A, const imatrix& B) { 01848 return spf_mm_hull<srmatrix,imatrix,imatrix>(A,B); 01849 } 01850 01852 inline imatrix operator|(const simatrix& A, const imatrix& B) { 01853 return spf_mm_hull<simatrix,imatrix,imatrix>(A,B); 01854 } 01855 01857 inline imatrix operator|(const imatrix_slice& A, const srmatrix& B) { 01858 return fsp_mm_hull<imatrix_slice,srmatrix,imatrix>(A,B); 01859 } 01860 01862 inline imatrix operator|(const rmatrix_slice& A, const simatrix& B) { 01863 return fsp_mm_hull<rmatrix_slice,simatrix,imatrix>(A,B); 01864 } 01865 01867 inline imatrix operator|(const imatrix_slice& A, const simatrix& B) { 01868 return fsp_mm_hull<imatrix_slice,simatrix,imatrix>(A,B); 01869 } 01870 01872 inline imatrix operator|(const simatrix& A, const rmatrix_slice& B) { 01873 return spf_mm_hull<simatrix,rmatrix_slice,imatrix>(A,B); 01874 } 01875 01877 inline imatrix operator|(const srmatrix& A, const imatrix_slice& B) { 01878 return spf_mm_hull<srmatrix,imatrix_slice,imatrix>(A,B); 01879 } 01880 01882 inline imatrix operator|(const simatrix& A, const imatrix_slice& B) { 01883 return spf_mm_hull<simatrix,imatrix_slice,imatrix>(A,B); 01884 } 01885 01887 inline simatrix operator|(const simatrix& A, const srmatrix& B) { 01888 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(A,B); 01889 } 01890 01892 inline simatrix operator|(const srmatrix& A, const simatrix& B) { 01893 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(A,B); 01894 } 01895 01897 inline simatrix operator|(const simatrix& A, const simatrix& B) { 01898 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(A,B); 01899 } 01900 01902 inline imatrix operator|(const rmatrix& A, const srmatrix& B) { 01903 return fsp_mm_hull<rmatrix,srmatrix,imatrix>(A,B); 01904 } 01905 01907 inline imatrix operator|(const srmatrix& A, const rmatrix& B) { 01908 return spf_mm_hull<srmatrix,rmatrix,imatrix>(A,B); 01909 } 01910 01912 inline imatrix operator|(const rmatrix_slice& A, const srmatrix& B) { 01913 return fsp_mm_hull<rmatrix_slice,srmatrix,imatrix>(A,B); 01914 } 01915 01917 inline imatrix operator|(const srmatrix& A, const rmatrix_slice& B) { 01918 return spf_mm_hull<srmatrix,rmatrix_slice,imatrix>(A,B); 01919 } 01920 01922 inline simatrix operator|(const srmatrix& A, const srmatrix& B) { 01923 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(A,B); 01924 } 01925 01927 inline imatrix operator&(const imatrix& A, const simatrix& B) { 01928 return fsp_mm_intersect<imatrix,simatrix,imatrix>(A,B); 01929 } 01930 01932 inline imatrix operator&(const simatrix& A, const imatrix& B) { 01933 return spf_mm_intersect<simatrix,imatrix,imatrix>(A,B); 01934 } 01935 01937 inline imatrix operator&(const imatrix_slice& A, const simatrix& B) { 01938 return fsp_mm_intersect<imatrix_slice,simatrix,imatrix>(A,B); 01939 } 01940 01942 inline imatrix operator&(const simatrix& A, const imatrix_slice& B) { 01943 return spf_mm_intersect<simatrix,imatrix_slice,imatrix>(A,B); 01944 } 01945 01947 inline simatrix operator&(const simatrix& A, const simatrix& B) { 01948 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(A,B); 01949 } 01950 01952 inline simatrix operator-(const simatrix& M) { 01953 return sp_m_negative<simatrix,simatrix>(M); 01954 } 01955 01957 inline simatrix& operator+(simatrix& A) { 01958 return A; 01959 } 01960 01961 inline imatrix& imatrix::operator=(const srmatrix& B) { 01962 *this = rmatrix(B); 01963 return *this; 01964 } 01965 01966 inline imatrix& imatrix::operator=(const simatrix& B) { 01967 *this = imatrix(B); 01968 return *this; 01969 } 01970 01971 inline imatrix& imatrix::operator+=(const srmatrix& B) { 01972 return fsp_mm_addassign(*this,B); 01973 } 01974 01975 inline imatrix& imatrix::operator+=(const simatrix& B) { 01976 return fsp_mm_addassign(*this,B); 01977 } 01978 01979 inline imatrix_slice& imatrix_slice::operator+=(const srmatrix& B) { 01980 return fsp_mm_addassign(*this,B); 01981 } 01982 01983 inline imatrix_slice& imatrix_slice::operator+=(const simatrix& B) { 01984 return fsp_mm_addassign(*this,B); 01985 } 01986 01987 inline imatrix& imatrix::operator-=(const srmatrix& B) { 01988 return fsp_mm_subassign(*this,B); 01989 } 01990 01991 inline imatrix& imatrix::operator-=(const simatrix& B) { 01992 return fsp_mm_subassign(*this,B); 01993 } 01994 01995 inline imatrix_slice& imatrix_slice::operator-=(const srmatrix& B) { 01996 return fsp_mm_subassign(*this,B); 01997 } 01998 01999 inline imatrix_slice& imatrix_slice::operator-=(const simatrix& B) { 02000 return fsp_mm_subassign(*this,B); 02001 } 02002 02003 inline imatrix& imatrix::operator*=(const srmatrix& B) { 02004 return fsp_mm_multassign<imatrix,srmatrix,sparse_idot,imatrix>(*this,B); 02005 } 02006 02007 inline imatrix& imatrix::operator*=(const simatrix& B) { 02008 return fsp_mm_multassign<imatrix,simatrix,sparse_idot,imatrix>(*this,B); 02009 } 02010 02011 inline imatrix_slice& imatrix_slice::operator*=(const srmatrix& B) { 02012 return fsp_mm_multassign<imatrix_slice,srmatrix,sparse_idot,imatrix>(*this,B); 02013 } 02014 02015 inline imatrix_slice& imatrix_slice::operator*=(const simatrix& B) { 02016 return fsp_mm_multassign<imatrix_slice,simatrix,sparse_idot,imatrix>(*this,B); 02017 } 02018 02019 inline imatrix& imatrix::operator|=(const srmatrix& B) { 02020 return fsp_mm_hullassign(*this,B); 02021 } 02022 02023 inline imatrix& imatrix::operator|=(const simatrix& B) { 02024 return fsp_mm_hullassign(*this,B); 02025 } 02026 02027 inline imatrix_slice& imatrix_slice::operator|=(const srmatrix& B) { 02028 return fsp_mm_hullassign(*this,B); 02029 } 02030 02031 inline imatrix_slice& imatrix_slice::operator|=(const simatrix& B) { 02032 return fsp_mm_hullassign(*this,B); 02033 } 02034 02035 inline imatrix& imatrix::operator&=(const srmatrix& B) { 02036 return fsp_mm_intersectassign(*this,B); 02037 } 02038 02039 inline imatrix& imatrix::operator&=(const simatrix& B) { 02040 return fsp_mm_intersectassign(*this,B); 02041 } 02042 02043 inline imatrix_slice& imatrix_slice::operator&=(const srmatrix& B) { 02044 return fsp_mm_intersectassign(*this,B); 02045 } 02046 02047 inline imatrix_slice& imatrix_slice::operator&=(const simatrix& B) { 02048 return fsp_mm_intersectassign(*this,B); 02049 } 02050 02052 inline bool operator==(const simatrix& A, const srmatrix& B) { 02053 return spsp_mm_comp(A,B); 02054 } 02055 02057 inline bool operator==(const srmatrix& A, const simatrix& B) { 02058 return spsp_mm_comp(A,B); 02059 } 02060 02062 inline bool operator==(const simatrix& A, const simatrix& B) { 02063 return spsp_mm_comp(A,B); 02064 } 02065 02067 inline bool operator==(const simatrix& A, const rmatrix& B) { 02068 return spf_mm_comp(A,B); 02069 } 02070 02072 inline bool operator==(const srmatrix& A, const imatrix& B) { 02073 return spf_mm_comp(A,B); 02074 } 02075 02077 inline bool operator==(const simatrix& A, const imatrix& B) { 02078 return spf_mm_comp(A,B); 02079 } 02080 02082 inline bool operator==(const imatrix& A, const srmatrix& B) { 02083 return fsp_mm_comp(A,B); 02084 } 02085 02087 inline bool operator==(const rmatrix& A, const simatrix& B) { 02088 return fsp_mm_comp(A,B); 02089 } 02090 02092 inline bool operator==(const imatrix& A, const simatrix& B) { 02093 return fsp_mm_comp(A,B); 02094 } 02095 02097 inline bool operator==(const imatrix_slice& A, const srmatrix& B) { 02098 return fsp_mm_comp(A,B); 02099 } 02100 02102 inline bool operator==(const rmatrix_slice& A, const simatrix& B) { 02103 return fsp_mm_comp(A,B); 02104 } 02105 02107 inline bool operator==(const imatrix_slice& A, const simatrix& B) { 02108 return fsp_mm_comp(A,B); 02109 } 02110 02112 inline bool operator==(const simatrix& A, const rmatrix_slice& B) { 02113 return spf_mm_comp(A,B); 02114 } 02115 02117 inline bool operator==(const srmatrix& A, const imatrix_slice& B) { 02118 return spf_mm_comp(A,B); 02119 } 02120 02122 inline bool operator==(const simatrix& A, const imatrix_slice& B) { 02123 return spf_mm_comp(A,B); 02124 } 02125 02127 inline bool operator!=(const simatrix& A, const srmatrix& B) { 02128 return !spsp_mm_comp(A,B); 02129 } 02130 02132 inline bool operator!=(const srmatrix& A, const simatrix& B) { 02133 return !spsp_mm_comp(A,B); 02134 } 02135 02137 inline bool operator!=(const simatrix& A, const simatrix& B) { 02138 return !spsp_mm_comp(A,B); 02139 } 02140 02142 inline bool operator!=(const simatrix& A, const rmatrix& B) { 02143 return !spf_mm_comp(A,B); 02144 } 02145 02147 inline bool operator!=(const srmatrix& A, const imatrix& B) { 02148 return !spf_mm_comp(A,B); 02149 } 02150 02152 inline bool operator!=(const simatrix& A, const imatrix& B) { 02153 return !spf_mm_comp(A,B); 02154 } 02155 02157 inline bool operator!=(const imatrix& A, const srmatrix& B) { 02158 return !fsp_mm_comp(A,B); 02159 } 02160 02162 inline bool operator!=(const rmatrix& A, const simatrix& B) { 02163 return !fsp_mm_comp(A,B); 02164 } 02165 02167 inline bool operator!=(const imatrix& A, const simatrix& B) { 02168 return !fsp_mm_comp(A,B); 02169 } 02170 02172 inline bool operator!=(const imatrix_slice& A, const srmatrix& B) { 02173 return !fsp_mm_comp(A,B); 02174 } 02175 02177 inline bool operator!=(const rmatrix_slice& A, const simatrix& B) { 02178 return !fsp_mm_comp(A,B); 02179 } 02180 02182 inline bool operator!=(const imatrix_slice& A, const simatrix& B) { 02183 return !fsp_mm_comp(A,B); 02184 } 02185 02187 inline bool operator!=(const simatrix& A, const rmatrix_slice& B) { 02188 return !spf_mm_comp(A,B); 02189 } 02190 02192 inline bool operator!=(const srmatrix& A, const imatrix_slice& B) { 02193 return !spf_mm_comp(A,B); 02194 } 02195 02197 inline bool operator!=(const simatrix& A, const imatrix_slice& B) { 02198 return !spf_mm_comp(A,B); 02199 } 02200 02202 inline bool operator<(const srmatrix& A, const simatrix& B) { 02203 return spsp_mm_less<srmatrix,simatrix,interval>(A,B); 02204 } 02205 02207 inline bool operator<(const simatrix& A, const simatrix& B) { 02208 return spsp_mm_less<simatrix,simatrix,interval>(A,B); 02209 } 02210 02212 inline bool operator<(const srmatrix& A, const imatrix& B) { 02213 return spf_mm_less<srmatrix,imatrix,interval>(A,B); 02214 } 02215 02217 inline bool operator<(const simatrix& A, const imatrix& B) { 02218 return spf_mm_less<simatrix,imatrix,interval>(A,B); 02219 } 02220 02222 inline bool operator<(const rmatrix& A, const simatrix& B) { 02223 return fsp_mm_less<rmatrix,simatrix,interval>(A,B); 02224 } 02225 02227 inline bool operator<(const imatrix& A, const simatrix& B) { 02228 return fsp_mm_less<imatrix,simatrix,interval>(A,B); 02229 } 02230 02232 inline bool operator<(const rmatrix_slice& A, const simatrix& B) { 02233 return fsp_mm_less<rmatrix_slice,simatrix,interval>(A,B); 02234 } 02235 02237 inline bool operator<(const imatrix_slice& A, const simatrix& B) { 02238 return fsp_mm_less<imatrix_slice,simatrix,interval>(A,B); 02239 } 02240 02242 inline bool operator<(const srmatrix& A, const imatrix_slice& B) { 02243 return spf_mm_less<srmatrix,imatrix_slice,interval>(A,B); 02244 } 02245 02247 inline bool operator<(const simatrix& A, const imatrix_slice& B) { 02248 return spf_mm_less<simatrix,imatrix_slice,interval>(A,B); 02249 } 02250 02252 inline bool operator<=(const srmatrix& A, const simatrix& B) { 02253 return spsp_mm_leq<srmatrix,simatrix,interval>(A,B); 02254 } 02255 02257 inline bool operator<=(const simatrix& A, const simatrix& B) { 02258 return spsp_mm_leq<simatrix,simatrix,interval>(A,B); 02259 } 02260 02262 inline bool operator<=(const srmatrix& A, const imatrix& B) { 02263 return spf_mm_leq<srmatrix,imatrix,interval>(A,B); 02264 } 02265 02267 inline bool operator<=(const simatrix& A, const imatrix& B) { 02268 return spf_mm_leq<simatrix,imatrix,interval>(A,B); 02269 } 02270 02272 inline bool operator<=(const rmatrix& A, const simatrix& B) { 02273 return fsp_mm_leq<rmatrix,simatrix,interval>(A,B); 02274 } 02275 02277 inline bool operator<=(const imatrix& A, const simatrix& B) { 02278 return fsp_mm_leq<imatrix,simatrix,interval>(A,B); 02279 } 02280 02282 inline bool operator<=(const rmatrix_slice& A, const simatrix& B) { 02283 return fsp_mm_leq<rmatrix_slice,simatrix,interval>(A,B); 02284 } 02285 02287 inline bool operator<=(const imatrix_slice& A, const simatrix& B) { 02288 return fsp_mm_leq<imatrix_slice,simatrix,interval>(A,B); 02289 } 02290 02292 inline bool operator<=(const srmatrix& A, const imatrix_slice& B) { 02293 return spf_mm_leq<srmatrix,imatrix_slice,interval>(A,B); 02294 } 02295 02297 inline bool operator<=(const simatrix& A, const imatrix_slice& B) { 02298 return spf_mm_leq<simatrix,imatrix_slice,interval>(A,B); 02299 } 02300 02302 inline bool operator>(const simatrix& A, const srmatrix& B) { 02303 return spsp_mm_greater<simatrix,srmatrix,interval>(A,B); 02304 } 02305 02307 inline bool operator>(const simatrix& A, const simatrix& B) { 02308 return spsp_mm_greater<simatrix,simatrix,interval>(A,B); 02309 } 02310 02312 inline bool operator>(const simatrix& A, const rmatrix& B) { 02313 return spf_mm_greater<simatrix,rmatrix,interval>(A,B); 02314 } 02315 02317 inline bool operator>(const simatrix& A, const imatrix& B) { 02318 return spf_mm_greater<simatrix,imatrix,interval>(A,B); 02319 } 02320 02322 inline bool operator>(const imatrix& A, const srmatrix& B) { 02323 return fsp_mm_greater<imatrix,srmatrix,interval>(A,B); 02324 } 02325 02327 inline bool operator>(const imatrix& A, const simatrix& B) { 02328 return fsp_mm_greater<imatrix,simatrix,interval>(A,B); 02329 } 02330 02332 inline bool operator>(const imatrix_slice& A, const srmatrix& B) { 02333 return fsp_mm_greater<imatrix_slice,srmatrix,interval>(A,B); 02334 } 02335 02337 inline bool operator>(const imatrix_slice& A, const simatrix& B) { 02338 return fsp_mm_greater<imatrix_slice,simatrix,interval>(A,B); 02339 } 02340 02342 inline bool operator>(const simatrix& A, const rmatrix_slice& B) { 02343 return spf_mm_greater<simatrix,rmatrix_slice,interval>(A,B); 02344 } 02345 02347 inline bool operator>(const simatrix& A, const imatrix_slice& B) { 02348 return spf_mm_greater<simatrix,imatrix_slice,interval>(A,B); 02349 } 02350 02352 inline bool operator>=(const simatrix& A, const srmatrix& B) { 02353 return spsp_mm_geq<simatrix,srmatrix,interval>(A,B); 02354 } 02355 02357 inline bool operator>=(const simatrix& A, const simatrix& B) { 02358 return spsp_mm_geq<simatrix,simatrix,interval>(A,B); 02359 } 02360 02362 inline bool operator>=(const simatrix& A, const rmatrix& B) { 02363 return spf_mm_geq<simatrix,rmatrix,interval>(A,B); 02364 } 02365 02367 inline bool operator>=(const simatrix& A, const imatrix& B) { 02368 return spf_mm_geq<simatrix,imatrix,interval>(A,B); 02369 } 02370 02372 inline bool operator>=(const imatrix& A, const srmatrix& B) { 02373 return fsp_mm_geq<imatrix,srmatrix,interval>(A,B); 02374 } 02375 02377 inline bool operator>=(const imatrix& A, const simatrix& B) { 02378 return fsp_mm_geq<imatrix,simatrix,interval>(A,B); 02379 } 02380 02382 inline bool operator>=(const imatrix_slice& A, const srmatrix& B) { 02383 return fsp_mm_geq<imatrix_slice,srmatrix,interval>(A,B); 02384 } 02385 02387 inline bool operator>=(const imatrix_slice& A, const simatrix& B) { 02388 return fsp_mm_geq<imatrix_slice,simatrix,interval>(A,B); 02389 } 02390 02392 inline bool operator>=(const simatrix& A, const rmatrix_slice& B) { 02393 return spf_mm_geq<simatrix,rmatrix_slice,interval>(A,B); 02394 } 02395 02397 inline bool operator>=(const simatrix& A, const imatrix_slice& B) { 02398 return spf_mm_geq<simatrix,imatrix_slice,interval>(A,B); 02399 } 02400 02402 inline bool operator!(const simatrix& A) { 02403 return sp_m_not(A); 02404 } 02405 02407 02412 inline std::ostream& operator<<(std::ostream& os, const simatrix& A) { 02413 return sp_m_output<simatrix,interval>(os,A); 02414 } 02415 02417 02422 inline std::istream& operator>>(std::istream& is, simatrix& A) { 02423 return sp_m_input<simatrix,interval>(is,A); 02424 } 02425 02427 02431 class simatrix_slice { 02432 public: 02433 simatrix A; 02434 simatrix* M; //Originalmatrix 02435 02436 private: 02437 simatrix_slice(simatrix& Mat, int sl1l, int sl1u, int sl2l, int sl2u) { 02438 A.lb1 = sl1l; 02439 A.lb2 = sl2l; 02440 A.ub1 = sl1u; 02441 A.ub2 = sl2u; 02442 A.m = sl1u-sl1l+1; 02443 A.n = sl2u-sl2l+1; 02444 02445 //Kopieren der Werte aus A 02446 A.p = std::vector<int>(A.n+1, 0); 02447 A.ind.reserve(A.m + A.n); 02448 A.x.reserve(A.m + A.n); 02449 02450 for(int i=0 ; i<A.n ; i++) { 02451 A.p[i+1] = A.p[i]; 02452 for(int j=Mat.p[sl2l-Mat.lb2+i] ; j<Mat.p[sl2l-Mat.lb2+i+1] ; j++) { 02453 if(Mat.ind[j] >= sl1l-Mat.lb1 && Mat.ind[j] <= sl1u-Mat.lb1) { 02454 A.ind.push_back(Mat.ind[j]-(sl1l-Mat.lb1)); 02455 A.x.push_back(Mat.x[j]); 02456 A.p[i+1]++; 02457 } 02458 } 02459 } 02460 02461 //Zeiger auf A fuer Datenmanipulationen 02462 M = &Mat; 02463 } 02464 02465 simatrix_slice(const simatrix& Mat, int sl1l, int sl1u, int sl2l, int sl2u) { 02466 A.lb1 = sl1l; 02467 A.lb2 = sl2l; 02468 A.ub1 = sl1u; 02469 A.ub2 = sl2u; 02470 A.m = sl1u-sl1l+1; 02471 A.n = sl2u-sl2l+1; 02472 02473 //Kopieren der Werte aus A 02474 A.p = std::vector<int>(A.n+1, 0); 02475 A.ind.reserve(A.m + A.n); 02476 A.x.reserve(A.m + A.n); 02477 02478 for(int i=0 ; i<A.n ; i++) { 02479 A.p[i+1] = A.p[i]; 02480 for(int j=Mat.p[sl2l-Mat.lb2+i] ; j<Mat.p[sl2l-Mat.lb2+i+1] ; j++) { 02481 if(Mat.ind[j] >= sl1l-Mat.lb1 && Mat.ind[j] <= sl1u-Mat.lb1) { 02482 A.ind.push_back(Mat.ind[j]-(sl1l-Mat.lb1)); 02483 A.x.push_back(Mat.x[j]); 02484 A.p[i+1]++; 02485 } 02486 } 02487 } 02488 02489 //Zeiger auf A fuer Datenmanipulationen 02490 M = const_cast<simatrix*>(&Mat); //Vorgehen noetig um Schreibweise A[i][j] bei auslesen von const A zu ermoeglichen 02491 } 02492 02493 02494 public: 02496 simatrix_slice& operator=(const real& C) { 02497 return sl_ms_assign<simatrix_slice, real, std::vector<interval>::iterator, interval>(*this,C); 02498 } 02499 02501 simatrix_slice& operator=(const interval& C) { 02502 return sl_ms_assign<simatrix_slice, interval, std::vector<interval>::iterator, interval>(*this,C); 02503 } 02504 02506 simatrix_slice& operator=(const srmatrix& C) { 02507 return slsp_mm_assign<simatrix_slice, srmatrix, std::vector<interval>::iterator>(*this,C); 02508 } 02509 02511 simatrix_slice& operator=(const simatrix& C) { 02512 return slsp_mm_assign<simatrix_slice, simatrix, std::vector<interval>::iterator>(*this,C); 02513 } 02514 02516 simatrix_slice& operator=(const rmatrix& C) { 02517 return slf_mm_assign<simatrix_slice, rmatrix, std::vector<interval>::iterator, interval>(*this,C); 02518 } 02519 02521 simatrix_slice& operator=(const imatrix& C) { 02522 return slf_mm_assign<simatrix_slice, imatrix, std::vector<interval>::iterator, interval>(*this,C); 02523 } 02524 02526 simatrix_slice& operator=(const rmatrix_slice& C) { 02527 return slf_mm_assign<simatrix_slice, rmatrix_slice, std::vector<interval>::iterator, interval>(*this,C); 02528 } 02529 02531 simatrix_slice& operator=(const imatrix_slice& C) { 02532 return slf_mm_assign<simatrix_slice, imatrix_slice, std::vector<interval>::iterator, interval>(*this,C); 02533 } 02534 02536 simatrix_slice& operator=(const srmatrix_slice& C) { 02537 *this = C.A; 02538 return *this; 02539 } 02540 02542 simatrix_slice& operator=(const simatrix_slice& C) { 02543 *this = C.A; 02544 return *this; 02545 } 02546 02548 simatrix_slice& operator*=(const srmatrix_slice& M) { 02549 *this = A*M.A; 02550 return *this; 02551 } 02552 02554 simatrix_slice& operator*=(const simatrix_slice& M) { 02555 *this = A*M.A; 02556 return *this; 02557 } 02558 02560 simatrix_slice& operator*=(const srmatrix& M) { 02561 *this = A*M; 02562 return *this; 02563 } 02564 02566 simatrix_slice& operator*=(const simatrix& M) { 02567 *this = A*M; 02568 return *this; 02569 } 02570 02572 simatrix_slice& operator*=(const rmatrix& M) { 02573 *this = A*M; 02574 return *this; 02575 } 02576 02578 simatrix_slice& operator*=(const imatrix& M) { 02579 *this = A*M; 02580 return *this; 02581 } 02582 02584 simatrix_slice& operator*=(const rmatrix_slice& M) { 02585 *this = A*M; 02586 return *this; 02587 } 02588 02590 simatrix_slice& operator*=(const imatrix_slice& M) { 02591 *this = A*M; 02592 return *this; 02593 } 02594 02596 simatrix_slice& operator*=(const real& r) { 02597 *this = A*r; 02598 return *this; 02599 } 02600 02602 simatrix_slice& operator*=(const interval& r) { 02603 *this = A*r; 02604 return *this; 02605 } 02606 02608 simatrix_slice& operator/=(const real& r) { 02609 *this = A/r; 02610 return *this; 02611 } 02612 02614 simatrix_slice& operator/=(const interval& r) { 02615 *this = A/r; 02616 return *this; 02617 } 02618 02620 simatrix_slice& operator+=(const srmatrix_slice& M) { 02621 *this = A+M.A; 02622 return *this; 02623 } 02624 02626 simatrix_slice& operator+=(const simatrix_slice& M) { 02627 *this = A+M.A; 02628 return *this; 02629 } 02630 02632 simatrix_slice& operator+=(const srmatrix& M) { 02633 *this = A+M; 02634 return *this; 02635 } 02636 02638 simatrix_slice& operator+=(const simatrix& M) { 02639 *this = A+M; 02640 return *this; 02641 } 02642 02644 simatrix_slice& operator+=(const rmatrix& M) { 02645 *this = A+M; 02646 return *this; 02647 } 02648 02650 simatrix_slice& operator+=(const imatrix& M) { 02651 *this = A+M; 02652 return *this; 02653 } 02654 02656 simatrix_slice& operator+=(const rmatrix_slice& M) { 02657 *this = A+M; 02658 return *this; 02659 } 02660 02662 simatrix_slice& operator+=(const imatrix_slice& M) { 02663 *this = A+M; 02664 return *this; 02665 } 02666 02668 simatrix_slice& operator-=(const srmatrix_slice& M) { 02669 *this = A-M.A; 02670 return *this; 02671 } 02672 02674 simatrix_slice& operator-=(const simatrix_slice& M) { 02675 *this = A-M.A; 02676 return *this; 02677 } 02678 02680 simatrix_slice& operator-=(const srmatrix& M) { 02681 *this = A-M; 02682 return *this; 02683 } 02684 02686 simatrix_slice& operator-=(const simatrix& M) { 02687 *this = A-M; 02688 return *this; 02689 } 02690 02692 simatrix_slice& operator-=(const rmatrix& M) { 02693 *this = A-M; 02694 return *this; 02695 } 02696 02698 simatrix_slice& operator-=(const imatrix& M) { 02699 *this = A-M; 02700 return *this; 02701 } 02702 02704 simatrix_slice& operator-=(const rmatrix_slice& M) { 02705 *this = A-M; 02706 return *this; 02707 } 02708 02710 simatrix_slice& operator-=(const imatrix_slice& M) { 02711 *this = A-M; 02712 return *this; 02713 } 02714 02716 simatrix_slice& operator|=(const srmatrix_slice& M) { 02717 *this = A|M.A; 02718 return *this; 02719 } 02720 02722 simatrix_slice& operator|=(const simatrix_slice& M) { 02723 *this = A|M.A; 02724 return *this; 02725 } 02726 02728 simatrix_slice& operator|=(const srmatrix& M) { 02729 *this = A|M; 02730 return *this; 02731 } 02732 02734 simatrix_slice& operator|=(const simatrix& M) { 02735 *this = A|M; 02736 return *this; 02737 } 02738 02740 simatrix_slice& operator|=(const rmatrix& M) { 02741 *this = A|M; 02742 return *this; 02743 } 02744 02746 simatrix_slice& operator|=(const imatrix& M) { 02747 *this = A|M; 02748 return *this; 02749 } 02750 02752 simatrix_slice& operator|=(const rmatrix_slice& M) { 02753 *this = A|M; 02754 return *this; 02755 } 02756 02758 simatrix_slice& operator|=(const imatrix_slice& M) { 02759 *this = A|M; 02760 return *this; 02761 } 02762 02764 02768 const interval operator()(const int i, const int j) const { 02769 #if(CXSC_INDEX_CHECK) 02770 if(i<A.lb1 || i>A.ub1 || j<A.lb2 || j>A.ub2) 02771 cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_slice::operator()(int, int)")); 02772 #endif 02773 interval r = A(i,j); 02774 return r; 02775 } 02776 02778 02782 interval& element(const int i, const int j) { 02783 #if(CXSC_INDEX_CHECK) 02784 if(i<A.lb1 || i>A.ub1 || j<A.lb2 || j>A.ub2) 02785 cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_slice::element(int, int)")); 02786 #endif 02787 return M->element(i,j); 02788 } 02789 02791 simatrix_subv operator[](const int); 02793 simatrix_subv operator[](const cxscmatrix_column&); 02795 const simatrix_subv operator[](const int) const; 02797 const simatrix_subv operator[](const cxscmatrix_column&) const; 02798 02799 friend std::ostream& operator<<(std::ostream&, const simatrix_slice&); 02800 02801 friend int Lb(const simatrix_slice&, const int); 02802 friend int Ub(const simatrix_slice&, const int); 02803 friend srmatrix Inf(const simatrix_slice&); 02804 friend srmatrix Sup(const simatrix_slice&); 02805 friend simatrix abs(const simatrix_slice&); 02806 friend srmatrix mid(const simatrix_slice&); 02807 friend srmatrix diam(const simatrix_slice&); 02808 friend int RowLen(const simatrix_slice&); 02809 friend int ColLen(const simatrix_slice&); 02810 02811 friend class srmatrix; 02812 friend class srmatrix_subv; 02813 friend class srvector; 02814 friend class simatrix; 02815 friend class simatrix_subv; 02816 friend class sivector; 02817 friend class scimatrix; 02818 friend class scimatrix_subv; 02819 friend class scimatrix_slice; 02820 friend class scivector; 02821 friend class imatrix; 02822 friend class cimatrix; 02823 02824 02825 #include "matrix_friend_declarations.inl" 02826 }; 02827 02828 inline imatrix::imatrix(const srmatrix_slice& A) { 02829 dat = new interval[A.A.m*A.A.n]; 02830 lb1 = A.A.lb1; lb2 = A.A.lb2; ub1 = A.A.ub1; ub2 = A.A.ub2; 02831 xsize = A.A.n; 02832 ysize = A.A.m; 02833 *this = 0.0; 02834 for(int j=0 ; j<A.A.n ; j++) { 02835 for(int k=A.A.p[j] ; k<A.A.p[j+1] ; k++) { 02836 dat[A.A.ind[k]*A.A.n+j] = A.A.x[k]; 02837 } 02838 } 02839 } 02840 02841 inline imatrix::imatrix(const simatrix_slice& A) { 02842 dat = new interval[A.A.m*A.A.n]; 02843 lb1 = A.A.lb1; lb2 = A.A.lb2; ub1 = A.A.ub1; ub2 = A.A.ub2; 02844 xsize = A.A.n; 02845 ysize = A.A.m; 02846 *this = 0.0; 02847 for(int j=0 ; j<A.A.n ; j++) { 02848 for(int k=A.A.p[j] ; k<A.A.p[j+1] ; k++) { 02849 dat[A.A.ind[k]*A.A.n+j] = A.A.x[k]; 02850 } 02851 } 02852 } 02853 02855 inline int RowLen(const simatrix_slice& S) { 02856 return RowLen(S.A); 02857 } 02858 02860 inline int ColLen(const simatrix_slice& S) { 02861 return ColLen(S.A); 02862 } 02863 02864 inline simatrix_slice simatrix::operator()(const int i, const int j, const int k, const int l) { 02865 #if(CXSC_INDEX_CHECK) 02866 if(i<lb1 || j>ub1 || k<lb2 || l>ub2) 02867 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int, int, int)")); 02868 #endif 02869 return simatrix_slice(*this, i, j, k, l); 02870 } 02871 02872 inline const simatrix_slice simatrix::operator()(const int i, const int j, const int k, const int l) const { 02873 #if(CXSC_INDEX_CHECK) 02874 if(i<lb1 || j>ub1 || k<lb2 || l>ub2) 02875 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int, int, int) const")); 02876 #endif 02877 return simatrix_slice(*this, i, j, k, l); 02878 } 02879 02881 inline int Lb(const simatrix_slice& S, const int i) { 02882 return Lb(S.A, i); 02883 } 02884 02886 inline int Ub(const simatrix_slice& S, const int i) { 02887 return Ub(S.A, i); 02888 } 02889 02891 inline srmatrix Inf(const simatrix_slice& S) { 02892 return Inf(S.A); 02893 } 02894 02896 inline srmatrix Sup(const simatrix_slice& S) { 02897 return Sup(S.A); 02898 } 02899 02901 inline simatrix abs(const simatrix_slice& S) { 02902 return abs(S.A); 02903 } 02904 02906 inline srmatrix mid(const simatrix_slice& S) { 02907 return mid(S.A); 02908 } 02909 02911 inline srmatrix diam(const simatrix_slice& S) { 02912 return diam(S.A); 02913 } 02914 02915 inline simatrix::simatrix(const srmatrix_slice& S) { 02916 m = S.A.m; 02917 n = S.A.n; 02918 lb1 = S.A.lb1; 02919 ub1 = S.A.ub1; 02920 lb2 = S.A.lb2; 02921 ub2 = S.A.ub2; 02922 *this = S.A; 02923 } 02924 02925 inline simatrix::simatrix(const simatrix_slice& S) { 02926 m = S.A.m; 02927 n = S.A.n; 02928 lb1 = S.A.lb1; 02929 ub1 = S.A.ub1; 02930 lb2 = S.A.lb2; 02931 ub2 = S.A.ub2; 02932 *this = S.A; 02933 } 02934 02935 inline simatrix& simatrix::operator=(const srmatrix_slice& S) { 02936 *this = S.A; 02937 return *this; 02938 } 02939 02940 inline simatrix& simatrix::operator=(const simatrix_slice& S) { 02941 *this = S.A; 02942 return *this; 02943 } 02944 02945 inline imatrix& imatrix::operator=(const srmatrix_slice& M) { 02946 *this = rmatrix(M); 02947 return *this; 02948 } 02949 02950 inline imatrix& imatrix::operator=(const simatrix_slice& M) { 02951 *this = imatrix(M); 02952 return *this; 02953 } 02954 02955 inline imatrix& imatrix::operator+=(const srmatrix_slice& M) { 02956 *this += M.A; 02957 return *this; 02958 } 02959 02960 inline imatrix& imatrix::operator+=(const simatrix_slice& M) { 02961 *this += M.A; 02962 return *this; 02963 } 02964 02965 inline imatrix_slice& imatrix_slice::operator+=(const srmatrix_slice& M) { 02966 *this += M.A; 02967 return *this; 02968 } 02969 02970 inline imatrix_slice& imatrix_slice::operator+=(const simatrix_slice& M) { 02971 *this += M.A; 02972 return *this; 02973 } 02974 02975 inline imatrix& imatrix::operator-=(const srmatrix_slice& M) { 02976 *this -= M.A; 02977 return *this; 02978 } 02979 02980 inline imatrix& imatrix::operator-=(const simatrix_slice& M) { 02981 *this -= M.A; 02982 return *this; 02983 } 02984 02985 inline imatrix_slice& imatrix_slice::operator-=(const srmatrix_slice& M) { 02986 *this -= M.A; 02987 return *this; 02988 } 02989 02990 inline imatrix_slice& imatrix_slice::operator-=(const simatrix_slice& M) { 02991 *this -= M.A; 02992 return *this; 02993 } 02994 02995 inline imatrix& imatrix::operator*=(const srmatrix_slice& M) { 02996 *this *= M.A; 02997 return *this; 02998 } 02999 03000 inline imatrix& imatrix::operator*=(const simatrix_slice& M) { 03001 *this *= M.A; 03002 return *this; 03003 } 03004 03005 inline imatrix_slice& imatrix_slice::operator*=(const srmatrix_slice& M) { 03006 *this *= M.A; 03007 return *this; 03008 } 03009 03010 inline imatrix_slice& imatrix_slice::operator*=(const simatrix_slice& M) { 03011 *this *= M.A; 03012 return *this; 03013 } 03014 03015 inline imatrix& imatrix::operator|=(const srmatrix_slice& M) { 03016 *this |= M.A; 03017 return *this; 03018 } 03019 03020 inline imatrix& imatrix::operator|=(const simatrix_slice& M) { 03021 *this |= M.A; 03022 return *this; 03023 } 03024 03025 inline imatrix_slice& imatrix_slice::operator|=(const srmatrix_slice& M) { 03026 *this |= M.A; 03027 return *this; 03028 } 03029 03030 inline imatrix_slice& imatrix_slice::operator|=(const simatrix_slice& M) { 03031 *this |= M.A; 03032 return *this; 03033 } 03034 03035 inline imatrix& imatrix::operator&=(const srmatrix_slice& M) { 03036 *this &= M.A; 03037 return *this; 03038 } 03039 03040 inline imatrix& imatrix::operator&=(const simatrix_slice& M) { 03041 *this &= M.A; 03042 return *this; 03043 } 03044 03045 inline imatrix_slice& imatrix_slice::operator&=(const srmatrix_slice& M) { 03046 *this &= M.A; 03047 return *this; 03048 } 03049 03050 inline imatrix_slice& imatrix_slice::operator&=(const simatrix_slice& M) { 03051 *this &= M.A; 03052 return *this; 03053 } 03054 03056 inline simatrix operator-(const simatrix_slice& M) { 03057 return sp_m_negative<simatrix,simatrix>(M.A); 03058 } 03059 03061 inline simatrix operator+(const simatrix_slice& M) { 03062 return M.A; 03063 } 03064 03066 03072 inline simatrix operator*(const simatrix_slice& M1, const srmatrix_slice& M2) { 03073 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1.A,M2.A); 03074 } 03075 03077 03083 inline simatrix operator*(const srmatrix_slice& M1, const simatrix_slice& M2) { 03084 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2.A); 03085 } 03086 03088 03094 inline simatrix operator*(const simatrix_slice& M1, const simatrix_slice& M2) { 03095 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2.A); 03096 } 03097 03099 03105 inline simatrix operator*(const simatrix_slice& M1, const srmatrix& M2) { 03106 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1.A,M2); 03107 } 03108 03110 03116 inline simatrix operator*(const srmatrix_slice& M1, const simatrix& M2) { 03117 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2); 03118 } 03119 03121 03127 inline simatrix operator*(const simatrix_slice& M1, const simatrix& M2) { 03128 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2); 03129 } 03130 03132 03138 inline simatrix operator*(const simatrix& M1, const srmatrix_slice& M2) { 03139 return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1,M2.A); 03140 } 03141 03143 03149 inline simatrix operator*(const srmatrix& M1, const simatrix_slice& M2) { 03150 return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1,M2.A); 03151 } 03152 03154 03160 inline simatrix operator*(const simatrix& M1, const simatrix_slice& M2) { 03161 return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1,M2.A); 03162 } 03163 03165 03171 inline imatrix operator*(const simatrix_slice& M1, const rmatrix& M2) { 03172 return spf_mm_mult<simatrix,rmatrix,imatrix,sparse_idot>(M1.A,M2); 03173 } 03174 03176 03182 inline imatrix operator*(const srmatrix_slice& M1, const imatrix& M2) { 03183 return spf_mm_mult<srmatrix,imatrix,imatrix,sparse_idot>(M1.A,M2); 03184 } 03185 03187 03193 inline imatrix operator*(const simatrix_slice& M1, const imatrix& M2) { 03194 return spf_mm_mult<simatrix,imatrix,imatrix,sparse_idot>(M1.A,M2); 03195 } 03196 03198 03204 inline imatrix operator*(const imatrix& M1, const srmatrix_slice& M2) { 03205 return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(M1,M2.A); 03206 } 03207 03209 03215 inline imatrix operator*(const rmatrix& M1, const simatrix_slice& M2) { 03216 return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(M1,M2.A); 03217 } 03218 03220 03226 inline imatrix operator*(const imatrix& M1, const simatrix_slice& M2) { 03227 return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(M1,M2.A); 03228 } 03229 03231 03237 inline imatrix operator*(const simatrix_slice& M1, const rmatrix_slice& M2) { 03238 return spf_mm_mult<simatrix,rmatrix_slice,imatrix,sparse_idot>(M1.A,M2); 03239 } 03240 03242 03248 inline imatrix operator*(const srmatrix_slice& M1, const imatrix_slice& M2) { 03249 return spf_mm_mult<srmatrix,imatrix_slice,imatrix,sparse_idot>(M1.A,M2); 03250 } 03251 03253 03259 inline imatrix operator*(const simatrix_slice& M1, const imatrix_slice& M2) { 03260 return spf_mm_mult<simatrix,imatrix_slice,imatrix,sparse_idot>(M1.A,M2); 03261 } 03262 03264 03270 inline imatrix operator*(const imatrix_slice& M1, const srmatrix_slice& M2) { 03271 return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(M1,M2.A); 03272 } 03273 03275 03281 inline imatrix operator*(const rmatrix_slice& M1, const simatrix_slice& M2) { 03282 return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(M1,M2.A); 03283 } 03284 03286 03292 inline imatrix operator*(const imatrix_slice& M1, const simatrix_slice& M2) { 03293 return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(M1,M2.A); 03294 } 03295 03297 03303 inline sivector operator*(const simatrix_slice& M, const srvector& v) { 03304 return spsp_mv_mult<simatrix,srvector,sivector,sparse_idot,interval>(M.A,v); 03305 } 03306 03308 03314 inline sivector operator*(const srmatrix_slice& M, const sivector& v) { 03315 return spsp_mv_mult<srmatrix,sivector,sivector,sparse_idot,interval>(M.A,v); 03316 } 03317 03319 03325 inline sivector operator*(const simatrix_slice& M, const sivector& v) { 03326 return spsp_mv_mult<simatrix,sivector,sivector,sparse_idot,interval>(M.A,v); 03327 } 03328 03330 03336 inline sivector operator*(const simatrix_slice& M, const srvector_slice& v) { 03337 return spsl_mv_mult<simatrix,srvector_slice,sivector,sparse_idot,interval>(M.A,v); 03338 } 03339 03341 03347 inline sivector operator*(const srmatrix_slice& M, const sivector_slice& v) { 03348 return spsl_mv_mult<srmatrix,sivector_slice,sivector,sparse_idot,interval>(M.A,v); 03349 } 03350 03352 03358 inline sivector operator*(const simatrix_slice& M, const sivector_slice& v) { 03359 return spsl_mv_mult<simatrix,sivector_slice,sivector,sparse_idot,interval>(M.A,v); 03360 } 03361 03363 03369 inline ivector operator*(const simatrix_slice& M, const rvector& v) { 03370 return spf_mv_mult<simatrix,rvector,ivector,sparse_idot>(M.A,v); 03371 } 03372 03374 03380 inline ivector operator*(const srmatrix_slice& M, const ivector& v) { 03381 return spf_mv_mult<srmatrix,ivector,ivector,sparse_idot>(M.A,v); 03382 } 03383 03385 03391 inline ivector operator*(const simatrix_slice& M, const ivector& v) { 03392 return spf_mv_mult<simatrix,ivector,ivector,sparse_idot>(M.A,v); 03393 } 03394 03396 03402 inline ivector operator*(const simatrix_slice& M, const rvector_slice& v) { 03403 return spf_mv_mult<simatrix,rvector_slice,ivector,sparse_idot>(M.A,v); 03404 } 03405 03407 03413 inline ivector operator*(const srmatrix_slice& M, const ivector_slice& v) { 03414 return spf_mv_mult<srmatrix,ivector_slice,ivector,sparse_idot>(M.A,v); 03415 } 03416 03418 03424 inline ivector operator*(const simatrix_slice& M, const ivector_slice& v) { 03425 return spf_mv_mult<simatrix,ivector_slice,ivector,sparse_idot>(M.A,v); 03426 } 03427 03429 inline simatrix operator/(const simatrix_slice& M, const real& r) { 03430 return sp_ms_div<simatrix,real,simatrix>(M.A,r); 03431 } 03432 03434 inline simatrix operator/(const simatrix_slice& M, const interval& r) { 03435 return sp_ms_div<simatrix,interval,simatrix>(M.A,r); 03436 } 03437 03439 inline simatrix operator/(const srmatrix_slice& M, const interval& r) { 03440 return sp_ms_div<srmatrix,interval,simatrix>(M.A,r); 03441 } 03442 03444 inline simatrix operator*(const simatrix_slice& M, const real& r) { 03445 return sp_ms_mult<simatrix,real,simatrix>(M.A,r); 03446 } 03447 03449 inline simatrix operator*(const simatrix_slice& M, const interval& r) { 03450 return sp_ms_mult<simatrix,interval,simatrix>(M.A,r); 03451 } 03452 03454 inline simatrix operator*(const srmatrix_slice& M, const interval& r) { 03455 return sp_ms_mult<srmatrix,interval,simatrix>(M.A,r); 03456 } 03457 03459 inline simatrix operator*(const real& r, const simatrix_slice& M) { 03460 return sp_sm_mult<real,simatrix,simatrix>(r,M.A); 03461 } 03462 03464 inline simatrix operator*(const interval& r, const srmatrix_slice& M) { 03465 return sp_sm_mult<interval,srmatrix,simatrix>(r,M.A); 03466 } 03467 03469 inline simatrix operator*(const interval& r, const simatrix_slice& M) { 03470 return sp_sm_mult<interval,simatrix,simatrix>(r,M.A); 03471 } 03472 03474 inline simatrix operator+(const simatrix_slice& M1, const srmatrix_slice& M2) { 03475 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A); 03476 } 03477 03479 inline simatrix operator+(const srmatrix_slice& M1, const simatrix_slice& M2) { 03480 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03481 } 03482 03484 inline simatrix operator+(const simatrix_slice& M1, const simatrix_slice& M2) { 03485 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03486 } 03487 03489 inline simatrix operator+(const simatrix_slice& M1, const srmatrix& M2) { 03490 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1.A,M2); 03491 } 03492 03494 inline simatrix operator+(const srmatrix_slice& M1, const simatrix& M2) { 03495 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1.A,M2); 03496 } 03497 03499 inline simatrix operator+(const simatrix_slice& M1, const simatrix& M2) { 03500 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1.A,M2); 03501 } 03502 03504 inline simatrix operator+(const simatrix& M1, const srmatrix_slice& M2) { 03505 return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1,M2.A); 03506 } 03507 03509 inline simatrix operator+(const srmatrix& M1, const simatrix_slice& M2) { 03510 return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1,M2.A); 03511 } 03512 03514 inline simatrix operator+(const simatrix& M1, const simatrix_slice& M2) { 03515 return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1,M2.A); 03516 } 03517 03519 inline imatrix operator+(const simatrix_slice& M1, const rmatrix& M2) { 03520 return spf_mm_add<simatrix,rmatrix,imatrix>(M1.A,M2); 03521 } 03522 03524 inline imatrix operator+(const srmatrix_slice& M1, const imatrix& M2) { 03525 return spf_mm_add<srmatrix,imatrix,imatrix>(M1.A,M2); 03526 } 03527 03529 inline imatrix operator+(const simatrix_slice& M1, const imatrix& M2) { 03530 return spf_mm_add<simatrix,imatrix,imatrix>(M1.A,M2); 03531 } 03532 03534 inline imatrix operator+(const imatrix& M1, const srmatrix_slice& M2) { 03535 return fsp_mm_add<imatrix,srmatrix,imatrix>(M1,M2.A); 03536 } 03537 03539 inline imatrix operator+(const rmatrix& M1, const simatrix_slice& M2) { 03540 return fsp_mm_add<rmatrix,simatrix,imatrix>(M1,M2.A); 03541 } 03542 03544 inline imatrix operator+(const imatrix& M1, const simatrix_slice& M2) { 03545 return fsp_mm_add<imatrix,simatrix,imatrix>(M1,M2.A); 03546 } 03547 03549 inline imatrix operator+(const simatrix_slice& M1, const rmatrix_slice& M2) { 03550 return spf_mm_add<simatrix,rmatrix_slice,imatrix>(M1.A,M2); 03551 } 03552 03554 inline imatrix operator+(const srmatrix_slice& M1, const imatrix_slice& M2) { 03555 return spf_mm_add<srmatrix,imatrix_slice,imatrix>(M1.A,M2); 03556 } 03557 03559 inline imatrix operator+(const simatrix_slice& M1, const imatrix_slice& M2) { 03560 return spf_mm_add<simatrix,imatrix_slice,imatrix>(M1.A,M2); 03561 } 03562 03564 inline imatrix operator+(const imatrix_slice& M1, const srmatrix_slice& M2) { 03565 return fsp_mm_add<imatrix_slice,srmatrix,imatrix>(M1,M2.A); 03566 } 03567 03569 inline imatrix operator+(const rmatrix_slice& M1, const simatrix_slice& M2) { 03570 return fsp_mm_add<rmatrix_slice,simatrix,imatrix>(M1,M2.A); 03571 } 03572 03574 inline imatrix operator+(const imatrix_slice& M1, const simatrix_slice& M2) { 03575 return fsp_mm_add<imatrix_slice,simatrix,imatrix>(M1,M2.A); 03576 } 03577 03579 inline simatrix operator-(const simatrix_slice& M1, const srmatrix_slice& M2) { 03580 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A); 03581 } 03582 03584 inline simatrix operator-(const srmatrix_slice& M1, const simatrix_slice& M2) { 03585 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03586 } 03587 03589 inline simatrix operator-(const simatrix_slice& M1, const simatrix_slice& M2) { 03590 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03591 } 03592 03594 inline simatrix operator-(const simatrix_slice& M1, const srmatrix& M2) { 03595 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1.A,M2); 03596 } 03597 03599 inline simatrix operator-(const srmatrix_slice& M1, const simatrix& M2) { 03600 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1.A,M2); 03601 } 03602 03604 inline simatrix operator-(const simatrix_slice& M1, const simatrix& M2) { 03605 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1.A,M2); 03606 } 03607 03609 inline simatrix operator-(const simatrix& M1, const srmatrix_slice& M2) { 03610 return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1,M2.A); 03611 } 03612 03614 inline simatrix operator-(const srmatrix& M1, const simatrix_slice& M2) { 03615 return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1,M2.A); 03616 } 03617 03619 inline simatrix operator-(const simatrix& M1, const simatrix_slice& M2) { 03620 return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1,M2.A); 03621 } 03622 03624 inline imatrix operator-(const simatrix_slice& M1, const rmatrix& M2) { 03625 return spf_mm_sub<simatrix,rmatrix,imatrix>(M1.A,M2); 03626 } 03627 03629 inline imatrix operator-(const srmatrix_slice& M1, const imatrix& M2) { 03630 return spf_mm_sub<srmatrix,imatrix,imatrix>(M1.A,M2); 03631 } 03632 03634 inline imatrix operator-(const simatrix_slice& M1, const imatrix& M2) { 03635 return spf_mm_sub<simatrix,imatrix,imatrix>(M1.A,M2); 03636 } 03637 03639 inline imatrix operator-(const imatrix& M1, const srmatrix_slice& M2) { 03640 return fsp_mm_sub<imatrix,srmatrix,imatrix>(M1,M2.A); 03641 } 03642 03644 inline imatrix operator-(const rmatrix& M1, const simatrix_slice& M2) { 03645 return fsp_mm_sub<rmatrix,simatrix,imatrix>(M1,M2.A); 03646 } 03647 03649 inline imatrix operator-(const imatrix& M1, const simatrix_slice& M2) { 03650 return fsp_mm_sub<imatrix,simatrix,imatrix>(M1,M2.A); 03651 } 03652 03654 inline imatrix operator-(const simatrix_slice& M1, const rmatrix_slice& M2) { 03655 return spf_mm_sub<simatrix,rmatrix_slice,imatrix>(M1.A,M2); 03656 } 03657 03659 inline imatrix operator-(const srmatrix_slice& M1, const imatrix_slice& M2) { 03660 return spf_mm_sub<srmatrix,imatrix_slice,imatrix>(M1.A,M2); 03661 } 03662 03664 inline imatrix operator-(const simatrix_slice& M1, const imatrix_slice& M2) { 03665 return spf_mm_sub<simatrix,imatrix_slice,imatrix>(M1.A,M2); 03666 } 03667 03669 inline imatrix operator-(const imatrix_slice& M1, const srmatrix_slice& M2) { 03670 return fsp_mm_sub<imatrix_slice,srmatrix,imatrix>(M1,M2.A); 03671 } 03672 03674 inline imatrix operator-(const rmatrix_slice& M1, const simatrix_slice& M2) { 03675 return fsp_mm_sub<rmatrix_slice,simatrix,imatrix>(M1,M2.A); 03676 } 03677 03679 inline imatrix operator-(const imatrix_slice& M1, const simatrix_slice& M2) { 03680 return fsp_mm_sub<imatrix_slice,simatrix,imatrix>(M1,M2.A); 03681 } 03682 03684 inline simatrix operator|(const simatrix_slice& M1, const srmatrix_slice& M2) { 03685 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A); 03686 } 03687 03689 inline simatrix operator|(const srmatrix_slice& M1, const simatrix_slice& M2) { 03690 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03691 } 03692 03694 inline simatrix operator|(const simatrix_slice& M1, const simatrix_slice& M2) { 03695 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03696 } 03697 03699 inline simatrix operator|(const simatrix_slice& M1, const srmatrix& M2) { 03700 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1.A,M2); 03701 } 03702 03704 inline simatrix operator|(const srmatrix_slice& M1, const simatrix& M2) { 03705 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1.A,M2); 03706 } 03707 03709 inline simatrix operator|(const simatrix_slice& M1, const simatrix& M2) { 03710 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1.A,M2); 03711 } 03712 03714 inline simatrix operator|(const simatrix& M1, const srmatrix_slice& M2) { 03715 return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1,M2.A); 03716 } 03717 03719 inline simatrix operator|(const srmatrix& M1, const simatrix_slice& M2) { 03720 return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1,M2.A); 03721 } 03722 03724 inline simatrix operator|(const simatrix& M1, const simatrix_slice& M2) { 03725 return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1,M2.A); 03726 } 03727 03729 inline imatrix operator|(const simatrix_slice& M1, const rmatrix& M2) { 03730 return spf_mm_hull<simatrix,rmatrix,imatrix>(M1.A,M2); 03731 } 03732 03734 inline imatrix operator|(const srmatrix_slice& M1, const imatrix& M2) { 03735 return spf_mm_hull<srmatrix,imatrix,imatrix>(M1.A,M2); 03736 } 03737 03739 inline imatrix operator|(const simatrix_slice& M1, const imatrix& M2) { 03740 return spf_mm_hull<simatrix,imatrix,imatrix>(M1.A,M2); 03741 } 03742 03744 inline imatrix operator|(const imatrix& M1, const srmatrix_slice& M2) { 03745 return fsp_mm_hull<imatrix,srmatrix,imatrix>(M1,M2.A); 03746 } 03747 03749 inline imatrix operator|(const rmatrix& M1, const simatrix_slice& M2) { 03750 return fsp_mm_hull<rmatrix,simatrix,imatrix>(M1,M2.A); 03751 } 03752 03754 inline imatrix operator|(const imatrix& M1, const simatrix_slice& M2) { 03755 return fsp_mm_hull<imatrix,simatrix,imatrix>(M1,M2.A); 03756 } 03757 03759 inline imatrix operator|(const simatrix_slice& M1, const rmatrix_slice& M2) { 03760 return spf_mm_hull<simatrix,rmatrix_slice,imatrix>(M1.A,M2); 03761 } 03762 03764 inline imatrix operator|(const srmatrix_slice& M1, const imatrix_slice& M2) { 03765 return spf_mm_hull<srmatrix,imatrix_slice,imatrix>(M1.A,M2); 03766 } 03767 03769 inline imatrix operator|(const simatrix_slice& M1, const imatrix_slice& M2) { 03770 return spf_mm_hull<simatrix,imatrix_slice,imatrix>(M1.A,M2); 03771 } 03772 03774 inline imatrix operator|(const imatrix_slice& M1, const srmatrix_slice& M2) { 03775 return fsp_mm_hull<imatrix_slice,srmatrix,imatrix>(M1,M2.A); 03776 } 03777 03779 inline imatrix operator|(const rmatrix_slice& M1, const simatrix_slice& M2) { 03780 return fsp_mm_hull<rmatrix_slice,simatrix,imatrix>(M1,M2.A); 03781 } 03782 03784 inline imatrix operator|(const imatrix_slice& M1, const simatrix_slice& M2) { 03785 return fsp_mm_hull<imatrix_slice,simatrix,imatrix>(M1,M2.A); 03786 } 03787 03789 inline simatrix operator|(const srmatrix_slice& M1, const srmatrix_slice& M2) { 03790 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1.A,M2.A); 03791 } 03792 03794 inline simatrix operator|(const srmatrix_slice& M1, const srmatrix& M2) { 03795 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1.A,M2); 03796 } 03797 03799 inline simatrix operator|(const srmatrix& M1, const srmatrix_slice& M2) { 03800 return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1,M2.A); 03801 } 03802 03804 inline imatrix operator|(const srmatrix_slice& M1, const rmatrix& M2) { 03805 return spf_mm_hull<srmatrix,rmatrix,imatrix>(M1.A,M2); 03806 } 03807 03809 inline imatrix operator|(const rmatrix& M1, const srmatrix_slice& M2) { 03810 return fsp_mm_hull<rmatrix,srmatrix,imatrix>(M1,M2.A); 03811 } 03812 03814 inline imatrix operator|(const srmatrix_slice& M1, const rmatrix_slice& M2) { 03815 return spf_mm_hull<srmatrix,rmatrix_slice,imatrix>(M1.A,M2); 03816 } 03817 03819 inline imatrix operator|(const rmatrix_slice& M1, const srmatrix_slice& M2) { 03820 return fsp_mm_hull<rmatrix_slice,srmatrix,imatrix>(M1,M2.A); 03821 } 03822 03824 inline simatrix operator&(const simatrix_slice& M1, const simatrix_slice& M2) { 03825 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1.A,M2.A); 03826 } 03827 03829 inline simatrix operator&(const simatrix_slice& M1, const simatrix& M2) { 03830 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1.A,M2); 03831 } 03832 03834 inline simatrix operator&(const simatrix& M1, const simatrix_slice& M2) { 03835 return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1,M2.A); 03836 } 03837 03839 inline imatrix operator&(const simatrix_slice& M1, const imatrix& M2) { 03840 return spf_mm_intersect<simatrix,imatrix,imatrix>(M1.A,M2); 03841 } 03842 03844 inline imatrix operator&(const imatrix& M1, const simatrix_slice& M2) { 03845 return fsp_mm_intersect<imatrix,simatrix,imatrix>(M1,M2.A); 03846 } 03847 03849 inline imatrix operator&(const simatrix_slice& M1, const imatrix_slice& M2) { 03850 return spf_mm_intersect<simatrix,imatrix_slice,imatrix>(M1.A,M2); 03851 } 03852 03854 inline imatrix operator&(const imatrix_slice& M1, const simatrix_slice& M2) { 03855 return fsp_mm_intersect<imatrix_slice,simatrix,imatrix>(M1,M2.A); 03856 } 03857 03859 inline bool operator==(const simatrix_slice& M1, const srmatrix_slice& M2) { 03860 return spsp_mm_comp(M1.A,M2.A); 03861 } 03862 03864 inline bool operator==(const srmatrix_slice& M1, const simatrix_slice& M2) { 03865 return spsp_mm_comp(M1.A,M2.A); 03866 } 03867 03869 inline bool operator==(const simatrix_slice& M1, const simatrix_slice& M2) { 03870 return spsp_mm_comp(M1.A,M2.A); 03871 } 03872 03874 inline bool operator==(const simatrix_slice& M1, const srmatrix& M2) { 03875 return spsp_mm_comp(M1.A,M2); 03876 } 03877 03879 inline bool operator==(const srmatrix_slice& M1, const simatrix& M2) { 03880 return spsp_mm_comp(M1.A,M2); 03881 } 03882 03884 inline bool operator==(const simatrix_slice& M1, const simatrix& M2) { 03885 return spsp_mm_comp(M1.A,M2); 03886 } 03887 03889 inline bool operator==(const simatrix& M1, const srmatrix_slice& M2) { 03890 return spsp_mm_comp(M1,M2.A); 03891 } 03892 03894 inline bool operator==(const srmatrix& M1, const simatrix_slice& M2) { 03895 return spsp_mm_comp(M1,M2.A); 03896 } 03897 03899 inline bool operator==(const simatrix& M1, const simatrix_slice& M2) { 03900 return spsp_mm_comp(M1,M2.A); 03901 } 03902 03904 inline bool operator==(const simatrix_slice& M1, const rmatrix& M2) { 03905 return spf_mm_comp(M1.A,M2); 03906 } 03907 03909 inline bool operator==(const srmatrix_slice& M1, const imatrix& M2) { 03910 return spf_mm_comp(M1.A,M2); 03911 } 03912 03914 inline bool operator==(const simatrix_slice& M1, const imatrix& M2) { 03915 return spf_mm_comp(M1.A,M2); 03916 } 03917 03919 inline bool operator==(const imatrix& M1, const srmatrix_slice& M2) { 03920 return fsp_mm_comp(M1,M2.A); 03921 } 03922 03924 inline bool operator==(const rmatrix& M1, const simatrix_slice& M2) { 03925 return fsp_mm_comp(M1,M2.A); 03926 } 03927 03929 inline bool operator==(const imatrix& M1, const simatrix_slice& M2) { 03930 return fsp_mm_comp(M1,M2.A); 03931 } 03932 03934 inline bool operator==(const imatrix_slice& M1, const srmatrix_slice& M2) { 03935 return fsp_mm_comp(M1,M2.A); 03936 } 03937 03939 inline bool operator==(const rmatrix_slice& M1, const simatrix_slice& M2) { 03940 return fsp_mm_comp(M1,M2.A); 03941 } 03942 03944 inline bool operator==(const imatrix_slice& M1, const simatrix_slice& M2) { 03945 return fsp_mm_comp(M1,M2.A); 03946 } 03947 03949 inline bool operator==(const simatrix_slice& M1, const rmatrix_slice& M2) { 03950 return spf_mm_comp(M1.A,M2); 03951 } 03952 03954 inline bool operator==(const srmatrix_slice& M1, const imatrix_slice& M2) { 03955 return spf_mm_comp(M1.A,M2); 03956 } 03957 03959 inline bool operator==(const simatrix_slice& M1, const imatrix_slice& M2) { 03960 return spf_mm_comp(M1.A,M2); 03961 } 03962 03964 inline bool operator!=(const simatrix_slice& M1, const srmatrix_slice& M2) { 03965 return !spsp_mm_comp(M1.A,M2.A); 03966 } 03967 03969 inline bool operator!=(const srmatrix_slice& M1, const simatrix_slice& M2) { 03970 return !spsp_mm_comp(M1.A,M2.A); 03971 } 03972 03974 inline bool operator!=(const simatrix_slice& M1, const simatrix_slice& M2) { 03975 return !spsp_mm_comp(M1.A,M2.A); 03976 } 03977 03979 inline bool operator!=(const simatrix_slice& M1, const srmatrix& M2) { 03980 return !spsp_mm_comp(M1.A,M2); 03981 } 03982 03984 inline bool operator!=(const srmatrix_slice& M1, const simatrix& M2) { 03985 return !spsp_mm_comp(M1.A,M2); 03986 } 03987 03989 inline bool operator!=(const simatrix_slice& M1, const simatrix& M2) { 03990 return !spsp_mm_comp(M1.A,M2); 03991 } 03992 03994 inline bool operator!=(const simatrix& M1, const srmatrix_slice& M2) { 03995 return !spsp_mm_comp(M1,M2.A); 03996 } 03997 03999 inline bool operator!=(const srmatrix& M1, const simatrix_slice& M2) { 04000 return !spsp_mm_comp(M1,M2.A); 04001 } 04002 04004 inline bool operator!=(const simatrix& M1, const simatrix_slice& M2) { 04005 return !spsp_mm_comp(M1,M2.A); 04006 } 04007 04009 inline bool operator!=(const simatrix_slice& M1, const rmatrix& M2) { 04010 return !spf_mm_comp(M1.A,M2); 04011 } 04012 04014 inline bool operator!=(const srmatrix_slice& M1, const imatrix& M2) { 04015 return !spf_mm_comp(M1.A,M2); 04016 } 04017 04019 inline bool operator!=(const simatrix_slice& M1, const imatrix& M2) { 04020 return !spf_mm_comp(M1.A,M2); 04021 } 04022 04024 inline bool operator!=(const imatrix& M1, const srmatrix_slice& M2) { 04025 return !fsp_mm_comp(M1,M2.A); 04026 } 04027 04029 inline bool operator!=(const rmatrix& M1, const simatrix_slice& M2) { 04030 return !fsp_mm_comp(M1,M2.A); 04031 } 04032 04034 inline bool operator!=(const imatrix& M1, const simatrix_slice& M2) { 04035 return !fsp_mm_comp(M1,M2.A); 04036 } 04037 04039 inline bool operator!=(const imatrix_slice& M1, const srmatrix_slice& M2) { 04040 return !fsp_mm_comp(M1,M2.A); 04041 } 04042 04044 inline bool operator!=(const rmatrix_slice& M1, const simatrix_slice& M2) { 04045 return !fsp_mm_comp(M1,M2.A); 04046 } 04047 04049 inline bool operator!=(const imatrix_slice& M1, const simatrix_slice& M2) { 04050 return !fsp_mm_comp(M1,M2.A); 04051 } 04052 04054 inline bool operator!=(const simatrix_slice& M1, const rmatrix_slice& M2) { 04055 return !spf_mm_comp(M1.A,M2); 04056 } 04057 04059 inline bool operator!=(const srmatrix_slice& M1, const imatrix_slice& M2) { 04060 return !spf_mm_comp(M1.A,M2); 04061 } 04062 04064 inline bool operator!=(const simatrix_slice& M1, const imatrix_slice& M2) { 04065 return !spf_mm_comp(M1.A,M2); 04066 } 04067 04069 inline bool operator<(const srmatrix_slice& M1, const simatrix_slice& M2) { 04070 return spsp_mm_less<srmatrix,simatrix,interval>(M1.A,M2.A); 04071 } 04072 04074 inline bool operator<(const simatrix_slice& M1, const simatrix_slice& M2) { 04075 return spsp_mm_less<simatrix,simatrix,interval>(M1.A,M2.A); 04076 } 04077 04079 inline bool operator<(const srmatrix_slice& M1, const simatrix& M2) { 04080 return spsp_mm_less<srmatrix,simatrix,interval>(M1.A,M2); 04081 } 04082 04084 inline bool operator<(const simatrix_slice& M1, const simatrix& M2) { 04085 return spsp_mm_less<simatrix,simatrix,interval>(M1.A,M2); 04086 } 04087 04089 inline bool operator<(const srmatrix& M1, const simatrix_slice& M2) { 04090 return spsp_mm_less<srmatrix,simatrix,interval>(M1,M2.A); 04091 } 04092 04094 inline bool operator<(const simatrix& M1, const simatrix_slice& M2) { 04095 return spsp_mm_less<simatrix,simatrix,interval>(M1,M2.A); 04096 } 04097 04099 inline bool operator<(const srmatrix_slice& M1, const imatrix& M2) { 04100 return spf_mm_less<srmatrix,imatrix,interval>(M1.A,M2); 04101 } 04102 04104 inline bool operator<(const simatrix_slice& M1, const imatrix& M2) { 04105 return spf_mm_less<simatrix,imatrix,interval>(M1.A,M2); 04106 } 04107 04109 inline bool operator<(const rmatrix& M1, const simatrix_slice& M2) { 04110 return fsp_mm_less<rmatrix,simatrix,interval>(M1,M2.A); 04111 } 04112 04114 inline bool operator<(const imatrix& M1, const simatrix_slice& M2) { 04115 return fsp_mm_less<imatrix,simatrix,interval>(M1,M2.A); 04116 } 04117 04119 inline bool operator<(const rmatrix_slice& M1, const simatrix_slice& M2) { 04120 return fsp_mm_less<rmatrix_slice,simatrix,interval>(M1,M2.A); 04121 } 04122 04124 inline bool operator<(const imatrix_slice& M1, const simatrix_slice& M2) { 04125 return fsp_mm_less<imatrix_slice,simatrix,interval>(M1,M2.A); 04126 } 04127 04129 inline bool operator<(const srmatrix_slice& M1, const imatrix_slice& M2) { 04130 return spf_mm_less<srmatrix,imatrix_slice,interval>(M1.A,M2); 04131 } 04132 04134 inline bool operator<(const simatrix_slice& M1, const imatrix_slice& M2) { 04135 return spf_mm_less<simatrix,imatrix_slice,interval>(M1.A,M2); 04136 } 04137 04139 inline bool operator<=(const srmatrix_slice& M1, const simatrix_slice& M2) { 04140 return spsp_mm_leq<srmatrix,simatrix,interval>(M1.A,M2.A); 04141 } 04142 04144 inline bool operator<=(const simatrix_slice& M1, const simatrix_slice& M2) { 04145 return spsp_mm_leq<simatrix,simatrix,interval>(M1.A,M2.A); 04146 } 04147 04149 inline bool operator<=(const srmatrix_slice& M1, const simatrix& M2) { 04150 return spsp_mm_leq<srmatrix,simatrix,interval>(M1.A,M2); 04151 } 04152 04154 inline bool operator<=(const simatrix_slice& M1, const simatrix& M2) { 04155 return spsp_mm_leq<simatrix,simatrix,interval>(M1.A,M2); 04156 } 04157 04159 inline bool operator<=(const srmatrix& M1, const simatrix_slice& M2) { 04160 return spsp_mm_leq<srmatrix,simatrix,interval>(M1,M2.A); 04161 } 04162 04164 inline bool operator<=(const simatrix& M1, const simatrix_slice& M2) { 04165 return spsp_mm_leq<simatrix,simatrix,interval>(M1,M2.A); 04166 } 04167 04169 inline bool operator<=(const srmatrix_slice& M1, const imatrix& M2) { 04170 return spf_mm_leq<srmatrix,imatrix,interval>(M1.A,M2); 04171 } 04172 04174 inline bool operator<=(const simatrix_slice& M1, const imatrix& M2) { 04175 return spf_mm_leq<simatrix,imatrix,interval>(M1.A,M2); 04176 } 04177 04179 inline bool operator<=(const rmatrix& M1, const simatrix_slice& M2) { 04180 return fsp_mm_leq<rmatrix,simatrix,interval>(M1,M2.A); 04181 } 04182 04184 inline bool operator<=(const imatrix& M1, const simatrix_slice& M2) { 04185 return fsp_mm_leq<imatrix,simatrix,interval>(M1,M2.A); 04186 } 04187 04189 inline bool operator<=(const rmatrix_slice& M1, const simatrix_slice& M2) { 04190 return fsp_mm_leq<rmatrix_slice,simatrix,interval>(M1,M2.A); 04191 } 04192 04194 inline bool operator<=(const imatrix_slice& M1, const simatrix_slice& M2) { 04195 return fsp_mm_leq<imatrix_slice,simatrix,interval>(M1,M2.A); 04196 } 04197 04199 inline bool operator<=(const srmatrix_slice& M1, const imatrix_slice& M2) { 04200 return spf_mm_leq<srmatrix,imatrix_slice,interval>(M1.A,M2); 04201 } 04202 04204 inline bool operator<=(const simatrix_slice& M1, const imatrix_slice& M2) { 04205 return spf_mm_leq<simatrix,imatrix_slice,interval>(M1.A,M2); 04206 } 04207 04209 inline bool operator>(const simatrix_slice& M1, const srmatrix_slice& M2) { 04210 return spsp_mm_greater<simatrix,srmatrix,interval>(M1.A,M2.A); 04211 } 04212 04214 inline bool operator>(const simatrix_slice& M1, const simatrix_slice& M2) { 04215 return spsp_mm_greater<simatrix,simatrix,interval>(M1.A,M2.A); 04216 } 04217 04219 inline bool operator>(const simatrix_slice& M1, const srmatrix& M2) { 04220 return spsp_mm_greater<simatrix,srmatrix,interval>(M1.A,M2); 04221 } 04222 04224 inline bool operator>(const simatrix_slice& M1, const simatrix& M2) { 04225 return spsp_mm_greater<simatrix,simatrix,interval>(M1.A,M2); 04226 } 04227 04229 inline bool operator>(const simatrix& M1, const srmatrix_slice& M2) { 04230 return spsp_mm_greater<simatrix,srmatrix,interval>(M1,M2.A); 04231 } 04232 04234 inline bool operator>(const simatrix& M1, const simatrix_slice& M2) { 04235 return spsp_mm_greater<simatrix,simatrix,interval>(M1,M2.A); 04236 } 04237 04239 inline bool operator>(const simatrix_slice& M1, const rmatrix& M2) { 04240 return spf_mm_greater<simatrix,rmatrix,interval>(M1.A,M2); 04241 } 04242 04244 inline bool operator>(const simatrix_slice& M1, const imatrix& M2) { 04245 return spf_mm_greater<simatrix,imatrix,interval>(M1.A,M2); 04246 } 04247 04249 inline bool operator>(const imatrix& M1, const srmatrix_slice& M2) { 04250 return fsp_mm_greater<imatrix,srmatrix,interval>(M1,M2.A); 04251 } 04252 04254 inline bool operator>(const imatrix& M1, const simatrix_slice& M2) { 04255 return fsp_mm_greater<imatrix,simatrix,interval>(M1,M2.A); 04256 } 04257 04259 inline bool operator>(const imatrix_slice& M1, const srmatrix_slice& M2) { 04260 return fsp_mm_greater<imatrix,srmatrix,interval>(M1,M2.A); 04261 } 04262 04264 inline bool operator>(const imatrix_slice& M1, const simatrix_slice& M2) { 04265 return fsp_mm_greater<imatrix_slice,simatrix,interval>(M1,M2.A); 04266 } 04267 04269 inline bool operator>(const simatrix_slice& M1, const rmatrix_slice& M2) { 04270 return spf_mm_greater<simatrix,rmatrix_slice,interval>(M1.A,M2); 04271 } 04272 04274 inline bool operator>(const simatrix_slice& M1, const imatrix_slice& M2) { 04275 return spf_mm_greater<simatrix,imatrix_slice,interval>(M1.A,M2); 04276 } 04277 04279 inline bool operator>=(const simatrix_slice& M1, const srmatrix_slice& M2) { 04280 return spsp_mm_geq<simatrix,srmatrix,interval>(M1.A,M2.A); 04281 } 04282 04284 inline bool operator>=(const simatrix_slice& M1, const simatrix_slice& M2) { 04285 return spsp_mm_geq<simatrix,simatrix,interval>(M1.A,M2.A); 04286 } 04287 04289 inline bool operator>=(const simatrix_slice& M1, const srmatrix& M2) { 04290 return spsp_mm_geq<simatrix,srmatrix,interval>(M1.A,M2); 04291 } 04292 04294 inline bool operator>=(const simatrix_slice& M1, const simatrix& M2) { 04295 return spsp_mm_geq<simatrix,simatrix,interval>(M1.A,M2); 04296 } 04297 04299 inline bool operator>=(const simatrix& M1, const srmatrix_slice& M2) { 04300 return spsp_mm_geq<simatrix,srmatrix,interval>(M1,M2.A); 04301 } 04302 04304 inline bool operator>=(const simatrix& M1, const simatrix_slice& M2) { 04305 return spsp_mm_geq<simatrix,simatrix,interval>(M1,M2.A); 04306 } 04307 04309 inline bool operator>=(const simatrix_slice& M1, const rmatrix& M2) { 04310 return spf_mm_geq<simatrix,rmatrix,interval>(M1.A,M2); 04311 } 04312 04314 inline bool operator>=(const simatrix_slice& M1, const imatrix& M2) { 04315 return spf_mm_geq<simatrix,imatrix,interval>(M1.A,M2); 04316 } 04317 04319 inline bool operator>=(const imatrix& M1, const srmatrix_slice& M2) { 04320 return fsp_mm_geq<imatrix,srmatrix,interval>(M1,M2.A); 04321 } 04322 04324 inline bool operator>=(const imatrix& M1, const simatrix_slice& M2) { 04325 return fsp_mm_geq<imatrix,simatrix,interval>(M1,M2.A); 04326 } 04327 04329 inline bool operator>=(const imatrix_slice& M1, const srmatrix_slice& M2) { 04330 return fsp_mm_geq<imatrix,srmatrix,interval>(M1,M2.A); 04331 } 04332 04334 inline bool operator>=(const imatrix_slice& M1, const simatrix_slice& M2) { 04335 return fsp_mm_geq<imatrix_slice,simatrix,interval>(M1,M2.A); 04336 } 04337 04339 inline bool operator>=(const simatrix_slice& M1, const rmatrix_slice& M2) { 04340 return spf_mm_geq<simatrix,rmatrix_slice,interval>(M1.A,M2); 04341 } 04342 04344 inline bool operator>=(const simatrix_slice& M1, const imatrix_slice& M2) { 04345 return spf_mm_geq<simatrix,imatrix_slice,interval>(M1.A,M2); 04346 } 04347 04349 inline bool operator!(const simatrix_slice& M) { 04350 return sp_m_not(M.A); 04351 } 04352 04354 04359 inline std::ostream& operator<<(std::ostream& os, const simatrix_slice& M) { 04360 return sp_m_output<simatrix,interval>(os, M.A); 04361 } 04362 04364 04369 inline std::istream& operator>>(std::istream& is, simatrix_slice& M) { 04370 simatrix tmp(M.A.m, M.A.n); 04371 sp_m_input<simatrix,interval>(is, tmp); 04372 M = tmp; 04373 return is; 04374 } 04375 04376 04378 04383 class simatrix_subv { 04384 private: 04385 simatrix_slice dat; 04386 bool row; 04387 int index; 04388 04389 simatrix_subv(simatrix& A, bool r, int i, int j, int k, int l) : dat(A,i,j,k,l), row(r) { 04390 if(row) index=i; else index=k; 04391 } 04392 04393 simatrix_subv(const simatrix& A, bool r, int i, int j, int k, int l) : dat(A,i,j,k,l), row(r) { 04394 if(row) index=i; else index=k; 04395 } 04396 04397 public: 04399 04403 interval& operator[](const int i) { 04404 if(row) { 04405 #if(CXSC_INDEX_CHECK) 04406 if(i<dat.A.lb2 || i>dat.A.ub2) 04407 cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)")); 04408 #endif 04409 return dat.element(index,i); 04410 } else { 04411 #if(CXSC_INDEX_CHECK) 04412 if(i<dat.A.lb1 || i>dat.A.ub1) 04413 cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)")); 04414 #endif 04415 return dat.element(i,index); 04416 } 04417 } 04418 04420 04423 const interval operator[](const int i) const{ 04424 if(row) { 04425 #if(CXSC_INDEX_CHECK) 04426 if(i<dat.A.lb2 || i>dat.A.ub2) 04427 cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)")); 04428 #endif 04429 return dat(index,i); 04430 } else { 04431 #if(CXSC_INDEX_CHECK) 04432 if(i<dat.A.lb1 || i>dat.A.ub1) 04433 cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)")); 04434 #endif 04435 return dat(i,index); 04436 } 04437 } 04438 04440 simatrix_subv& operator=(const real& v) { 04441 return sv_vs_assign(*this,v); 04442 } 04443 04445 simatrix_subv& operator=(const interval& v) { 04446 return sv_vs_assign(*this,v); 04447 } 04448 04450 simatrix_subv& operator=(const srvector& v) { 04451 return svsp_vv_assign(*this,v); 04452 } 04453 04455 simatrix_subv& operator=(const sivector& v) { 04456 return svsp_vv_assign(*this,v); 04457 } 04458 04460 simatrix_subv& operator=(const srvector_slice& v) { 04461 return svsl_vv_assign(*this,v); 04462 } 04463 04465 simatrix_subv& operator=(const sivector_slice& v) { 04466 return svsl_vv_assign(*this,v); 04467 } 04468 04470 simatrix_subv& operator=(const rvector& v) { 04471 return svf_vv_assign(*this,v); 04472 } 04473 04475 simatrix_subv& operator=(const ivector& v) { 04476 return svf_vv_assign(*this,v); 04477 } 04478 04480 simatrix_subv& operator=(const rvector_slice& v) { 04481 return svf_vv_assign(*this,v); 04482 } 04483 04485 simatrix_subv& operator=(const ivector_slice& v) { 04486 return svf_vv_assign(*this,v); 04487 } 04488 04490 simatrix_subv& operator=(const srmatrix_subv& v) { 04491 return svsp_vv_assign(*this,srvector(v)); 04492 } 04493 04495 simatrix_subv& operator=(const simatrix_subv& v) { 04496 return svsp_vv_assign(*this,sivector(v)); 04497 } 04498 04500 simatrix_subv& operator*=(const real&); 04502 simatrix_subv& operator*=(const interval&); 04504 simatrix_subv& operator/=(const real&); 04506 simatrix_subv& operator/=(const interval&); 04508 simatrix_subv& operator+=(const srvector&); 04510 simatrix_subv& operator+=(const srvector_slice&); 04512 simatrix_subv& operator+=(const rvector&); 04514 simatrix_subv& operator+=(const rvector_slice&); 04516 simatrix_subv& operator-=(const srvector&); 04518 simatrix_subv& operator-=(const srvector_slice&); 04520 simatrix_subv& operator-=(const rvector&); 04522 simatrix_subv& operator-=(const rvector_slice&); 04524 simatrix_subv& operator+=(const sivector&); 04526 simatrix_subv& operator+=(const sivector_slice&); 04528 simatrix_subv& operator+=(const ivector&); 04530 simatrix_subv& operator+=(const ivector_slice&); 04532 simatrix_subv& operator-=(const sivector&); 04534 simatrix_subv& operator-=(const sivector_slice&); 04536 simatrix_subv& operator-=(const ivector&); 04538 simatrix_subv& operator-=(const ivector_slice&); 04540 simatrix_subv& operator|=(const srvector&); 04542 simatrix_subv& operator|=(const srvector_slice&); 04544 simatrix_subv& operator|=(const rvector&); 04546 simatrix_subv& operator|=(const rvector_slice&); 04548 simatrix_subv& operator|=(const sivector&); 04550 simatrix_subv& operator|=(const sivector_slice&); 04552 simatrix_subv& operator|=(const ivector&); 04554 simatrix_subv& operator|=(const ivector_slice&); 04555 04556 friend sivector operator-(const simatrix_subv&); 04557 04558 friend std::istream& operator>>(std::istream&, simatrix_subv&); 04559 04560 friend int Lb(const simatrix_subv&); 04561 friend int Ub(const simatrix_subv&); 04562 friend int VecLen(const simatrix_subv&); 04563 friend srvector Inf(const simatrix_subv&); 04564 friend srvector Sup(const simatrix_subv&); 04565 04566 friend class srvector; 04567 friend class srmatrix; 04568 friend class srmatrix_slice; 04569 friend class sivector; 04570 friend class simatrix; 04571 friend class simatrix_slice; 04572 friend class scivector; 04573 friend class scimatrix; 04574 friend class scimatrix_slice; 04575 04576 #include "vector_friend_declarations.inl" 04577 }; 04578 04580 inline int Lb(const simatrix_subv& S) { 04581 if(S.row) 04582 return Lb(S.dat, 2); 04583 else 04584 return Lb(S.dat, 1); 04585 } 04586 04588 inline int Ub(const simatrix_subv& S) { 04589 if(S.row) 04590 return Ub(S.dat, 2); 04591 else 04592 return Ub(S.dat, 1); 04593 } 04594 04596 inline int VecLen(const simatrix_subv& S) { 04597 return Ub(S)-Lb(S)+1; 04598 } 04599 04601 inline srvector Inf(const simatrix_subv& S) { 04602 return Inf(sivector(S)); 04603 } 04604 04606 inline srvector Sup(const simatrix_subv& S) { 04607 return Sup(sivector(S)); 04608 } 04609 04611 inline srvector mid(const simatrix_subv& S) { 04612 return mid(sivector(S)); 04613 } 04614 04616 inline srvector diam(const simatrix_subv& S) { 04617 return diam(sivector(S)); 04618 } 04619 04621 inline sivector abs(const simatrix_subv& S) { 04622 return abs(sivector(S)); 04623 } 04624 04626 inline std::ostream& operator<<(std::ostream& os, const simatrix_subv& v) { 04627 os << sivector(v); 04628 return os; 04629 } 04630 04632 inline std::istream& operator>>(std::istream& is, simatrix_subv& v) { 04633 int n = 0; 04634 if(v.row) n=v.dat.A.n; else n=v.dat.A.m; 04635 sivector tmp(n); 04636 is >> tmp; 04637 v = tmp; 04638 return is; 04639 } 04640 04641 inline simatrix_subv simatrix::operator[](const cxscmatrix_column& c) { 04642 #if(CXSC_INDEX_CHECK) 04643 if(c.col()<lb2 || c.col()>ub2) 04644 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)")); 04645 #endif 04646 return simatrix_subv(*this, false, lb1, ub1, c.col(), c.col()); 04647 } 04648 04649 inline simatrix_subv simatrix::operator[](const int i) { 04650 #if(CXSC_INDEX_CHECK) 04651 if(i<lb1 || i>ub1) 04652 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int)")); 04653 #endif 04654 return simatrix_subv(*this, true, i, i, lb2, ub2); 04655 } 04656 04657 inline const simatrix_subv simatrix::operator[](const cxscmatrix_column& c) const { 04658 #if(CXSC_INDEX_CHECK) 04659 if(c.col()<lb2 || c.col()>ub2) 04660 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)")); 04661 #endif 04662 return simatrix_subv(*this, false, lb1, ub1, c.col(), c.col()); 04663 } 04664 04665 inline const simatrix_subv simatrix::operator[](const int i) const { 04666 #if(CXSC_INDEX_CHECK) 04667 if(i<lb1 || i>ub1) 04668 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int)")); 04669 #endif 04670 return simatrix_subv(*this, true, i, i, lb2, ub2); 04671 } 04672 04673 inline simatrix_subv simatrix_slice::operator[](const int i) { 04674 #if(CXSC_INDEX_CHECK) 04675 if(i<A.lb1 || i>A.ub1) 04676 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int")); 04677 #endif 04678 return simatrix_subv(*M, true, i, i, A.lb2, A.ub2); 04679 } 04680 04681 inline simatrix_subv simatrix_slice::operator[](const cxscmatrix_column& c) { 04682 #if(CXSC_INDEX_CHECK) 04683 if(c.col()<A.lb2 || c.col()>A.ub2) 04684 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)")); 04685 #endif 04686 return simatrix_subv(*M, false, A.lb1, A.ub1, c.col(), c.col()); 04687 } 04688 04689 inline const simatrix_subv simatrix_slice::operator[](const int i) const { 04690 #if(CXSC_INDEX_CHECK) 04691 if(i<A.lb1 || i>A.ub1) 04692 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int")); 04693 #endif 04694 return simatrix_subv(*M, true, i, i, A.lb2, A.ub2); 04695 } 04696 04697 inline const simatrix_subv simatrix_slice::operator[](const cxscmatrix_column& c) const { 04698 #if(CXSC_INDEX_CHECK) 04699 if(c.col()<A.lb2 || c.col()>A.ub2) 04700 cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)")); 04701 #endif 04702 return simatrix_subv(*M, false, A.lb1, A.ub1, c.col(), c.col()); 04703 } 04704 04705 inline sivector::sivector(const simatrix_subv& A) { 04706 int nnz = A.dat.A.get_nnz(); 04707 p.reserve(nnz); 04708 x.reserve(nnz); 04709 04710 if(A.row) { 04711 lb = A.dat.A.lb2; 04712 ub = A.dat.A.ub2; 04713 n = ub-lb+1; 04714 04715 for(int j=0 ; j<n ; j++) { 04716 for(int k=A.dat.A.p[j] ; k<A.dat.A.p[j+1] ; k++) { 04717 p.push_back(j); 04718 x.push_back(A.dat.A.x[k]); 04719 } 04720 } 04721 04722 } else { 04723 lb = A.dat.A.lb1; 04724 ub = A.dat.A.ub1; 04725 n = ub-lb+1; 04726 04727 for(unsigned int k=0 ; k<A.dat.A.ind.size() ; k++) { 04728 p.push_back(A.dat.A.ind[k]); 04729 x.push_back(A.dat.A.x[k]); 04730 } 04731 } 04732 } 04733 04735 inline sivector operator-(const simatrix_subv& v) { 04736 sivector s(v); 04737 return -s; 04738 } 04739 04741 inline sivector operator/(const simatrix_subv& v1, const real& v2) { 04742 return sivector(v1) / v2; 04743 } 04744 04746 inline sivector operator/(const simatrix_subv& v1, const interval& v2) { 04747 return sivector(v1) / v2; 04748 } 04749 04751 inline sivector operator/(const srmatrix_subv& v1, const interval& v2) { 04752 return srvector(v1) / v2; 04753 } 04754 04756 inline sivector operator*(const simatrix_subv& v1, const real& v2) { 04757 return sivector(v1) * v2; 04758 } 04759 04761 inline sivector operator*(const simatrix_subv& v1, const interval& v2) { 04762 return sivector(v1) * v2; 04763 } 04764 04766 inline sivector operator*(const srmatrix_subv& v1, const interval& v2) { 04767 return srvector(v1) * v2; 04768 } 04769 04771 inline sivector operator*(const real& v1, const simatrix_subv& v2) { 04772 return v1 * sivector(v2); 04773 } 04774 04776 inline sivector operator*(const interval& v1, const simatrix_subv& v2) { 04777 return v1 * sivector(v2); 04778 } 04779 04781 inline sivector operator*(const interval& v1, const srmatrix_subv& v2) { 04782 return v1 * srvector(v2); 04783 } 04784 04786 04792 inline interval operator*(const simatrix_subv& v1, const srvector& v2) { 04793 return sivector(v1) * v2; 04794 } 04795 04797 04803 inline interval operator*(const srmatrix_subv& v1, const sivector& v2) { 04804 return srvector(v1) * v2; 04805 } 04806 04808 04814 inline interval operator*(const simatrix_subv& v1, const sivector& v2) { 04815 return sivector(v1) * v2; 04816 } 04817 04819 04825 inline interval operator*(const simatrix_subv& v1, const srvector_slice& v2) { 04826 return sivector(v1) * v2; 04827 } 04828 04830 04836 inline interval operator*(const srmatrix_subv& v1, const sivector_slice& v2) { 04837 return srvector(v1) * v2; 04838 } 04839 04841 04847 inline interval operator*(const simatrix_subv& v1, const sivector_slice& v2) { 04848 return sivector(v1) * v2; 04849 } 04850 04852 04858 inline interval operator*(const simatrix_subv& v1, const rvector& v2) { 04859 return sivector(v1) * v2; 04860 } 04861 04863 04869 inline interval operator*(const srmatrix_subv& v1, const ivector& v2) { 04870 return srvector(v1) * v2; 04871 } 04872 04874 04880 inline interval operator*(const simatrix_subv& v1, const ivector& v2) { 04881 return sivector(v1) * v2; 04882 } 04883 04885 04891 inline interval operator*(const simatrix_subv& v1, const rvector_slice& v2) { 04892 return sivector(v1) * v2; 04893 } 04894 04896 04902 inline interval operator*(const srmatrix_subv& v1, const ivector_slice& v2) { 04903 return srvector(v1) * v2; 04904 } 04905 04907 04913 inline interval operator*(const simatrix_subv& v1, const ivector_slice& v2) { 04914 return sivector(v1) * v2; 04915 } 04916 04918 04924 inline interval operator*(const sivector& v1, const srmatrix_subv& v2) { 04925 return v1 * srvector(v2); 04926 } 04927 04929 04935 inline interval operator*(const srvector& v1, const simatrix_subv& v2) { 04936 return v1 * sivector(v2); 04937 } 04938 04940 04946 inline interval operator*(const sivector& v1, const simatrix_subv& v2) { 04947 return v1 * sivector(v2); 04948 } 04949 04951 04957 inline interval operator*(const sivector_slice& v1, const srmatrix_subv& v2) { 04958 return v1 * srvector(v2); 04959 } 04960 04962 04968 inline interval operator*(const srvector_slice& v1, const simatrix_subv& v2) { 04969 return v1 * sivector(v2); 04970 } 04971 04973 04979 inline interval operator*(const sivector_slice& v1, const simatrix_subv& v2) { 04980 return v1 * sivector(v2); 04981 } 04982 04984 04990 inline interval operator*(const ivector& v1, const srmatrix_subv& v2) { 04991 return v1 * srvector(v2); 04992 } 04993 04995 05001 inline interval operator*(const rvector& v1, const simatrix_subv& v2) { 05002 return v1 * sivector(v2); 05003 } 05004 05006 05012 inline interval operator*(const ivector& v1, const simatrix_subv& v2) { 05013 return v1 * sivector(v2); 05014 } 05015 05017 05023 inline interval operator*(const ivector_slice& v1, const srmatrix_subv& v2) { 05024 return v1 * srvector(v2); 05025 } 05026 05028 05034 inline interval operator*(const rvector_slice& v1, const simatrix_subv& v2) { 05035 return v1 * sivector(v2); 05036 } 05037 05039 05045 inline interval operator*(const ivector_slice& v1, const simatrix_subv& v2) { 05046 return v1 * sivector(v2); 05047 } 05048 05050 inline sivector operator+(const simatrix_subv& v1, const srvector& v2) { 05051 return sivector(v1) + v2; 05052 } 05053 05055 inline sivector operator+(const srmatrix_subv& v1, const sivector& v2) { 05056 return srvector(v1) + v2; 05057 } 05058 05060 inline sivector operator+(const simatrix_subv& v1, const sivector& v2) { 05061 return sivector(v1) + v2; 05062 } 05063 05065 inline sivector operator+(const simatrix_subv& v1, const srvector_slice& v2) { 05066 return sivector(v1) + v2; 05067 } 05068 05070 inline sivector operator+(const srmatrix_subv& v1, const sivector_slice& v2) { 05071 return srvector(v1) + v2; 05072 } 05073 05075 inline sivector operator+(const simatrix_subv& v1, const sivector_slice& v2) { 05076 return sivector(v1) + v2; 05077 } 05078 05080 inline ivector operator+(const simatrix_subv& v1, const rvector& v2) { 05081 return sivector(v1) + v2; 05082 } 05083 05085 inline ivector operator+(const srmatrix_subv& v1, const ivector& v2) { 05086 return srvector(v1) + v2; 05087 } 05088 05090 inline ivector operator+(const simatrix_subv& v1, const ivector& v2) { 05091 return sivector(v1) + v2; 05092 } 05093 05095 inline ivector operator+(const simatrix_subv& v1, const rvector_slice& v2) { 05096 return sivector(v1) + v2; 05097 } 05098 05100 inline ivector operator+(const srmatrix_subv& v1, const ivector_slice& v2) { 05101 return srvector(v1) + v2; 05102 } 05103 05105 inline ivector operator+(const simatrix_subv& v1, const ivector_slice& v2) { 05106 return sivector(v1) + v2; 05107 } 05108 05110 inline sivector operator+(const sivector& v1, const srmatrix_subv& v2) { 05111 return v1 + srvector(v2); 05112 } 05113 05115 inline sivector operator+(const srvector& v1, const simatrix_subv& v2) { 05116 return v1 + sivector(v2); 05117 } 05118 05120 inline sivector operator+(const sivector& v1, const simatrix_subv& v2) { 05121 return v1 + sivector(v2); 05122 } 05123 05125 inline sivector operator+(const sivector_slice& v1, const srmatrix_subv& v2) { 05126 return v1 + srvector(v2); 05127 } 05128 05130 inline sivector operator+(const srvector_slice& v1, const simatrix_subv& v2) { 05131 return v1 + sivector(v2); 05132 } 05133 05135 inline sivector operator+(const sivector_slice& v1, const simatrix_subv& v2) { 05136 return v1 + sivector(v2); 05137 } 05138 05140 inline ivector operator+(const ivector& v1, const srmatrix_subv& v2) { 05141 return v1 + srvector(v2); 05142 } 05143 05145 inline ivector operator+(const rvector& v1, const simatrix_subv& v2) { 05146 return v1 + sivector(v2); 05147 } 05148 05150 inline ivector operator+(const ivector& v1, const simatrix_subv& v2) { 05151 return v1 + sivector(v2); 05152 } 05153 05155 inline ivector operator+(const ivector_slice& v1, const srmatrix_subv& v2) { 05156 return v1 + srvector(v2); 05157 } 05158 05160 inline ivector operator+(const rvector_slice& v1, const simatrix_subv& v2) { 05161 return v1 + sivector(v2); 05162 } 05163 05165 inline ivector operator+(const ivector_slice& v1, const simatrix_subv& v2) { 05166 return v1 + sivector(v2); 05167 } 05168 05170 inline sivector operator-(const simatrix_subv& v1, const srvector& v2) { 05171 return sivector(v1) - v2; 05172 } 05173 05175 inline sivector operator-(const srmatrix_subv& v1, const sivector& v2) { 05176 return srvector(v1) - v2; 05177 } 05178 05180 inline sivector operator-(const simatrix_subv& v1, const sivector& v2) { 05181 return sivector(v1) - v2; 05182 } 05183 05185 inline sivector operator-(const simatrix_subv& v1, const srvector_slice& v2) { 05186 return sivector(v1) - v2; 05187 } 05188 05190 inline sivector operator-(const srmatrix_subv& v1, const sivector_slice& v2) { 05191 return srvector(v1) - v2; 05192 } 05193 05195 inline sivector operator-(const simatrix_subv& v1, const sivector_slice& v2) { 05196 return sivector(v1) - v2; 05197 } 05198 05200 inline ivector operator-(const simatrix_subv& v1, const rvector& v2) { 05201 return sivector(v1) - v2; 05202 } 05203 05205 inline ivector operator-(const srmatrix_subv& v1, const ivector& v2) { 05206 return srvector(v1) - v2; 05207 } 05208 05210 inline ivector operator-(const simatrix_subv& v1, const ivector& v2) { 05211 return sivector(v1) - v2; 05212 } 05213 05215 inline ivector operator-(const simatrix_subv& v1, const rvector_slice& v2) { 05216 return sivector(v1) - v2; 05217 } 05218 05220 inline ivector operator-(const srmatrix_subv& v1, const ivector_slice& v2) { 05221 return srvector(v1) - v2; 05222 } 05223 05225 inline ivector operator-(const simatrix_subv& v1, const ivector_slice& v2) { 05226 return sivector(v1) - v2; 05227 } 05228 05230 inline sivector operator-(const sivector& v1, const srmatrix_subv& v2) { 05231 return v1 - srvector(v2); 05232 } 05233 05235 inline sivector operator-(const srvector& v1, const simatrix_subv& v2) { 05236 return v1 - sivector(v2); 05237 } 05238 05240 inline sivector operator-(const sivector& v1, const simatrix_subv& v2) { 05241 return v1 - sivector(v2); 05242 } 05243 05245 inline sivector operator-(const sivector_slice& v1, const srmatrix_subv& v2) { 05246 return v1 - srvector(v2); 05247 } 05248 05250 inline sivector operator-(const srvector_slice& v1, const simatrix_subv& v2) { 05251 return v1 - sivector(v2); 05252 } 05253 05255 inline sivector operator-(const sivector_slice& v1, const simatrix_subv& v2) { 05256 return v1 - sivector(v2); 05257 } 05258 05260 inline ivector operator-(const ivector& v1, const srmatrix_subv& v2) { 05261 return v1 - srvector(v2); 05262 } 05263 05265 inline ivector operator-(const rvector& v1, const simatrix_subv& v2) { 05266 return v1 - sivector(v2); 05267 } 05268 05270 inline ivector operator-(const ivector& v1, const simatrix_subv& v2) { 05271 return v1 - sivector(v2); 05272 } 05273 05275 inline ivector operator-(const ivector_slice& v1, const srmatrix_subv& v2) { 05276 return v1 - srvector(v2); 05277 } 05278 05280 inline ivector operator-(const rvector_slice& v1, const simatrix_subv& v2) { 05281 return v1 - sivector(v2); 05282 } 05283 05285 inline ivector operator-(const ivector_slice& v1, const simatrix_subv& v2) { 05286 return v1 - sivector(v2); 05287 } 05288 05290 inline sivector operator|(const simatrix_subv& v1, const srvector& v2) { 05291 return sivector(v1) | v2; 05292 } 05293 05295 inline sivector operator|(const srmatrix_subv& v1, const sivector& v2) { 05296 return srvector(v1) | v2; 05297 } 05298 05300 inline sivector operator|(const simatrix_subv& v1, const sivector& v2) { 05301 return sivector(v1) | v2; 05302 } 05303 05305 inline sivector operator|(const simatrix_subv& v1, const srvector_slice& v2) { 05306 return sivector(v1) | v2; 05307 } 05308 05310 inline sivector operator|(const srmatrix_subv& v1, const sivector_slice& v2) { 05311 return srvector(v1) | v2; 05312 } 05313 05315 inline sivector operator|(const simatrix_subv& v1, const sivector_slice& v2) { 05316 return sivector(v1) | v2; 05317 } 05318 05320 inline ivector operator|(const simatrix_subv& v1, const rvector& v2) { 05321 return sivector(v1) | v2; 05322 } 05323 05325 inline ivector operator|(const srmatrix_subv& v1, const ivector& v2) { 05326 return srvector(v1) | v2; 05327 } 05328 05330 inline ivector operator|(const simatrix_subv& v1, const ivector& v2) { 05331 return sivector(v1) | v2; 05332 } 05333 05335 inline ivector operator|(const simatrix_subv& v1, const rvector_slice& v2) { 05336 return sivector(v1) | v2; 05337 } 05338 05340 inline ivector operator|(const srmatrix_subv& v1, const ivector_slice& v2) { 05341 return srvector(v1) | v2; 05342 } 05343 05345 inline ivector operator|(const simatrix_subv& v1, const ivector_slice& v2) { 05346 return sivector(v1) | v2; 05347 } 05348 05350 inline sivector operator|(const sivector& v1, const srmatrix_subv& v2) { 05351 return v1 | srvector(v2); 05352 } 05353 05355 inline sivector operator|(const srvector& v1, const simatrix_subv& v2) { 05356 return v1 | sivector(v2); 05357 } 05358 05360 inline sivector operator|(const sivector& v1, const simatrix_subv& v2) { 05361 return v1 | sivector(v2); 05362 } 05363 05365 inline sivector operator|(const sivector_slice& v1, const srmatrix_subv& v2) { 05366 return v1 | srvector(v2); 05367 } 05368 05370 inline sivector operator|(const srvector_slice& v1, const simatrix_subv& v2) { 05371 return v1 | sivector(v2); 05372 } 05373 05375 inline sivector operator|(const sivector_slice& v1, const simatrix_subv& v2) { 05376 return v1 | sivector(v2); 05377 } 05378 05380 inline ivector operator|(const ivector& v1, const srmatrix_subv& v2) { 05381 return v1 | srvector(v2); 05382 } 05383 05385 inline ivector operator|(const rvector& v1, const simatrix_subv& v2) { 05386 return v1 | sivector(v2); 05387 } 05388 05390 inline ivector operator|(const ivector& v1, const simatrix_subv& v2) { 05391 return v1 | sivector(v2); 05392 } 05393 05395 inline ivector operator|(const ivector_slice& v1, const srmatrix_subv& v2) { 05396 return v1 | srvector(v2); 05397 } 05398 05400 inline ivector operator|(const rvector_slice& v1, const simatrix_subv& v2) { 05401 return v1 | sivector(v2); 05402 } 05403 05405 inline ivector operator|(const ivector_slice& v1, const simatrix_subv& v2) { 05406 return v1 | sivector(v2); 05407 } 05408 05410 inline sivector operator|(const srmatrix_subv& v1, const srvector& v2) { 05411 return srvector(v1) | v2; 05412 } 05413 05415 inline sivector operator|(const srmatrix_subv& v1, const srvector_slice& v2) { 05416 return srvector(v1) | v2; 05417 } 05418 05420 inline ivector operator|(const srmatrix_subv& v1, const rvector& v2) { 05421 return srvector(v1) | v2; 05422 } 05423 05425 inline ivector operator|(const srmatrix_subv& v1, const rvector_slice& v2) { 05426 return srvector(v1) | v2; 05427 } 05428 05430 inline sivector operator|(const srvector& v1, const srmatrix_subv& v2) { 05431 return v1 | srvector(v2); 05432 } 05433 05435 inline sivector operator|(const srvector_slice& v1, const srmatrix_subv& v2) { 05436 return v1 | srvector(v2); 05437 } 05438 05440 inline ivector operator|(const rvector& v1, const srmatrix_subv& v2) { 05441 return v1 | srvector(v2); 05442 } 05443 05445 inline ivector operator|(const rvector_slice& v1, const srmatrix_subv& v2) { 05446 return v1 | srvector(v2); 05447 } 05448 05449 inline simatrix_subv& simatrix_subv::operator*=(const real& v) { 05450 *this = *this * v; 05451 return *this; 05452 } 05453 05454 inline simatrix_subv& simatrix_subv::operator*=(const interval& v) { 05455 *this = *this * v; 05456 return *this; 05457 } 05458 05459 inline simatrix_subv& simatrix_subv::operator/=(const real& v) { 05460 *this = *this / v; 05461 return *this; 05462 } 05463 05464 inline simatrix_subv& simatrix_subv::operator/=(const interval& v) { 05465 *this = *this / v; 05466 return *this; 05467 } 05468 05469 inline simatrix_subv& simatrix_subv::operator+=(const srvector& v) { 05470 *this = *this + v; 05471 return *this; 05472 } 05473 05474 inline simatrix_subv& simatrix_subv::operator+=(const srvector_slice& v) { 05475 *this = *this + v; 05476 return *this; 05477 } 05478 05479 inline simatrix_subv& simatrix_subv::operator+=(const rvector& v) { 05480 *this = *this + v; 05481 return *this; 05482 } 05483 05484 inline simatrix_subv& simatrix_subv::operator+=(const rvector_slice& v) { 05485 *this = *this + v; 05486 return *this; 05487 } 05488 05489 inline simatrix_subv& simatrix_subv::operator-=(const srvector& v) { 05490 *this = *this - v; 05491 return *this; 05492 } 05493 05494 inline simatrix_subv& simatrix_subv::operator-=(const srvector_slice& v) { 05495 *this = *this - v; 05496 return *this; 05497 } 05498 05499 inline simatrix_subv& simatrix_subv::operator-=(const rvector& v) { 05500 *this = *this - v; 05501 return *this; 05502 } 05503 05504 inline simatrix_subv& simatrix_subv::operator-=(const rvector_slice& v) { 05505 *this = *this - v; 05506 return *this; 05507 } 05508 05509 inline simatrix_subv& simatrix_subv::operator+=(const sivector& v) { 05510 *this = *this + v; 05511 return *this; 05512 } 05513 05514 inline simatrix_subv& simatrix_subv::operator+=(const sivector_slice& v) { 05515 *this = *this + v; 05516 return *this; 05517 } 05518 05519 inline simatrix_subv& simatrix_subv::operator+=(const ivector& v) { 05520 *this = *this + v; 05521 return *this; 05522 } 05523 05524 inline simatrix_subv& simatrix_subv::operator+=(const ivector_slice& v) { 05525 *this = *this + v; 05526 return *this; 05527 } 05528 05529 inline simatrix_subv& simatrix_subv::operator-=(const sivector& v) { 05530 *this = *this - v; 05531 return *this; 05532 } 05533 05534 inline simatrix_subv& simatrix_subv::operator-=(const sivector_slice& v) { 05535 *this = *this - v; 05536 return *this; 05537 } 05538 05539 inline simatrix_subv& simatrix_subv::operator-=(const ivector& v) { 05540 *this = *this - v; 05541 return *this; 05542 } 05543 05544 inline simatrix_subv& simatrix_subv::operator-=(const ivector_slice& v) { 05545 *this = *this - v; 05546 return *this; 05547 } 05548 05549 inline simatrix_subv& simatrix_subv::operator|=(const srvector& v) { 05550 *this = *this | v; 05551 return *this; 05552 } 05553 05554 inline simatrix_subv& simatrix_subv::operator|=(const srvector_slice& v) { 05555 *this = *this | v; 05556 return *this; 05557 } 05558 05559 inline simatrix_subv& simatrix_subv::operator|=(const rvector& v) { 05560 *this = *this | v; 05561 return *this; 05562 } 05563 05564 inline simatrix_subv& simatrix_subv::operator|=(const rvector_slice& v) { 05565 *this = *this | v; 05566 return *this; 05567 } 05568 05569 inline simatrix_subv& simatrix_subv::operator|=(const sivector& v) { 05570 *this = *this | v; 05571 return *this; 05572 } 05573 05574 inline simatrix_subv& simatrix_subv::operator|=(const sivector_slice& v) { 05575 *this = *this | v; 05576 return *this; 05577 } 05578 05579 inline simatrix_subv& simatrix_subv::operator|=(const ivector& v) { 05580 *this = *this | v; 05581 return *this; 05582 } 05583 05584 inline simatrix_subv& simatrix_subv::operator|=(const ivector_slice& v) { 05585 *this = *this | v; 05586 return *this; 05587 } 05588 05589 inline imatrix_subv& imatrix_subv::operator+=(const srmatrix_subv& v) { 05590 *this += rvector(v); 05591 return *this; 05592 } 05593 05594 inline imatrix_subv& imatrix_subv::operator+=(const simatrix_subv& v) { 05595 *this += ivector(v); 05596 return *this; 05597 } 05598 05599 inline imatrix_subv& imatrix_subv::operator+=(const srvector& v) { 05600 *this += rvector(v); 05601 return *this; 05602 } 05603 05604 inline imatrix_subv& imatrix_subv::operator+=(const sivector& v) { 05605 *this += ivector(v); 05606 return *this; 05607 } 05608 05609 inline imatrix_subv& imatrix_subv::operator+=(const srvector_slice& v) { 05610 *this += rvector(v); 05611 return *this; 05612 } 05613 05614 inline imatrix_subv& imatrix_subv::operator+=(const sivector_slice& v) { 05615 *this += ivector(v); 05616 return *this; 05617 } 05618 05619 inline imatrix_subv& imatrix_subv::operator-=(const srmatrix_subv& v) { 05620 *this -= rvector(v); 05621 return *this; 05622 } 05623 05624 inline imatrix_subv& imatrix_subv::operator-=(const simatrix_subv& v) { 05625 *this -= ivector(v); 05626 return *this; 05627 } 05628 05629 inline imatrix_subv& imatrix_subv::operator-=(const srvector& v) { 05630 *this -= rvector(v); 05631 return *this; 05632 } 05633 05634 inline imatrix_subv& imatrix_subv::operator-=(const sivector& v) { 05635 *this -= ivector(v); 05636 return *this; 05637 } 05638 05639 inline imatrix_subv& imatrix_subv::operator-=(const srvector_slice& v) { 05640 *this -= rvector(v); 05641 return *this; 05642 } 05643 05644 inline imatrix_subv& imatrix_subv::operator-=(const sivector_slice& v) { 05645 *this -= ivector(v); 05646 return *this; 05647 } 05648 05649 inline imatrix_subv& imatrix_subv::operator|=(const srmatrix_subv& v) { 05650 *this |= rvector(v); 05651 return *this; 05652 } 05653 05654 inline imatrix_subv& imatrix_subv::operator|=(const simatrix_subv& v) { 05655 *this |= ivector(v); 05656 return *this; 05657 } 05658 05659 inline imatrix_subv& imatrix_subv::operator|=(const srvector& v) { 05660 *this |= rvector(v); 05661 return *this; 05662 } 05663 05664 inline imatrix_subv& imatrix_subv::operator|=(const sivector& v) { 05665 *this |= ivector(v); 05666 return *this; 05667 } 05668 05669 inline imatrix_subv& imatrix_subv::operator|=(const srvector_slice& v) { 05670 *this |= rvector(v); 05671 return *this; 05672 } 05673 05674 inline imatrix_subv& imatrix_subv::operator|=(const sivector_slice& v) { 05675 *this |= ivector(v); 05676 return *this; 05677 } 05678 05679 inline imatrix_subv& imatrix_subv::operator&=(const srmatrix_subv& v) { 05680 *this &= rvector(v); 05681 return *this; 05682 } 05683 05684 inline imatrix_subv& imatrix_subv::operator&=(const simatrix_subv& v) { 05685 *this &= ivector(v); 05686 return *this; 05687 } 05688 05689 inline imatrix_subv& imatrix_subv::operator&=(const srvector& v) { 05690 *this &= rvector(v); 05691 return *this; 05692 } 05693 05694 inline imatrix_subv& imatrix_subv::operator&=(const sivector& v) { 05695 *this &= ivector(v); 05696 return *this; 05697 } 05698 05699 inline imatrix_subv& imatrix_subv::operator&=(const srvector_slice& v) { 05700 *this &= rvector(v); 05701 return *this; 05702 } 05703 05704 inline imatrix_subv& imatrix_subv::operator&=(const sivector_slice& v) { 05705 *this &= ivector(v); 05706 return *this; 05707 } 05708 05709 inline imatrix_subv& imatrix_subv::operator=(const srvector& v) { 05710 *this = rvector(v); 05711 return *this; 05712 } 05713 05714 inline imatrix_subv& imatrix_subv::operator=(const sivector& v) { 05715 *this = ivector(v); 05716 return *this; 05717 } 05718 05719 inline imatrix_subv& imatrix_subv::operator=(const srvector_slice& v) { 05720 *this = rvector(v); 05721 return *this; 05722 } 05723 05724 inline imatrix_subv& imatrix_subv::operator=(const sivector_slice& v) { 05725 *this = ivector(v); 05726 return *this; 05727 } 05728 05729 inline imatrix_subv& imatrix_subv::operator=(const srmatrix_subv& v) { 05730 *this = rvector(v); 05731 return *this; 05732 } 05733 05734 inline imatrix_subv& imatrix_subv::operator=(const simatrix_subv& v) { 05735 *this = ivector(v); 05736 return *this; 05737 } 05738 05740 inline bool operator==(const simatrix_subv& v1, const srvector& v2) { 05741 return sivector(v1) == v2; 05742 } 05743 05745 inline bool operator==(const srmatrix_subv& v1, const sivector& v2) { 05746 return srvector(v1) == v2; 05747 } 05748 05750 inline bool operator==(const simatrix_subv& v1, const sivector& v2) { 05751 return sivector(v1) == v2; 05752 } 05753 05755 inline bool operator==(const simatrix_subv& v1, const srvector_slice& v2) { 05756 return sivector(v1) == v2; 05757 } 05758 05760 inline bool operator==(const srmatrix_subv& v1, const sivector_slice& v2) { 05761 return srvector(v1) == v2; 05762 } 05763 05765 inline bool operator==(const simatrix_subv& v1, const sivector_slice& v2) { 05766 return sivector(v1) == v2; 05767 } 05768 05770 inline bool operator==(const simatrix_subv& v1, const rvector& v2) { 05771 return sivector(v1) == v2; 05772 } 05773 05775 inline bool operator==(const srmatrix_subv& v1, const ivector& v2) { 05776 return srvector(v1) == v2; 05777 } 05778 05780 inline bool operator==(const simatrix_subv& v1, const ivector& v2) { 05781 return sivector(v1) == v2; 05782 } 05783 05785 inline bool operator==(const simatrix_subv& v1, const rvector_slice& v2) { 05786 return sivector(v1) == v2; 05787 } 05788 05790 inline bool operator==(const srmatrix_subv& v1, const ivector_slice& v2) { 05791 return srvector(v1) == v2; 05792 } 05793 05795 inline bool operator==(const simatrix_subv& v1, const ivector_slice& v2) { 05796 return sivector(v1) == v2; 05797 } 05798 05800 inline bool operator==(const sivector& v1, const srmatrix_subv& v2) { 05801 return v1 == srvector(v2); 05802 } 05803 05805 inline bool operator==(const srvector& v1, const simatrix_subv& v2) { 05806 return v1 == sivector(v2); 05807 } 05808 05810 inline bool operator==(const sivector& v1, const simatrix_subv& v2) { 05811 return v1 == sivector(v2); 05812 } 05813 05815 inline bool operator==(const sivector_slice& v1, const srmatrix_subv& v2) { 05816 return v1 == srvector(v2); 05817 } 05818 05820 inline bool operator==(const srvector_slice& v1, const simatrix_subv& v2) { 05821 return v1 == sivector(v2); 05822 } 05823 05825 inline bool operator==(const sivector_slice& v1, const simatrix_subv& v2) { 05826 return v1 == sivector(v2); 05827 } 05828 05830 inline bool operator==(const ivector& v1, const srmatrix_subv& v2) { 05831 return v1 == srvector(v2); 05832 } 05833 05835 inline bool operator==(const rvector& v1, const simatrix_subv& v2) { 05836 return v1 == sivector(v2); 05837 } 05838 05840 inline bool operator==(const ivector& v1, const simatrix_subv& v2) { 05841 return v1 == sivector(v2); 05842 } 05843 05845 inline bool operator==(const ivector_slice& v1, const srmatrix_subv& v2) { 05846 return v1 == srvector(v2); 05847 } 05848 05850 inline bool operator==(const rvector_slice& v1, const simatrix_subv& v2) { 05851 return v1 == sivector(v2); 05852 } 05853 05855 inline bool operator==(const ivector_slice& v1, const simatrix_subv& v2) { 05856 return v1 == sivector(v2); 05857 } 05858 05860 inline bool operator!=(const simatrix_subv& v1, const srvector& v2) { 05861 return sivector(v1) != v2; 05862 } 05863 05865 inline bool operator!=(const srmatrix_subv& v1, const sivector& v2) { 05866 return srvector(v1) != v2; 05867 } 05868 05870 inline bool operator!=(const simatrix_subv& v1, const sivector& v2) { 05871 return sivector(v1) != v2; 05872 } 05873 05875 inline bool operator!=(const simatrix_subv& v1, const srvector_slice& v2) { 05876 return sivector(v1) != v2; 05877 } 05878 05880 inline bool operator!=(const srmatrix_subv& v1, const sivector_slice& v2) { 05881 return srvector(v1) != v2; 05882 } 05883 05885 inline bool operator!=(const simatrix_subv& v1, const sivector_slice& v2) { 05886 return sivector(v1) != v2; 05887 } 05888 05890 inline bool operator!=(const simatrix_subv& v1, const rvector& v2) { 05891 return sivector(v1) != v2; 05892 } 05893 05895 inline bool operator!=(const srmatrix_subv& v1, const ivector& v2) { 05896 return srvector(v1) != v2; 05897 } 05898 05900 inline bool operator!=(const simatrix_subv& v1, const ivector& v2) { 05901 return sivector(v1) != v2; 05902 } 05903 05905 inline bool operator!=(const simatrix_subv& v1, const rvector_slice& v2) { 05906 return sivector(v1) != v2; 05907 } 05908 05910 inline bool operator!=(const srmatrix_subv& v1, const ivector_slice& v2) { 05911 return srvector(v1) != v2; 05912 } 05913 05915 inline bool operator!=(const simatrix_subv& v1, const ivector_slice& v2) { 05916 return sivector(v1) != v2; 05917 } 05918 05920 inline bool operator!=(const sivector& v1, const srmatrix_subv& v2) { 05921 return v1 != srvector(v2); 05922 } 05923 05925 inline bool operator!=(const srvector& v1, const simatrix_subv& v2) { 05926 return v1 != sivector(v2); 05927 } 05928 05930 inline bool operator!=(const sivector& v1, const simatrix_subv& v2) { 05931 return v1 != sivector(v2); 05932 } 05933 05935 inline bool operator!=(const sivector_slice& v1, const srmatrix_subv& v2) { 05936 return v1 != srvector(v2); 05937 } 05938 05940 inline bool operator!=(const srvector_slice& v1, const simatrix_subv& v2) { 05941 return v1 != sivector(v2); 05942 } 05943 05945 inline bool operator!=(const sivector_slice& v1, const simatrix_subv& v2) { 05946 return v1 != sivector(v2); 05947 } 05948 05950 inline bool operator!=(const ivector& v1, const srmatrix_subv& v2) { 05951 return v1 != srvector(v2); 05952 } 05953 05955 inline bool operator!=(const rvector& v1, const simatrix_subv& v2) { 05956 return v1 != sivector(v2); 05957 } 05958 05960 inline bool operator!=(const ivector& v1, const simatrix_subv& v2) { 05961 return v1 != sivector(v2); 05962 } 05963 05965 inline bool operator!=(const ivector_slice& v1, const srmatrix_subv& v2) { 05966 return v1 != srvector(v2); 05967 } 05968 05970 inline bool operator!=(const rvector_slice& v1, const simatrix_subv& v2) { 05971 return v1 != sivector(v2); 05972 } 05973 05975 inline bool operator!=(const ivector_slice& v1, const simatrix_subv& v2) { 05976 return v1 != sivector(v2); 05977 } 05978 05980 inline bool operator<(const srmatrix_subv& v1, const sivector& v2) { 05981 return srvector(v1) < v2; 05982 } 05983 05985 inline bool operator<(const simatrix_subv& v1, const sivector& v2) { 05986 return sivector(v1) < v2; 05987 } 05988 05990 inline bool operator<(const srmatrix_subv& v1, const sivector_slice& v2) { 05991 return srvector(v1) < v2; 05992 } 05993 05995 inline bool operator<(const simatrix_subv& v1, const sivector_slice& v2) { 05996 return sivector(v1) < v2; 05997 } 05998 06000 inline bool operator<(const srmatrix_subv& v1, const ivector& v2) { 06001 return srvector(v1) < v2; 06002 } 06003 06005 inline bool operator<(const simatrix_subv& v1, const ivector& v2) { 06006 return sivector(v1) < v2; 06007 } 06008 06010 inline bool operator<(const srmatrix_subv& v1, const ivector_slice& v2) { 06011 return srvector(v1) < v2; 06012 } 06013 06015 inline bool operator<(const simatrix_subv& v1, const ivector_slice& v2) { 06016 return sivector(v1) < v2; 06017 } 06018 06020 inline bool operator<(const srvector& v1, const simatrix_subv& v2) { 06021 return v1 < sivector(v2); 06022 } 06023 06025 inline bool operator<(const sivector& v1, const simatrix_subv& v2) { 06026 return v1 < sivector(v2); 06027 } 06028 06030 inline bool operator<(const srvector_slice& v1, const simatrix_subv& v2) { 06031 return v1 < sivector(v2); 06032 } 06033 06035 inline bool operator<(const sivector_slice& v1, const simatrix_subv& v2) { 06036 return v1 < sivector(v2); 06037 } 06038 06040 inline bool operator<(const rvector& v1, const simatrix_subv& v2) { 06041 return v1 < sivector(v2); 06042 } 06043 06045 inline bool operator<(const ivector& v1, const simatrix_subv& v2) { 06046 return v1 < sivector(v2); 06047 } 06048 06050 inline bool operator<(const rvector_slice& v1, const simatrix_subv& v2) { 06051 return v1 < sivector(v2); 06052 } 06053 06055 inline bool operator<(const ivector_slice& v1, const simatrix_subv& v2) { 06056 return v1 < sivector(v2); 06057 } 06058 06060 inline bool operator<=(const srmatrix_subv& v1, const sivector& v2) { 06061 return srvector(v1) <= v2; 06062 } 06063 06065 inline bool operator<=(const simatrix_subv& v1, const sivector& v2) { 06066 return sivector(v1) <= v2; 06067 } 06068 06070 inline bool operator<=(const srmatrix_subv& v1, const sivector_slice& v2) { 06071 return srvector(v1) <= v2; 06072 } 06073 06075 inline bool operator<=(const simatrix_subv& v1, const sivector_slice& v2) { 06076 return sivector(v1) <= v2; 06077 } 06078 06080 inline bool operator<=(const srmatrix_subv& v1, const ivector& v2) { 06081 return srvector(v1) <= v2; 06082 } 06083 06085 inline bool operator<=(const simatrix_subv& v1, const ivector& v2) { 06086 return sivector(v1) <= v2; 06087 } 06088 06090 inline bool operator<=(const srmatrix_subv& v1, const ivector_slice& v2) { 06091 return srvector(v1) <= v2; 06092 } 06093 06095 inline bool operator<=(const simatrix_subv& v1, const ivector_slice& v2) { 06096 return sivector(v1) <= v2; 06097 } 06098 06100 inline bool operator<=(const srvector& v1, const simatrix_subv& v2) { 06101 return v1 <= sivector(v2); 06102 } 06103 06105 inline bool operator<=(const sivector& v1, const simatrix_subv& v2) { 06106 return v1 <= sivector(v2); 06107 } 06108 06110 inline bool operator<=(const srvector_slice& v1, const simatrix_subv& v2) { 06111 return v1 <= sivector(v2); 06112 } 06113 06115 inline bool operator<=(const sivector_slice& v1, const simatrix_subv& v2) { 06116 return v1 <= sivector(v2); 06117 } 06118 06120 inline bool operator<=(const rvector& v1, const simatrix_subv& v2) { 06121 return v1 <= sivector(v2); 06122 } 06123 06125 inline bool operator<=(const ivector& v1, const simatrix_subv& v2) { 06126 return v1 <= sivector(v2); 06127 } 06128 06130 inline bool operator<=(const rvector_slice& v1, const simatrix_subv& v2) { 06131 return v1 <= sivector(v2); 06132 } 06133 06135 inline bool operator<=(const ivector_slice& v1, const simatrix_subv& v2) { 06136 return v1 <= sivector(v2); 06137 } 06138 06140 inline bool operator>(const simatrix_subv& v1, const srvector& v2) { 06141 return sivector(v1) > v2; 06142 } 06143 06145 inline bool operator>(const simatrix_subv& v1, const sivector& v2) { 06146 return sivector(v1) > v2; 06147 } 06148 06150 inline bool operator>(const simatrix_subv& v1, const srvector_slice& v2) { 06151 return sivector(v1) > v2; 06152 } 06153 06155 inline bool operator>(const simatrix_subv& v1, const sivector_slice& v2) { 06156 return sivector(v1) > v2; 06157 } 06158 06160 inline bool operator>(const simatrix_subv& v1, const rvector& v2) { 06161 return sivector(v1) > v2; 06162 } 06163 06165 inline bool operator>(const simatrix_subv& v1, const ivector& v2) { 06166 return sivector(v1) > v2; 06167 } 06168 06170 inline bool operator>(const simatrix_subv& v1, const rvector_slice& v2) { 06171 return sivector(v1) > v2; 06172 } 06173 06175 inline bool operator>(const simatrix_subv& v1, const ivector_slice& v2) { 06176 return sivector(v1) > v2; 06177 } 06178 06180 inline bool operator>(const sivector& v1, const srmatrix_subv& v2) { 06181 return v1 > srvector(v2); 06182 } 06183 06185 inline bool operator>(const sivector& v1, const simatrix_subv& v2) { 06186 return v1 > sivector(v2); 06187 } 06188 06190 inline bool operator>(const sivector_slice& v1, const srmatrix_subv& v2) { 06191 return v1 > srvector(v2); 06192 } 06193 06195 inline bool operator>(const sivector_slice& v1, const simatrix_subv& v2) { 06196 return v1 > sivector(v2); 06197 } 06198 06200 inline bool operator>(const ivector& v1, const srmatrix_subv& v2) { 06201 return v1 > srvector(v2); 06202 } 06203 06205 inline bool operator>(const ivector& v1, const simatrix_subv& v2) { 06206 return v1 > sivector(v2); 06207 } 06208 06210 inline bool operator>(const ivector_slice& v1, const srmatrix_subv& v2) { 06211 return v1 > srvector(v2); 06212 } 06213 06215 inline bool operator>(const ivector_slice& v1, const simatrix_subv& v2) { 06216 return v1 > sivector(v2); 06217 } 06218 06220 inline bool operator>=(const simatrix_subv& v1, const srvector& v2) { 06221 return sivector(v1) >= v2; 06222 } 06223 06225 inline bool operator>=(const simatrix_subv& v1, const sivector& v2) { 06226 return sivector(v1) >= v2; 06227 } 06228 06230 inline bool operator>=(const simatrix_subv& v1, const srvector_slice& v2) { 06231 return sivector(v1) >= v2; 06232 } 06233 06235 inline bool operator>=(const simatrix_subv& v1, const sivector_slice& v2) { 06236 return sivector(v1) >= v2; 06237 } 06238 06240 inline bool operator>=(const simatrix_subv& v1, const rvector& v2) { 06241 return sivector(v1) >= v2; 06242 } 06243 06245 inline bool operator>=(const simatrix_subv& v1, const ivector& v2) { 06246 return sivector(v1) >= v2; 06247 } 06248 06250 inline bool operator>=(const simatrix_subv& v1, const rvector_slice& v2) { 06251 return sivector(v1) >= v2; 06252 } 06253 06255 inline bool operator>=(const simatrix_subv& v1, const ivector_slice& v2) { 06256 return sivector(v1) >= v2; 06257 } 06258 06260 inline bool operator>=(const sivector& v1, const srmatrix_subv& v2) { 06261 return v1 >= srvector(v2); 06262 } 06263 06265 inline bool operator>=(const sivector& v1, const simatrix_subv& v2) { 06266 return v1 >= sivector(v2); 06267 } 06268 06270 inline bool operator>=(const sivector_slice& v1, const srmatrix_subv& v2) { 06271 return v1 >= srvector(v2); 06272 } 06273 06275 inline bool operator>=(const sivector_slice& v1, const simatrix_subv& v2) { 06276 return v1 >= sivector(v2); 06277 } 06278 06280 inline bool operator>=(const ivector& v1, const srmatrix_subv& v2) { 06281 return v1 >= srvector(v2); 06282 } 06283 06285 inline bool operator>=(const ivector& v1, const simatrix_subv& v2) { 06286 return v1 >= sivector(v2); 06287 } 06288 06290 inline bool operator>=(const ivector_slice& v1, const srmatrix_subv& v2) { 06291 return v1 >= srvector(v2); 06292 } 06293 06295 inline bool operator>=(const ivector_slice& v1, const simatrix_subv& v2) { 06296 return v1 >= sivector(v2); 06297 } 06298 06300 inline bool operator!(const simatrix_subv& x) { 06301 return sv_v_not(x); 06302 } 06303 06305 06308 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const simatrix_subv& v2) { 06309 spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, sivector(v1), sivector(v2)); 06310 } 06311 06313 06316 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const srmatrix_subv& v2) { 06317 spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, sivector(v1), srvector(v2)); 06318 } 06319 06321 06324 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const simatrix_subv& v2) { 06325 spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, srvector(v1), sivector(v2)); 06326 } 06327 06329 06332 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const sivector& v2) { 06333 spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, sivector(v1), v2); 06334 } 06335 06337 06340 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const srvector& v2) { 06341 spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, sivector(v1), v2); 06342 } 06343 06345 06348 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const sivector& v2) { 06349 spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, srvector(v1), v2); 06350 } 06351 06353 06356 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const sivector_slice& v2) { 06357 spsl_vv_accu<idotprecision,sivector,sivector_slice,sparse_idot>(dot, sivector(v1), v2); 06358 } 06359 06361 06364 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const srvector_slice& v2) { 06365 spsl_vv_accu<idotprecision,sivector,srvector_slice,sparse_idot>(dot, sivector(v1), v2); 06366 } 06367 06369 06372 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const sivector_slice& v2) { 06373 spsl_vv_accu<idotprecision,srvector,sivector_slice,sparse_idot>(dot, srvector(v1), v2); 06374 } 06375 06377 06380 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const ivector& v2) { 06381 spf_vv_accu<idotprecision,sivector,ivector,sparse_idot>(dot, sivector(v1), v2); 06382 } 06383 06385 06388 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const rvector& v2) { 06389 spf_vv_accu<idotprecision,sivector,rvector,sparse_idot>(dot, sivector(v1), v2); 06390 } 06391 06393 06396 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const ivector& v2) { 06397 spf_vv_accu<idotprecision,srvector,ivector,sparse_idot>(dot, srvector(v1), v2); 06398 } 06399 06401 06404 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const ivector_slice& v2) { 06405 spf_vv_accu<idotprecision,sivector,ivector_slice,sparse_idot>(dot, sivector(v1), v2); 06406 } 06407 06409 06412 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const rvector_slice& v2) { 06413 spf_vv_accu<idotprecision,sivector,rvector_slice,sparse_idot>(dot, sivector(v1), v2); 06414 } 06415 06417 06420 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const ivector_slice& v2) { 06421 spf_vv_accu<idotprecision,srvector,ivector_slice,sparse_idot>(dot, srvector(v1), v2); 06422 } 06423 06425 06428 inline void accumulate(idotprecision& dot, const sivector& v1, const simatrix_subv& v2) { 06429 spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, v1, sivector(v2)); 06430 } 06431 06433 06436 inline void accumulate(idotprecision& dot, const sivector& v1, const srmatrix_subv& v2) { 06437 spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, v1, srvector(v2)); 06438 } 06439 06441 06444 inline void accumulate(idotprecision& dot, const srvector& v1, const simatrix_subv& v2) { 06445 spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, v1, sivector(v2)); 06446 } 06447 06449 06452 inline void accumulate(idotprecision& dot, const sivector_slice& v1, const simatrix_subv& v2) { 06453 slsp_vv_accu<idotprecision,sivector_slice,sivector,sparse_idot>(dot, v1, sivector(v2)); 06454 } 06455 06457 06460 inline void accumulate(idotprecision& dot, const sivector_slice& v1, const srmatrix_subv& v2) { 06461 slsp_vv_accu<idotprecision,sivector_slice,srvector,sparse_idot>(dot, v1, srvector(v2)); 06462 } 06463 06465 06468 inline void accumulate(idotprecision& dot, const srvector_slice& v1, const simatrix_subv& v2) { 06469 slsp_vv_accu<idotprecision,srvector_slice,sivector,sparse_idot>(dot, v1, sivector(v2)); 06470 } 06471 06473 06476 inline void accumulate(idotprecision& dot, const ivector& v1, const simatrix_subv& v2) { 06477 fsp_vv_accu<idotprecision,ivector,sivector,sparse_idot>(dot, v1, sivector(v2)); 06478 } 06479 06481 06484 inline void accumulate(idotprecision& dot, const ivector& v1, const srmatrix_subv& v2) { 06485 fsp_vv_accu<idotprecision,ivector,srvector,sparse_idot>(dot, v1, srvector(v2)); 06486 } 06487 06489 06492 inline void accumulate(idotprecision& dot, const rvector& v1, const simatrix_subv& v2) { 06493 fsp_vv_accu<idotprecision,rvector,sivector,sparse_idot>(dot, v1, sivector(v2)); 06494 } 06495 06497 06500 inline void accumulate(idotprecision& dot, const ivector_slice& v1, const simatrix_subv& v2) { 06501 fsp_vv_accu<idotprecision,ivector_slice,sivector,sparse_idot>(dot, v1, sivector(v2)); 06502 } 06503 06505 06508 inline void accumulate(idotprecision& dot, const ivector_slice& v1, const srmatrix_subv& v2) { 06509 fsp_vv_accu<idotprecision,ivector_slice,srvector,sparse_idot>(dot, v1, srvector(v2)); 06510 } 06511 06513 06516 inline void accumulate(idotprecision& dot, const rvector_slice& v1, const simatrix_subv& v2) { 06517 fsp_vv_accu<idotprecision,rvector_slice,sivector,sparse_idot>(dot, v1, sivector(v2)); 06518 } 06519 06521 06524 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const simatrix_subv& v2) { 06525 idotprecision tmp(0.0); 06526 tmp.set_k(dot.get_k()); 06527 accumulate(tmp,sivector(v1),sivector(v2)); 06528 SetRe(dot, Re(dot) + tmp); 06529 } 06530 06532 06535 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const srmatrix_subv& v2) { 06536 idotprecision tmp(0.0); 06537 tmp.set_k(dot.get_k()); 06538 accumulate(tmp,sivector(v1),srvector(v2)); 06539 SetRe(dot, Re(dot) + tmp); 06540 } 06541 06543 06546 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const simatrix_subv& v2) { 06547 idotprecision tmp(0.0); 06548 tmp.set_k(dot.get_k()); 06549 accumulate(tmp,srvector(v1),sivector(v2)); 06550 SetRe(dot, Re(dot) + tmp); 06551 } 06552 06554 06557 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const sivector& v2) { 06558 idotprecision tmp(0.0); 06559 tmp.set_k(dot.get_k()); 06560 accumulate(tmp,sivector(v1),v2); 06561 SetRe(dot, Re(dot) + tmp); 06562 } 06563 06565 06568 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const srvector& v2) { 06569 idotprecision tmp(0.0); 06570 tmp.set_k(dot.get_k()); 06571 accumulate(tmp,sivector(v1),v2); 06572 SetRe(dot, Re(dot) + tmp); 06573 } 06574 06576 06579 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const sivector& v2) { 06580 idotprecision tmp(0.0); 06581 tmp.set_k(dot.get_k()); 06582 accumulate(tmp,srvector(v1),v2); 06583 SetRe(dot, Re(dot) + tmp); 06584 } 06585 06587 06590 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const sivector_slice& v2) { 06591 idotprecision tmp(0.0); 06592 tmp.set_k(dot.get_k()); 06593 accumulate(tmp,sivector(v1),v2); 06594 SetRe(dot, Re(dot) + tmp); 06595 } 06596 06598 06601 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const srvector_slice& v2) { 06602 idotprecision tmp(0.0); 06603 tmp.set_k(dot.get_k()); 06604 accumulate(tmp,sivector(v1),v2); 06605 SetRe(dot, Re(dot) + tmp); 06606 } 06607 06609 06612 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const sivector_slice& v2) { 06613 idotprecision tmp(0.0); 06614 tmp.set_k(dot.get_k()); 06615 accumulate(tmp,srvector(v1),v2); 06616 SetRe(dot, Re(dot) + tmp); 06617 } 06618 06620 06623 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const ivector& v2) { 06624 idotprecision tmp(0.0); 06625 tmp.set_k(dot.get_k()); 06626 accumulate(tmp,sivector(v1),v2); 06627 SetRe(dot, Re(dot) + tmp); 06628 } 06629 06631 06634 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const rvector& v2) { 06635 idotprecision tmp(0.0); 06636 tmp.set_k(dot.get_k()); 06637 accumulate(tmp,sivector(v1),v2); 06638 SetRe(dot, Re(dot) + tmp); 06639 } 06640 06642 06645 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const ivector& v2) { 06646 idotprecision tmp(0.0); 06647 tmp.set_k(dot.get_k()); 06648 accumulate(tmp,srvector(v1),v2); 06649 SetRe(dot, Re(dot) + tmp); 06650 } 06651 06653 06656 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const ivector_slice& v2) { 06657 idotprecision tmp(0.0); 06658 tmp.set_k(dot.get_k()); 06659 accumulate(tmp,sivector(v1),v2); 06660 SetRe(dot, Re(dot) + tmp); 06661 } 06662 06664 06667 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const rvector_slice& v2) { 06668 idotprecision tmp(0.0); 06669 tmp.set_k(dot.get_k()); 06670 accumulate(tmp,sivector(v1),v2); 06671 SetRe(dot, Re(dot) + tmp); 06672 } 06673 06675 06678 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const ivector_slice& v2) { 06679 idotprecision tmp(0.0); 06680 tmp.set_k(dot.get_k()); 06681 accumulate(tmp,srvector(v1),v2); 06682 SetRe(dot, Re(dot) + tmp); 06683 } 06684 06686 06689 inline void accumulate(cidotprecision& dot, const sivector& v1, const simatrix_subv& v2) { 06690 idotprecision tmp(0.0); 06691 tmp.set_k(dot.get_k()); 06692 accumulate(tmp,v1,sivector(v2)); 06693 SetRe(dot, Re(dot) + tmp); 06694 } 06695 06697 06700 inline void accumulate(cidotprecision& dot, const sivector& v1, const srmatrix_subv& v2) { 06701 idotprecision tmp(0.0); 06702 tmp.set_k(dot.get_k()); 06703 accumulate(tmp,v1,srvector(v2)); 06704 SetRe(dot, Re(dot) + tmp); 06705 } 06706 06708 06711 inline void accumulate(cidotprecision& dot, const srvector& v1, const simatrix_subv& v2) { 06712 idotprecision tmp(0.0); 06713 tmp.set_k(dot.get_k()); 06714 accumulate(tmp,v1,sivector(v2)); 06715 SetRe(dot, Re(dot) + tmp); 06716 } 06717 06719 06722 inline void accumulate(cidotprecision& dot, const sivector_slice& v1, const simatrix_subv& v2) { 06723 idotprecision tmp(0.0); 06724 tmp.set_k(dot.get_k()); 06725 accumulate(tmp,v1,sivector(v2)); 06726 SetRe(dot, Re(dot) + tmp); 06727 } 06728 06730 06733 inline void accumulate(cidotprecision& dot, const sivector_slice& v1, const srmatrix_subv& v2) { 06734 idotprecision tmp(0.0); 06735 tmp.set_k(dot.get_k()); 06736 accumulate(tmp,v1,srvector(v2)); 06737 SetRe(dot, Re(dot) + tmp); 06738 } 06739 06741 06744 inline void accumulate(cidotprecision& dot, const srvector_slice& v1, const simatrix_subv& v2) { 06745 idotprecision tmp(0.0); 06746 tmp.set_k(dot.get_k()); 06747 accumulate(tmp,v1,sivector(v2)); 06748 SetRe(dot, Re(dot) + tmp); 06749 } 06750 06752 06755 inline void accumulate(cidotprecision& dot, const ivector& v1, const simatrix_subv& v2) { 06756 idotprecision tmp(0.0); 06757 tmp.set_k(dot.get_k()); 06758 accumulate(tmp,v1,sivector(v2)); 06759 SetRe(dot, Re(dot) + tmp); 06760 } 06761 06763 06766 inline void accumulate(cidotprecision& dot, const ivector& v1, const srmatrix_subv& v2) { 06767 idotprecision tmp(0.0); 06768 tmp.set_k(dot.get_k()); 06769 accumulate(tmp,v1,srvector(v2)); 06770 SetRe(dot, Re(dot) + tmp); 06771 } 06772 06774 06777 inline void accumulate(cidotprecision& dot, const rvector& v1, const simatrix_subv& v2) { 06778 idotprecision tmp(0.0); 06779 tmp.set_k(dot.get_k()); 06780 accumulate(tmp,v1,sivector(v2)); 06781 SetRe(dot, Re(dot) + tmp); 06782 } 06783 06785 06788 inline void accumulate(cidotprecision& dot, const ivector_slice& v1, const simatrix_subv& v2) { 06789 idotprecision tmp(0.0); 06790 tmp.set_k(dot.get_k()); 06791 accumulate(tmp,v1,sivector(v2)); 06792 SetRe(dot, Re(dot) + tmp); 06793 } 06794 06796 06799 inline void accumulate(cidotprecision& dot, const ivector_slice& v1, const srmatrix_subv& v2) { 06800 idotprecision tmp(0.0); 06801 tmp.set_k(dot.get_k()); 06802 accumulate(tmp,v1,srvector(v2)); 06803 SetRe(dot, Re(dot) + tmp); 06804 } 06805 06807 06810 inline void accumulate(cidotprecision& dot, const rvector_slice& v1, const simatrix_subv& v2) { 06811 idotprecision tmp(0.0); 06812 tmp.set_k(dot.get_k()); 06813 accumulate(tmp,v1,sivector(v2)); 06814 SetRe(dot, Re(dot) + tmp); 06815 } 06816 06817 } //namespace cxsc; 06818 06819 #include "sparsematrix.inl" 06820 06821 #endif 06822