simatrix.hpp

00001 /*
00002 **  CXSC is a C++ library for eXtended Scientific Computing (V 2.5.1)
00003 **
00004 **  Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
00005 **                          Universitaet Karlsruhe, Germany
00006 **            (C) 2000-2011 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.14 2011/06/07 15:17:42 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 
00056 class simatrix {
00057 
00058   private:
00059     std::vector<int> p;
00060     std::vector<int> ind;
00061     std::vector<interval> x;
00062     int m;
00063     int n;
00064     int lb1,ub1,lb2,ub2;
00065 
00066   public:
00067 
00068     std::vector<int>& column_pointers() {
00069       return p;
00070     }
00071 
00072     std::vector<int>& row_indices() {
00073       return ind;
00074     }
00075 
00076     std::vector<interval>& values() {
00077       return x;
00078     }
00079 
00080     const std::vector<int>& column_pointers() const {
00081       return p;
00082     }
00083 
00084     const std::vector<int>& row_indices() const {
00085       return ind;
00086     }
00087 
00088     const std::vector<interval>& values() const {
00089       return x;
00090     }
00091 
00092     simatrix() {
00093       p.push_back(0);
00094       m = n = 0;
00095       lb1 = lb2 = ub1 = ub2 = 0;
00096     }
00097 
00098     simatrix(const int r, const int c) : m(r),n(c),lb1(1),ub1(r),lb2(1),ub2(c) {
00099       p = std::vector<int>((n>0) ? n+1 : 1, 0);
00100       ind.reserve(2*(m+n));
00101       x.reserve(2*(m+n));
00102 
00103       p[0] = 0;
00104     }
00105 
00106     simatrix(const int r, const int c, const int e) : m(r),n(c),lb1(1),ub1(r),lb2(1),ub2(c) {
00107       p = std::vector<int>((n>0) ? n+1 : 1, 0);
00108       ind.reserve(e);
00109       x.reserve(e);
00110 
00111       p[0] = 0;
00112     }
00113 
00114     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) {
00115       if(t == triplet) {
00116          this->m = m;
00117          this->n = n;
00118          p = std::vector<int>(n+1,0);
00119          ind.reserve(nnz);
00120          x.reserve(nnz);
00121          lb1 = lb2 = 1;
00122          ub1 = m; ub2 = n;
00123 
00124          std::vector<triplet_store<interval> > work;
00125          work.reserve(nnz);
00126 
00127          for(int k=0 ; k<nnz ; k++) {
00128            work.push_back(triplet_store<interval>(rows[Lb(rows)+k],cols[Lb(cols)+k],values[Lb(values)+k]));
00129          }
00130 
00131          sort(work.begin(), work.end());
00132 
00133          int i=0;
00134 
00135          for(int j=0 ; j<n ; j++) {        
00136 
00137            while((unsigned int)i < work.size() && work[i].col == j ) {
00138                ind.push_back(work[i].row);
00139                x.push_back(work[i].val);
00140                i++;
00141            }
00142 
00143            p[j+1] = i;
00144          }
00145          
00146       } else if(t == compressed_row) {
00147 
00148          this->m = m;
00149          this->n = n;
00150          p = std::vector<int>(n+1,0);
00151          ind.reserve(nnz);
00152          x.reserve(nnz);
00153          lb1 = lb2 = 1;
00154          ub1 = m; ub2 = n;
00155 
00156          for(int i=0 ; i<n+1 ; i++)
00157            p[i] = rows[Lb(rows)+i];
00158 
00159          std::vector<triplet_store<interval> > work;
00160          work.reserve(nnz);
00161 
00162          for(int j=0 ; j<n ; j++) {
00163            for(int k=p[j] ; k<p[j+1] ; k++) {
00164              work.push_back(triplet_store<interval>(j,cols[Lb(cols)+k],values[Lb(values)+k]));
00165            }
00166          }
00167 
00168          sort(work.begin(), work.end());
00169 
00170          int i=0;
00171 
00172          for(int j=0 ; j<n ; j++) {        
00173 
00174            while((unsigned int)i < work.size() && work[i].col == j ) {
00175                ind.push_back(work[i].row);
00176                x.push_back(work[i].val);
00177                i++;
00178            }
00179 
00180            p[j+1] = i;
00181          }
00182     
00183       } else if(t == compressed_column) {
00184          this->m = m;
00185          this->n = n;
00186          p = std::vector<int>(n+1,0);
00187          ind.reserve(nnz);
00188          x.reserve(nnz);
00189          lb1 = lb2 = 1;
00190          ub1 = m; ub2 = n;
00191 
00192          for(int i=0 ; i<n+1 ; i++)
00193            p[i] = rows[Lb(rows)+i];
00194 
00195          std::vector<std::pair<int,interval> > work;
00196          work.reserve(n);
00197 
00198          for(int j=0 ; j<n ; j++) {
00199            work.clear();
00200 
00201            for(int k=p[j] ; k<p[j+1] ; k++) {
00202              work.push_back(std::make_pair(cols[Lb(cols)+k],values[Lb(values)+k]));
00203            }
00204 
00205            std::sort(work.begin(),work.end(),comp_pair_i);
00206 
00207            for(unsigned int i=0 ; i<work.size() ; i++) {
00208              ind.push_back(work[i].first);
00209              x.push_back(work[i].second);
00210            }
00211          }
00212 
00213       }
00214 
00215     }
00216 
00217     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) {
00218       if(t == triplet) {
00219          this->m = m;
00220          this->n = n;
00221          p = std::vector<int>(n+1,0);
00222          ind.reserve(nnz);
00223          x.reserve(nnz);
00224          lb1 = lb2 = 1;
00225          ub1 = m; ub2 = n;
00226 
00227          std::vector<triplet_store<interval> > work;
00228          work.reserve(nnz);
00229 
00230          for(int k=0 ; k<nnz ; k++) {
00231            work.push_back(triplet_store<interval>(rows[k],cols[k],values[k]));
00232          }
00233 
00234          sort(work.begin(), work.end());
00235 
00236          int i=0;
00237 
00238          for(int j=0 ; j<n ; j++) {        
00239 
00240            while((unsigned int)i < work.size() && work[i].col == j ) {
00241                ind.push_back(work[i].row);
00242                x.push_back(work[i].val);
00243                i++;
00244            }
00245 
00246            p[j+1] = i;
00247          }
00248          
00249       } else if(t == compressed_row) {
00250 
00251          this->m = m;
00252          this->n = n;
00253          p = std::vector<int>(n+1,0);
00254          ind.reserve(nnz);
00255          x.reserve(nnz);
00256          lb1 = lb2 = 1;
00257          ub1 = m; ub2 = n;
00258 
00259          for(int i=0 ; i<n+1 ; i++)
00260            p[i] = rows[i];
00261 
00262          std::vector<triplet_store<interval> > work;
00263          work.reserve(nnz);
00264 
00265          for(int j=0 ; j<n ; j++) {
00266            for(int k=p[j] ; k<p[j+1] ; k++) {
00267              work.push_back(triplet_store<interval>(j,cols[k],values[k]));
00268            }
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_column) {
00287          this->m = m;
00288          this->n = n;
00289          p = std::vector<int>(n+1,0);
00290          ind.reserve(nnz);
00291          x.reserve(nnz);
00292          lb1 = lb2 = 1;
00293          ub1 = m; ub2 = n;
00294 
00295          for(int i=0 ; i<n+1 ; i++)
00296            p[i] = rows[i];
00297 
00298          std::vector<std::pair<int,interval> > work;
00299          work.reserve(n);
00300 
00301          for(int j=0 ; j<n ; j++) {
00302            work.clear();
00303 
00304            for(int k=p[j] ; k<p[j+1] ; k++) {
00305              work.push_back(std::make_pair(cols[k],values[k]));
00306            }
00307 
00308            std::sort(work.begin(),work.end(),comp_pair_i);
00309 
00310            for(unsigned int i=0 ; i<work.size() ; i++) {
00311              ind.push_back(work[i].first);
00312              x.push_back(work[i].second);
00313            }
00314          }
00315 
00316       }
00317 
00318     }
00319 
00320 
00321     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) {
00322       x.reserve(A.get_nnz());
00323       for(unsigned int i=0 ; i<A.x.size() ; i++)
00324         x.push_back(interval(A.x[i]));
00325     }
00326 
00327 
00328     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)) {
00329       p = std::vector<int>((n>0) ? n+1 : 1, 0);
00330       ind.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
00331       x.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
00332 
00333       p[0] = 0;
00334       int nnz = 0;
00335 
00336       for(int j=0 ; j<n ; j++) {
00337         for(int i=0 ; i<m ; i++) {
00338           if(A[i+lb1][j+lb2] != 0.0) {
00339              ind.push_back(i);
00340              x.push_back(interval(A[i+lb1][j+lb2]));
00341              nnz++;
00342           }
00343         }
00344           
00345         p[j+1] = nnz;
00346       }
00347 
00348     }
00349 
00350     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)) {
00351       p = std::vector<int>((n>0) ? n+1 : 1, 0);
00352       ind.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
00353       x.reserve((m*n*0.1 < 2*m) ? (int)(m*n*0.1) : 2*m);
00354 
00355       p[0] = 0;
00356       int nnz = 0;
00357 
00358       for(int j=0 ; j<n ; j++) {
00359         for(int i=0 ; i<m ; i++) {
00360           if(A[i+lb1][j+lb2] != 0.0) {
00361              ind.push_back(i);
00362              x.push_back(interval(A[i+lb1][j+lb2]));
00363              nnz++;
00364           }
00365         }
00366           
00367         p[j+1] = nnz;
00368       }
00369 
00370     }
00371 
00372     simatrix(const int ms, const int ns, const imatrix& A) : m(ms), n(ns), lb1(1), ub1(ms), lb2(1), ub2(ns)  {
00373       //Banded matrix constructor
00374       int nnz = RowLen(A)*ColLen(A);
00375       p = std::vector<int>((n>0) ? n+1 : 1, 0);
00376       ind.reserve(nnz);
00377       x.reserve(nnz);
00378 
00379       std::vector<triplet_store<interval> > work;
00380       work.reserve(nnz);
00381 
00382       
00383       for(int i=0 ; i<ColLen(A) ; i++) {
00384         for(int j=Lb(A,2) ; j<=Ub(A,2) ; j++) {
00385           if(i+j >=0  &&  i+j < n) {
00386             work.push_back(triplet_store<interval>(i,i+j,A[i+Lb(A,1)][j]));
00387           }
00388         }
00389       }
00390 
00391       sort(work.begin(), work.end());
00392 
00393       int i=0;
00394 
00395       for(int j=0 ; j<n ; j++) {        
00396 
00397         while((unsigned int)i < work.size() && work[i].col == j ) {
00398           ind.push_back(work[i].row);
00399           x.push_back(work[i].val);
00400           i++;
00401         }
00402 
00403         p[j+1] = i;
00404       }
00405 
00406     }
00407 
00408     simatrix(const srmatrix_slice&);
00409     simatrix(const simatrix_slice&);
00410 
00411     void full(imatrix& A) const {
00412        A = imatrix(lb1,ub1,lb2,ub2);
00413        A = 0.0;
00414        for(int j=0 ; j<n ; j++) {
00415           for(int k=p[j] ; k<p[j+1] ; k++) {
00416              A[ind[k]+lb1][j+lb2] = x[k];
00417           }
00418        }
00419     }
00420 
00421     void dropzeros() {
00422       std::vector<int> pnew(n+1,0);
00423       std::vector<int> indnew;
00424       std::vector<interval> xnew;
00425       int nnznew = 0;
00426 
00427       for(int j=0 ; j<n ; j++) {
00428         for(int k=p[j] ; k<p[j+1] ; k++) {
00429           if(x[k] != 0.0) {
00430             xnew.push_back(x[k]);
00431             indnew.push_back(ind[k]);
00432             nnznew++;
00433           }
00434         }
00435         pnew[j+1] = nnznew;
00436       }
00437 
00438       p = pnew;
00439       ind = indnew;
00440       x = xnew;
00441     }
00442 
00443 
00444     simatrix& operator=(const real& A) {
00445       return sp_ms_assign<simatrix,real,interval>(*this,A);
00446     }
00447 
00448     simatrix& operator=(const interval& A) {
00449       return sp_ms_assign<simatrix,interval,interval>(*this,A);
00450     }
00451 
00452     simatrix& operator=(const rmatrix& A) {
00453       return spf_mm_assign<simatrix,rmatrix,interval>(*this,A);
00454     }
00455 
00456     simatrix& operator=(const imatrix& A) {
00457       return spf_mm_assign<simatrix,imatrix,interval>(*this,A);
00458     }
00459 
00460     simatrix& operator=(const rmatrix_slice& A) {
00461       return spf_mm_assign<simatrix,rmatrix_slice,interval>(*this,A);
00462     }
00463 
00464     simatrix& operator=(const imatrix_slice& A) {
00465       return spf_mm_assign<simatrix,imatrix_slice,interval>(*this,A);
00466     }
00467 
00468     simatrix& operator=(const srmatrix& A) {
00469       m = A.m;
00470       n = A.n;
00471       p = A.p;
00472       ind = A.ind;
00473       x.clear();
00474       x.reserve(A.get_nnz());
00475       for(unsigned int i=0 ; i<A.x.size() ; i++)
00476         x.push_back(interval(A.x[i]));
00477       return *this;
00478     }
00479 
00480     /* simatrix& operator=(const simatrix& A) {
00481       p = A.p;
00482       ind = A.ind;
00483       x = A.x;
00484       return *this;
00485     } */
00486 
00487     simatrix& operator=(const srmatrix_slice&);
00488     simatrix& operator=(const simatrix_slice&);
00489 
00490     const interval operator()(int i, int j) const {
00491 #if(CXSC_INDEX_CHECK)
00492       if(i<lb1 || i>ub1 || j<lb2 || j>ub2)
00493         cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int)"));
00494 #endif
00495       interval r(0.0);
00496       for(int k=p[j-lb2] ; k<p[j-lb2+1] && ind[k]<=i-lb1 ; k++) {
00497         if(ind[k] == i-lb1)  r = x[k];
00498       }
00499       return r;
00500     }
00501 
00502     interval& element(int i, int j) {
00503 #if(CXSC_INDEX_CHECK)
00504       if(i<lb1 || i>ub1 || j<lb2 || j>ub2)
00505         cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int)"));
00506 #endif
00507       int k;
00508       for(k=p[j-lb2] ; k<p[j-lb2+1] && ind[k]<=i-lb1 ; k++) {
00509         if(ind[k] == i-lb1)  return x[k];
00510       }
00511 
00512       //Nicht gefunden, Element muss angelegt werden, da Schreibzugriff moeglich
00513       std::vector<int>::iterator ind_it = ind.begin() + k;
00514       std::vector<interval>::iterator x_it  = x.begin() + k;
00515       ind.insert(ind_it, i-lb1);
00516       x_it = x.insert(x_it, interval(0.0));
00517       for(k=j-lb2+1 ; k<(int)p.size() ; k++)
00518         p[k]++;
00519 
00520       return *x_it;
00521     }
00522 
00523     simatrix_subv operator[](const cxscmatrix_column&);
00524     simatrix_subv operator[](const int);
00525     const simatrix_subv operator[](const cxscmatrix_column&) const;
00526     const simatrix_subv operator[](const int) const;
00527 
00528     simatrix_slice operator()(const int, const int , const int, const int);
00529 
00530     simatrix operator()(const intvector& pervec, const intvector& q) {
00531       simatrix A(m,n,get_nnz());
00532       intvector per = perminv(pervec);
00533 
00534       int nnz=0;
00535       for(int k=0 ; k<n ; k++) {
00536         A.p[k] = nnz;
00537 
00538         std::map<int,interval> work;
00539         for(int j=p[q[Lb(q)+k]] ; j<p[q[Lb(q)+k]+1] ; j++) 
00540            work.insert(std::make_pair(per[Lb(per)+ind[j]], x[j]));
00541         
00542         for(std::map<int,interval>::iterator it = work.begin() ; it != work.end() ; it++) {
00543            A.ind.push_back(it->first);
00544            A.x.push_back(it->second);
00545         }
00546 
00547         nnz += work.size();
00548  
00549       }
00550 
00551       A.p[n] = nnz;
00552 
00553       return A;
00554     }
00555 
00556     simatrix operator()(const intvector& pervec) {
00557       simatrix A(m,n,get_nnz());
00558       intvector per = perminv(pervec);
00559 
00560       for(int k=0 ; k<n ; k++) {
00561         A.p[k] = p[k];
00562 
00563         std::map<int,interval> work;
00564         for(int j=p[k] ; j<p[k+1] ; j++) 
00565            work.insert(std::make_pair(per[Lb(per)+ind[j]], x[j]));
00566         
00567         for(std::map<int,interval>::iterator it = work.begin() ; it != work.end() ; it++) {
00568            A.ind.push_back(it->first);
00569            A.x.push_back(it->second);
00570         }
00571  
00572       }
00573 
00574       A.p[n] = p[n];
00575 
00576       return A;
00577     }
00578 
00579     simatrix operator()(const intmatrix& P, const intmatrix& Q) {
00580       intvector p = permvec(P);
00581       intvector q = perminv(permvec(Q));
00582       return (*this)(p,q);
00583     }
00584 
00585     simatrix operator()(const intmatrix& P) {
00586       intvector p = permvec(P);
00587       return (*this)(p);
00588     }
00589 
00590     real density() const {
00591       return p[n]/((double)m*n);
00592     }
00593 
00594     int get_nnz() const {
00595       return p[n];
00596     }
00597 
00598     simatrix& operator+=(const rmatrix& B) {
00599       return spf_mm_addassign<simatrix,rmatrix,imatrix>(*this,B);
00600     }
00601 
00602     simatrix& operator+=(const imatrix& B) {
00603       return spf_mm_addassign<simatrix,imatrix,imatrix>(*this,B);
00604     }
00605 
00606     simatrix& operator+=(const rmatrix_slice& B) {
00607       return spf_mm_addassign<simatrix,rmatrix_slice,imatrix>(*this,B);
00608     }
00609 
00610     simatrix& operator+=(const imatrix_slice& B) {
00611       return spf_mm_addassign<simatrix,imatrix_slice,imatrix>(*this,B);
00612     }
00613 
00614     simatrix& operator+=(const srmatrix& B) {
00615       return spsp_mm_addassign<simatrix,srmatrix,interval>(*this,B);
00616     }
00617 
00618     simatrix& operator+=(const simatrix& B) {
00619       return spsp_mm_addassign<simatrix,simatrix,interval>(*this,B);
00620     }
00621 
00622     simatrix& operator-=(const rmatrix& B) {
00623       return spf_mm_subassign<simatrix,rmatrix,imatrix>(*this,B);
00624     }
00625 
00626     simatrix& operator-=(const imatrix& B) {
00627       return spf_mm_subassign<simatrix,imatrix,imatrix>(*this,B);
00628     }
00629 
00630     simatrix& operator-=(const rmatrix_slice& B) {
00631       return spf_mm_subassign<simatrix,rmatrix_slice,imatrix>(*this,B);
00632     }
00633 
00634     simatrix& operator-=(const imatrix_slice& B) {
00635       return spf_mm_subassign<simatrix,imatrix_slice,imatrix>(*this,B);
00636     }
00637 
00638     simatrix& operator-=(const srmatrix& B) {
00639       return spsp_mm_subassign<simatrix,srmatrix,interval>(*this,B);
00640     }
00641 
00642     simatrix& operator-=(const simatrix& B) {
00643       return spsp_mm_subassign<simatrix,simatrix,interval>(*this,B);
00644     }
00645 
00646     simatrix& operator*=(const imatrix& B) {
00647       return spf_mm_multassign<simatrix,imatrix,sparse_idot,imatrix>(*this,B);
00648     }
00649 
00650     simatrix& operator*=(const rmatrix& B) {
00651       return spf_mm_multassign<simatrix,rmatrix,sparse_idot,imatrix>(*this,B);
00652     }
00653 
00654     simatrix& operator*=(const rmatrix_slice& B) {
00655       return spf_mm_multassign<simatrix,rmatrix_slice,sparse_idot,imatrix>(*this,B);
00656     }
00657 
00658     simatrix& operator*=(const imatrix_slice& B) {
00659       return spf_mm_multassign<simatrix,imatrix_slice,sparse_idot,imatrix>(*this,B);
00660     }
00661 
00662     simatrix& operator*=(const srmatrix& B) {
00663       return spsp_mm_multassign<simatrix,srmatrix,sparse_idot,interval>(*this,B);
00664     }
00665 
00666     simatrix& operator*=(const simatrix& B) {
00667       return spsp_mm_multassign<simatrix,simatrix,sparse_idot,interval>(*this,B);
00668     }
00669 
00670     simatrix& operator*=(const real& r) {
00671       return sp_ms_multassign(*this,r);
00672     }
00673 
00674     simatrix& operator*=(const interval& r) {
00675       return sp_ms_multassign(*this,r);
00676     }
00677 
00678     simatrix& operator/=(const real& r) {
00679       return sp_ms_divassign(*this,r);
00680     }
00681 
00682     simatrix& operator/=(const interval& r) {
00683       return sp_ms_divassign(*this,r);
00684     }
00685 
00686     simatrix& operator|=(const rmatrix& B) {
00687       return spf_mm_hullassign<simatrix,rmatrix,imatrix>(*this,B);
00688     }
00689 
00690     simatrix& operator|=(const imatrix& B) {
00691       return spf_mm_hullassign<simatrix,imatrix,imatrix>(*this,B);
00692     }
00693 
00694     simatrix& operator|=(const rmatrix_slice& B) {
00695       return spf_mm_hullassign<simatrix,rmatrix_slice,imatrix>(*this,B);
00696     }
00697 
00698     simatrix& operator|=(const imatrix_slice& B) {
00699       return spf_mm_hullassign<simatrix,imatrix_slice,imatrix>(*this,B);
00700     }
00701 
00702     simatrix& operator|=(const srmatrix& B) {
00703       return spsp_mm_hullassign<simatrix,srmatrix,interval>(*this,B);
00704     }
00705 
00706     simatrix& operator|=(const simatrix& B) {
00707       return spsp_mm_hullassign<simatrix,simatrix,interval>(*this,B);
00708     }
00709 
00710     simatrix& operator&=(const imatrix& B) {
00711       return spf_mm_intersectassign<simatrix,imatrix,imatrix>(*this,B);
00712     }
00713 
00714     simatrix& operator&=(const imatrix_slice& B) {
00715       return spf_mm_intersectassign<simatrix,imatrix_slice,imatrix>(*this,B);
00716     }
00717 
00718     simatrix& operator&=(const simatrix& B) {
00719       return spsp_mm_intersectassign<simatrix,simatrix,interval>(*this,B);
00720     }
00721 
00722     friend void SetLb(simatrix&, const int, const int);
00723     friend void SetUb(simatrix&, const int, const int);    
00724     friend int Lb(const simatrix&, int);
00725     friend int Ub(const simatrix&, int);
00726     friend int RowLen(const simatrix&);
00727     friend int ColLen(const simatrix&);
00728     friend srmatrix Inf(const simatrix&);
00729     friend srmatrix Sup(const simatrix&);
00730     friend simatrix Re(const scimatrix&);
00731     friend simatrix Im(const scimatrix&);
00732     friend simatrix abs(const simatrix&);
00733     friend srmatrix mid(const simatrix&);
00734     friend srmatrix diam(const simatrix&);
00735     friend simatrix abs(const scimatrix&);
00736     friend srmatrix absmin(const simatrix&);
00737     friend srmatrix absmax(const simatrix&);
00738 
00739     friend simatrix transp(const simatrix&);
00740     friend simatrix Id(const simatrix&);
00741     friend srmatrix CompMat(const simatrix&);
00742 
00743     friend std::istream& operator>>(std::istream&, simatrix_slice&);
00744     friend std::istream& operator>>(std::istream&, simatrix_subv&);
00745 
00746     friend class srmatrix_slice;
00747     friend class srmatrix_subv;
00748     friend class srvector;
00749     friend class simatrix_slice;
00750     friend class simatrix_subv;
00751     friend class sivector;
00752     friend class scimatrix;
00753     friend class scimatrix_slice;
00754     friend class scimatrix_subv;
00755     friend class scivector;
00756     friend class rmatrix;
00757     friend class imatrix;
00758     friend class cimatrix;
00759 
00760 #include "matrix_friend_declarations.inl"
00761 };
00762 
00763 inline imatrix::imatrix(const srmatrix& A) {
00764   dat = new interval[A.m*A.n];
00765   lb1 = A.lb1; lb2 = A.lb2; ub1 = A.ub1; ub2 = A.ub2;
00766   xsize = A.n;
00767   ysize = A.m;
00768   *this = 0.0;
00769   for(int j=0 ; j<A.n ; j++) {
00770      for(int k=A.p[j] ; k<A.p[j+1] ; k++) {
00771         dat[A.ind[k]*A.n+j] = A.x[k];
00772      }
00773   }
00774 }
00775 
00776 inline imatrix::imatrix(const simatrix& A) {
00777   dat = new interval[A.m*A.n];
00778   lb1 = A.lb1; lb2 = A.lb2; ub1 = A.ub1; ub2 = A.ub2;
00779   xsize = A.n;
00780   ysize = A.m;
00781   *this = 0.0;
00782   for(int j=0 ; j<A.n ; j++) {
00783      for(int k=A.p[j] ; k<A.p[j+1] ; k++) {
00784         dat[A.ind[k]*A.n+j] = A.x[k];
00785      }
00786   }
00787 }
00788 
00789 inline simatrix Id(const simatrix& A) {
00790   simatrix I(A.m, A.n, (A.m>A.n) ? A.m : A.n);
00791   I.lb1 = A.lb1; I.lb2 = A.lb2;
00792   I.ub1 = A.ub1; I.ub2 = A.ub2;
00793 
00794   if(A.m < A.n) {
00795     for(int i=0 ; i<A.m ; i++) {
00796       I.p[i+1] = I.p[i] + 1;
00797       I.ind.push_back(i);
00798       I.x.push_back(interval(1.0));
00799     }
00800   } else {
00801     for(int i=0 ; i<A.n ; i++) {
00802       I.p[i+1] = I.p[i] + 1;
00803       I.ind.push_back(i);
00804       I.x.push_back(interval(1.0));
00805     }
00806   }
00807 
00808   return I;
00809 }
00810 
00811 inline simatrix transp(const simatrix& A) {
00812   simatrix B(A.n, A.m, A.get_nnz());
00813      
00814   //NIchtnullen pro Zeile bestimmen
00815   std::vector<int> w(A.m,0);
00816   for(unsigned int i=0 ; i<A.ind.size() ; i++) 
00817     w[A.ind[i]]++;
00818 
00819   //Spalten"pointer" setzen
00820   B.p.resize(A.m+1);
00821   B.p[0] = 0;
00822   for(unsigned int i=1 ; i<B.p.size() ; i++)
00823     B.p[i] = w[i-1] + B.p[i-1];
00824 
00825   //w vorbereiten
00826   w.insert(w.begin(), 0); 
00827   for(unsigned int i=1 ; i<w.size() ; i++) {
00828     w[i] += w[i-1];
00829   }
00830 
00831   //neuer zeilenindex und wert wird gesetzt
00832   int q;
00833   B.ind.resize(A.get_nnz());
00834   B.x.resize(A.get_nnz());
00835   for(int j=0 ; j<A.n ; j++) {
00836     for(int k=A.p[j] ; k<A.p[j+1] ; k++) {
00837       q = w[A.ind[k]]++;
00838       B.ind[q] = j;
00839       B.x[q] = A.x[k];
00840     }
00841   }
00842 
00843   return B;
00844 }
00845 
00846 inline void SetLb(simatrix& A, const int i, const int j) {
00847   if(i==1) {
00848     A.lb1 = j;
00849     A.ub1 = j + A.m - 1;
00850   } else if(i==2) {
00851     A.lb2 = j;
00852     A.ub2 = j + A.n - 1;
00853   }
00854 }
00855 
00856 inline void SetUb(simatrix& A, const int i, const int j) {
00857   if(i==1) {
00858     A.ub1 = j;
00859     A.lb1 = j - A.m + 1;
00860   } else if(i==2) {
00861     A.ub2 = j;
00862     A.lb2 = j - A.n + 1;
00863   }
00864 }
00865 
00866 inline int Lb(const simatrix& A, int i) {
00867   if(i==1) 
00868     return A.lb1;
00869   else if(i==2)
00870     return A.lb2;
00871   else
00872     return 1;
00873 }
00874 
00875 inline int Ub(const simatrix& A, int i) {
00876   if(i==1) 
00877     return A.ub1;
00878   else if(i==2)
00879     return A.ub2;
00880   else
00881     return 1;
00882 }
00883 
00884 inline int RowLen(const simatrix& A) {
00885   return A.n;
00886 }
00887 
00888 inline int ColLen(const simatrix& A) {
00889   return A.m;
00890 }
00891 
00892 inline void Resize(simatrix& A) {
00893   sp_m_resize(A);
00894 }
00895 
00896 inline void Resize(simatrix& A, const int m, const int n) {
00897   sp_m_resize(A,m,n);
00898 }
00899 
00900 inline void Resize(simatrix& A, const int l1, const int u1, const int l2, const int u2) {
00901   sp_m_resize(A,l1,u1,l2,u2);
00902 }
00903 
00904 inline srmatrix Inf(const simatrix& A) {
00905   srmatrix res(A.m,A.n,A.get_nnz());
00906   res.lb1 = A.lb1;
00907   res.lb2 = A.lb2;
00908   res.ub1 = A.ub1;
00909   res.ub2 = A.ub2;
00910   res.p   = A.p;
00911   res.ind = A.ind;
00912 
00913   for(int i=0 ; i<res.get_nnz() ; i++)
00914     res.x.push_back(Inf(A.x[i]));
00915 
00916   res.dropzeros();
00917 
00918   return res; 
00919 }
00920 
00921 inline srmatrix Sup(const simatrix& A) {
00922   srmatrix res(A.m,A.n,A.get_nnz());
00923   res.lb1 = A.lb1;
00924   res.lb2 = A.lb2;
00925   res.ub1 = A.ub1;
00926   res.ub2 = A.ub2;
00927   res.p   = A.p;
00928   res.ind = A.ind;
00929 
00930   for(int i=0 ; i<res.get_nnz() ; i++)
00931     res.x.push_back(Sup(A.x[i]));
00932 
00933   res.dropzeros();
00934 
00935   return res; 
00936 }
00937 
00938 inline simatrix abs(const simatrix& A) {
00939   simatrix res(A.m,A.n,A.get_nnz());
00940   res.lb1 = A.lb1;
00941   res.lb2 = A.lb2;
00942   res.ub1 = A.ub1;
00943   res.ub2 = A.ub2;
00944   res.p   = A.p;
00945   res.ind = A.ind;
00946 
00947   for(int i=0 ; i<res.get_nnz() ; i++)
00948     res.x.push_back(abs(A.x[i]));
00949 
00950   res.dropzeros();
00951 
00952   return res; 
00953 }
00954 
00955 inline srmatrix absmin(const simatrix& A) {
00956   srmatrix res(A.m,A.n,A.get_nnz());
00957   res.lb1 = A.lb1;
00958   res.lb2 = A.lb2;
00959   res.ub1 = A.ub1;
00960   res.ub2 = A.ub2;
00961   res.p   = A.p;
00962   res.ind = A.ind;
00963 
00964   for(int i=0 ; i<res.get_nnz() ; i++)
00965     res.x.push_back(AbsMin(A.x[i]));
00966 
00967   res.dropzeros();
00968 
00969   return res; 
00970 }
00971 
00972 inline srmatrix absmax(const simatrix& A) {
00973   srmatrix res(A.m,A.n,A.get_nnz());
00974   res.lb1 = A.lb1;
00975   res.lb2 = A.lb2;
00976   res.ub1 = A.ub1;
00977   res.ub2 = A.ub2;
00978   res.p   = A.p;
00979   res.ind = A.ind;
00980 
00981   for(int i=0 ; i<res.get_nnz() ; i++)
00982     res.x.push_back(AbsMax(A.x[i]));
00983 
00984   res.dropzeros();
00985 
00986   return res; 
00987 }
00988 
00989 inline srmatrix CompMat(const simatrix& A) {
00990   srmatrix res(A.m,A.n,A.get_nnz());
00991   res.lb1 = A.lb1;
00992   res.lb2 = A.lb2;
00993   res.ub1 = A.ub1;
00994   res.ub2 = A.ub2;
00995   res.p   = A.p;
00996   res.ind = A.ind;
00997   res.p[A.n] = A.p[A.n];
00998 
00999   for(int j=0 ; j<res.n ; j++) {
01000     res.p[j] = A.p[j];
01001     for(int k=A.p[j] ; k<A.p[j+1] ; k++) {
01002       res.ind.push_back(A.ind[k]);
01003       if(A.ind[k] == j)
01004         res.x.push_back(AbsMin(A.x[k]));
01005       else
01006         res.x.push_back(-AbsMax(A.x[k]));
01007     }
01008   }
01009 
01010   res.dropzeros();
01011 
01012   return res; 
01013 }
01014 
01015 inline srmatrix mid(const simatrix& A) {
01016   srmatrix res(A.m,A.n,A.get_nnz());
01017   res.lb1 = A.lb1;
01018   res.lb2 = A.lb2;
01019   res.ub1 = A.ub1;
01020   res.ub2 = A.ub2;
01021   res.p   = A.p;
01022   res.ind = A.ind;
01023 
01024   for(int i=0 ; i<res.get_nnz() ; i++)
01025     res.x.push_back(mid(A.x[i]));
01026 
01027   res.dropzeros();
01028 
01029   return res; 
01030 }
01031 
01032 inline srmatrix diam(const simatrix& A) {
01033   srmatrix res(A.m,A.n,A.get_nnz());
01034   res.lb1 = A.lb1;
01035   res.lb2 = A.lb2;
01036   res.ub1 = A.ub1;
01037   res.ub2 = A.ub2;
01038   res.p   = A.p;
01039   res.ind = A.ind;
01040 
01041   for(int i=0 ; i<res.get_nnz() ; i++)
01042     res.x.push_back(diam(A.x[i]));
01043 
01044   res.dropzeros();
01045 
01046   return res; 
01047 }
01048 
01049 
01050 inline imatrix operator*(const imatrix& A, const srmatrix& B) {
01051   return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(A,B);
01052 }
01053 
01054 inline imatrix operator*(const rmatrix& A, const simatrix& B) {
01055   return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(A,B);
01056 }
01057 
01058 inline imatrix operator*(const imatrix& A, const simatrix& B) {
01059   return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(A,B);
01060 }
01061 
01062 inline imatrix operator*(const simatrix& A, const rmatrix& B) {
01063   return spf_mm_mult<simatrix,rmatrix,imatrix,sparse_idot>(A,B);
01064 }
01065 
01066 inline imatrix operator*(const srmatrix& A, const imatrix& B) {
01067   return spf_mm_mult<srmatrix,imatrix,imatrix,sparse_idot>(A,B);
01068 }
01069 
01070 inline imatrix operator*(const simatrix& A, const imatrix& B) {
01071   return spf_mm_mult<simatrix,imatrix,imatrix,sparse_idot>(A,B);
01072 }
01073 
01074 inline imatrix operator*(const imatrix_slice& A, const srmatrix& B) {
01075   return fsp_mm_mult<imatrix_slice,srmatrix,imatrix,sparse_idot>(A,B);
01076 }
01077 
01078 inline imatrix operator*(const rmatrix_slice& A, const simatrix& B) {
01079   return fsp_mm_mult<rmatrix_slice,simatrix,imatrix,sparse_idot>(A,B);
01080 }
01081 
01082 inline imatrix operator*(const imatrix_slice& A, const simatrix& B) {
01083   return fsp_mm_mult<imatrix_slice,simatrix,imatrix,sparse_idot>(A,B);
01084 }
01085 
01086 inline imatrix operator*(const simatrix& A, const rmatrix_slice& B) {
01087   return spf_mm_mult<simatrix,rmatrix_slice,imatrix,sparse_idot>(A,B);
01088 }
01089 
01090 inline imatrix operator*(const srmatrix& A, const imatrix_slice& B) {
01091   return spf_mm_mult<srmatrix,imatrix_slice,imatrix,sparse_idot>(A,B);
01092 }
01093 
01094 inline imatrix operator*(const simatrix& A, const imatrix_slice& B) {
01095   return spf_mm_mult<simatrix,imatrix_slice,imatrix,sparse_idot>(A,B);
01096 }
01097 
01098 inline simatrix operator*(const simatrix& A, const srmatrix& B) {
01099   return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(A,B);
01100 }
01101 
01102 inline simatrix operator*(const srmatrix& A, const simatrix& B) {
01103   return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(A,B);
01104 }
01105 
01106 inline simatrix operator*(const simatrix& A, const simatrix& B) {
01107   return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(A,B);
01108 }
01109 
01110 inline simatrix operator/(const simatrix& A, const real& r) {
01111   return sp_ms_div<simatrix,real,simatrix>(A,r);
01112 }
01113 
01114 inline simatrix operator/(const simatrix& A, const interval& r) {
01115   return sp_ms_div<simatrix,interval,simatrix>(A,r);
01116 }
01117 
01118 inline simatrix operator/(const srmatrix& A, const interval& r) {
01119   return sp_ms_div<srmatrix,interval,simatrix>(A,r);
01120 }
01121 
01122 inline simatrix operator*(const simatrix& A, const real& r) {
01123   return sp_ms_mult<simatrix,real,simatrix>(A,r);
01124 }
01125 
01126 inline simatrix operator*(const simatrix& A, const interval& r) {
01127   return sp_ms_mult<simatrix,interval,simatrix>(A,r);
01128 }
01129 
01130 inline simatrix operator*(const srmatrix& A, const interval& r) {
01131   return sp_ms_mult<srmatrix,interval,simatrix>(A,r);
01132 }
01133 
01134 inline simatrix operator*(const real& r, const simatrix& A) {
01135   return sp_sm_mult<real,simatrix,simatrix>(r,A);
01136 }
01137 
01138 inline simatrix operator*(const interval& r, const simatrix& A) {
01139   return sp_sm_mult<interval,simatrix,simatrix>(r,A);
01140 }
01141 
01142 inline simatrix operator*(const interval& r, const srmatrix& A) {
01143   return sp_sm_mult<interval,srmatrix,simatrix>(r,A);
01144 }
01145 
01146 inline ivector operator*(const simatrix& A, const rvector& v) {
01147   return spf_mv_mult<simatrix,rvector,ivector,sparse_idot>(A,v);
01148 }
01149 
01150 inline ivector operator*(const srmatrix& A, const ivector& v) {
01151   return spf_mv_mult<srmatrix,ivector,ivector,sparse_idot>(A,v);
01152 }
01153 
01154 inline ivector operator*(const simatrix& A, const ivector& v) {
01155   return spf_mv_mult<simatrix,ivector,ivector,sparse_idot>(A,v);
01156 }
01157 
01158 inline ivector operator*(const simatrix& A, const rvector_slice& v) {
01159   return spf_mv_mult<simatrix,rvector_slice,ivector,sparse_idot>(A,v);
01160 }
01161 
01162 inline ivector operator*(const srmatrix& A, const ivector_slice& v) {
01163   return spf_mv_mult<srmatrix,ivector_slice,ivector,sparse_idot>(A,v);
01164 }
01165 
01166 inline ivector operator*(const simatrix& A, const ivector_slice& v) {
01167   return spf_mv_mult<simatrix,ivector_slice,ivector,sparse_idot>(A,v);
01168 }
01169 
01170 inline sivector operator*(const simatrix& A, const srvector& v) {
01171   return spsp_mv_mult<simatrix,srvector,sivector,sparse_idot,interval>(A,v);
01172 }
01173 
01174 inline sivector operator*(const srmatrix& A, const sivector& v) {
01175   return spsp_mv_mult<srmatrix,sivector,sivector,sparse_idot,interval>(A,v);
01176 }
01177 
01178 inline sivector operator*(const simatrix& A, const sivector& v) {
01179   return spsp_mv_mult<simatrix,sivector,sivector,sparse_idot,interval>(A,v);
01180 }
01181 
01182 inline sivector operator*(const simatrix& A, const srvector_slice& v) {
01183   return spsl_mv_mult<simatrix,srvector_slice,sivector,sparse_idot,interval>(A,v);
01184 }
01185 
01186 inline sivector operator*(const srmatrix& A, const sivector_slice& v) {
01187   return spsl_mv_mult<srmatrix,sivector_slice,sivector,sparse_idot,interval>(A,v);
01188 }
01189 
01190 inline sivector operator*(const simatrix& A, const sivector_slice& v) {
01191   return spsl_mv_mult<simatrix,sivector_slice,sivector,sparse_idot,interval>(A,v);
01192 }
01193 
01194 inline ivector operator*(const imatrix& A, const srvector& v) {
01195   return fsp_mv_mult<imatrix,srvector,ivector,sparse_idot>(A,v);
01196 }
01197 
01198 inline ivector operator*(const rmatrix& A, const sivector& v) {
01199   return fsp_mv_mult<rmatrix,sivector,ivector,sparse_idot>(A,v);
01200 }
01201 
01202 inline ivector operator*(const imatrix& A, const sivector& v) {
01203   return fsp_mv_mult<imatrix,sivector,ivector,sparse_idot>(A,v);
01204 }
01205 
01206 inline ivector operator*(const imatrix_slice& A, const srvector& v) {
01207   return fsp_mv_mult<imatrix_slice,srvector,ivector,sparse_idot>(A,v);
01208 }
01209 
01210 inline ivector operator*(const rmatrix_slice& A, const sivector& v) {
01211   return fsp_mv_mult<rmatrix_slice,sivector,ivector,sparse_idot>(A,v);
01212 }
01213 
01214 inline ivector operator*(const imatrix_slice& A, const sivector& v) {
01215   return fsp_mv_mult<imatrix_slice,sivector,ivector,sparse_idot>(A,v);
01216 }
01217 
01218 inline ivector operator*(const imatrix& A, const srvector_slice& v) {
01219   return fsl_mv_mult<imatrix,srvector_slice,ivector,sparse_idot>(A,v);
01220 }
01221 
01222 inline ivector operator*(const rmatrix& A, const sivector_slice& v) {
01223   return fsl_mv_mult<rmatrix,sivector_slice,ivector,sparse_idot>(A,v);
01224 }
01225 
01226 inline ivector operator*(const imatrix& A, const sivector_slice& v) {
01227   return fsl_mv_mult<imatrix,sivector_slice,ivector,sparse_idot>(A,v);
01228 }
01229 
01230 inline ivector operator*(const imatrix_slice& A, const srvector_slice& v) {
01231   return fsl_mv_mult<imatrix_slice,srvector_slice,ivector,sparse_idot>(A,v);
01232 }
01233 
01234 inline ivector operator*(const rmatrix_slice& A, const sivector_slice& v) {
01235   return fsl_mv_mult<rmatrix_slice,sivector_slice,ivector,sparse_idot>(A,v);
01236 }
01237 
01238 inline ivector operator*(const imatrix_slice& A, const sivector_slice& v) {
01239   return fsl_mv_mult<imatrix_slice,sivector_slice,ivector,sparse_idot>(A,v);
01240 }
01241 
01242 inline imatrix operator+(const imatrix& A, const srmatrix& B) {
01243   return fsp_mm_add<imatrix,srmatrix,imatrix>(A,B);
01244 }
01245 
01246 inline imatrix operator+(const rmatrix& A, const simatrix& B) {
01247   return fsp_mm_add<rmatrix,simatrix,imatrix>(A,B);
01248 }
01249 
01250 inline imatrix operator+(const imatrix& A, const simatrix& B) {
01251   return fsp_mm_add<imatrix,simatrix,imatrix>(A,B);
01252 }
01253 
01254 inline imatrix operator+(const simatrix& A, const rmatrix& B) {
01255   return spf_mm_add<simatrix,rmatrix,imatrix>(A,B);
01256 }
01257 
01258 inline imatrix operator+(const srmatrix& A, const imatrix& B) {
01259   return spf_mm_add<srmatrix,imatrix,imatrix>(A,B);
01260 }
01261 
01262 inline imatrix operator+(const simatrix& A, const imatrix& B) {
01263   return spf_mm_add<simatrix,imatrix,imatrix>(A,B);
01264 }
01265 
01266 inline imatrix operator+(const imatrix_slice& A, const srmatrix& B) {
01267   return fsp_mm_add<imatrix_slice,srmatrix,imatrix>(A,B);
01268 }
01269 
01270 inline imatrix operator+(const rmatrix_slice& A, const simatrix& B) {
01271   return fsp_mm_add<rmatrix_slice,simatrix,imatrix>(A,B);
01272 }
01273 
01274 inline imatrix operator+(const imatrix_slice& A, const simatrix& B) {
01275   return fsp_mm_add<imatrix_slice,simatrix,imatrix>(A,B);
01276 }
01277 
01278 inline imatrix operator+(const simatrix& A, const rmatrix_slice& B) {
01279   return spf_mm_add<simatrix,rmatrix_slice,imatrix>(A,B);
01280 }
01281 
01282 inline imatrix operator+(const srmatrix& A, const imatrix_slice& B) {
01283   return spf_mm_add<srmatrix,imatrix_slice,imatrix>(A,B);
01284 }
01285 
01286 inline imatrix operator+(const simatrix& A, const imatrix_slice& B) {
01287   return spf_mm_add<simatrix,imatrix_slice,imatrix>(A,B);
01288 }
01289 
01290 inline simatrix operator+(const simatrix& A, const srmatrix& B) {
01291   return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(A,B);
01292 }
01293 
01294 inline simatrix operator+(const srmatrix& A, const simatrix& B) {
01295   return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(A,B);
01296 }
01297 
01298 inline simatrix operator+(const simatrix& A, const simatrix& B) {
01299   return spsp_mm_add<simatrix,simatrix,simatrix,interval>(A,B);
01300 }
01301 
01302 inline imatrix operator-(const imatrix& A, const srmatrix& B) {
01303   return fsp_mm_sub<imatrix,srmatrix,imatrix>(A,B);
01304 }
01305 
01306 inline imatrix operator-(const rmatrix& A, const simatrix& B) {
01307   return fsp_mm_sub<rmatrix,simatrix,imatrix>(A,B);
01308 }
01309 
01310 inline imatrix operator-(const imatrix& A, const simatrix& B) {
01311   return fsp_mm_sub<imatrix,simatrix,imatrix>(A,B);
01312 }
01313 
01314 inline imatrix operator-(const simatrix& A, const rmatrix& B) {
01315   return spf_mm_sub<simatrix,rmatrix,imatrix>(A,B);
01316 }
01317 
01318 inline imatrix operator-(const srmatrix& A, const imatrix& B) {
01319   return spf_mm_sub<srmatrix,imatrix,imatrix>(A,B);
01320 }
01321 
01322 inline imatrix operator-(const simatrix& A, const imatrix& B) {
01323   return spf_mm_sub<simatrix,imatrix,imatrix>(A,B);
01324 }
01325 
01326 inline imatrix operator-(const imatrix_slice& A, const srmatrix& B) {
01327   return fsp_mm_sub<imatrix_slice,srmatrix,imatrix>(A,B);
01328 }
01329 
01330 inline imatrix operator-(const rmatrix_slice& A, const simatrix& B) {
01331   return fsp_mm_sub<rmatrix_slice,simatrix,imatrix>(A,B);
01332 }
01333 
01334 inline imatrix operator-(const imatrix_slice& A, const simatrix& B) {
01335   return fsp_mm_sub<imatrix_slice,simatrix,imatrix>(A,B);
01336 }
01337 
01338 inline imatrix operator-(const simatrix& A, const rmatrix_slice& B) {
01339   return spf_mm_sub<simatrix,rmatrix_slice,imatrix>(A,B);
01340 }
01341 
01342 inline imatrix operator-(const srmatrix& A, const imatrix_slice& B) {
01343   return spf_mm_sub<srmatrix,imatrix_slice,imatrix>(A,B);
01344 }
01345 
01346 inline imatrix operator-(const simatrix& A, const imatrix_slice& B) {
01347   return spf_mm_sub<simatrix,imatrix_slice,imatrix>(A,B);
01348 }
01349 
01350 inline simatrix operator-(const simatrix& A, const srmatrix& B) {
01351   return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(A,B);
01352 }
01353 
01354 inline simatrix operator-(const srmatrix& A, const simatrix& B) {
01355   return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(A,B);
01356 }
01357 
01358 inline simatrix operator-(const simatrix& A, const simatrix& B) {
01359   return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(A,B);
01360 }
01361 
01362 inline imatrix operator|(const imatrix& A, const srmatrix& B) {
01363   return fsp_mm_hull<imatrix,srmatrix,imatrix>(A,B);
01364 }
01365 
01366 inline imatrix operator|(const rmatrix& A, const simatrix& B) {
01367   return fsp_mm_hull<rmatrix,simatrix,imatrix>(A,B);
01368 }
01369 
01370 inline imatrix operator|(const imatrix& A, const simatrix& B) {
01371   return fsp_mm_hull<imatrix,simatrix,imatrix>(A,B);
01372 }
01373 
01374 inline imatrix operator|(const simatrix& A, const rmatrix& B) {
01375   return spf_mm_hull<simatrix,rmatrix,imatrix>(A,B);
01376 }
01377 
01378 inline imatrix operator|(const srmatrix& A, const imatrix& B) {
01379   return spf_mm_hull<srmatrix,imatrix,imatrix>(A,B);
01380 }
01381 
01382 inline imatrix operator|(const simatrix& A, const imatrix& B) {
01383   return spf_mm_hull<simatrix,imatrix,imatrix>(A,B);
01384 }
01385 
01386 inline imatrix operator|(const imatrix_slice& A, const srmatrix& B) {
01387   return fsp_mm_hull<imatrix_slice,srmatrix,imatrix>(A,B);
01388 }
01389 
01390 inline imatrix operator|(const rmatrix_slice& A, const simatrix& B) {
01391   return fsp_mm_hull<rmatrix_slice,simatrix,imatrix>(A,B);
01392 }
01393 
01394 inline imatrix operator|(const imatrix_slice& A, const simatrix& B) {
01395   return fsp_mm_hull<imatrix_slice,simatrix,imatrix>(A,B);
01396 }
01397 
01398 inline imatrix operator|(const simatrix& A, const rmatrix_slice& B) {
01399   return spf_mm_hull<simatrix,rmatrix_slice,imatrix>(A,B);
01400 }
01401 
01402 inline imatrix operator|(const srmatrix& A, const imatrix_slice& B) {
01403   return spf_mm_hull<srmatrix,imatrix_slice,imatrix>(A,B);
01404 }
01405 
01406 inline imatrix operator|(const simatrix& A, const imatrix_slice& B) {
01407   return spf_mm_hull<simatrix,imatrix_slice,imatrix>(A,B);
01408 }
01409 
01410 inline simatrix operator|(const simatrix& A, const srmatrix& B) {
01411   return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(A,B);
01412 }
01413 
01414 inline simatrix operator|(const srmatrix& A, const simatrix& B) {
01415   return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(A,B);
01416 }
01417 
01418 inline simatrix operator|(const simatrix& A, const simatrix& B) {
01419   return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(A,B);
01420 }
01421 
01422 inline imatrix operator|(const rmatrix& A, const srmatrix& B) {
01423   return fsp_mm_hull<rmatrix,srmatrix,imatrix>(A,B);
01424 }
01425 
01426 inline imatrix operator|(const srmatrix& A, const rmatrix& B) {
01427   return spf_mm_hull<srmatrix,rmatrix,imatrix>(A,B);
01428 }
01429 
01430 inline imatrix operator|(const rmatrix_slice& A, const srmatrix& B) {
01431   return fsp_mm_hull<rmatrix_slice,srmatrix,imatrix>(A,B);
01432 }
01433 
01434 inline imatrix operator|(const srmatrix& A, const rmatrix_slice& B) {
01435   return spf_mm_hull<srmatrix,rmatrix_slice,imatrix>(A,B);
01436 }
01437 
01438 inline simatrix operator|(const srmatrix& A, const srmatrix& B) {
01439   return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(A,B);
01440 }
01441 
01442 inline imatrix operator&(const imatrix& A, const simatrix& B) {
01443   return fsp_mm_intersect<imatrix,simatrix,imatrix>(A,B);
01444 }
01445 
01446 inline imatrix operator&(const simatrix& A, const imatrix& B) {
01447   return spf_mm_intersect<simatrix,imatrix,imatrix>(A,B);
01448 }
01449 
01450 inline imatrix operator&(const imatrix_slice& A, const simatrix& B) {
01451   return fsp_mm_intersect<imatrix_slice,simatrix,imatrix>(A,B);
01452 }
01453 
01454 inline imatrix operator&(const simatrix& A, const imatrix_slice& B) {
01455   return spf_mm_intersect<simatrix,imatrix_slice,imatrix>(A,B);
01456 }
01457 
01458 inline simatrix operator&(const simatrix& A, const simatrix& B) {
01459   return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(A,B);
01460 }
01461 
01462 inline simatrix operator-(const simatrix& M) {
01463   return sp_m_negative<simatrix,simatrix>(M);
01464 }
01465 
01466 inline simatrix& operator+(simatrix& A) {
01467   return A;
01468 }
01469 
01470 inline imatrix& imatrix::operator=(const srmatrix& B) {
01471   *this = rmatrix(B);
01472   return *this;
01473 }
01474 
01475 inline imatrix& imatrix::operator=(const simatrix& B) {
01476   *this = imatrix(B);
01477   return *this;
01478 }
01479 
01480 inline imatrix& imatrix::operator+=(const srmatrix& B) {
01481   return fsp_mm_addassign(*this,B);
01482 }
01483 
01484 inline imatrix& imatrix::operator+=(const simatrix& B) {
01485   return fsp_mm_addassign(*this,B);
01486 }
01487 
01488 inline imatrix_slice& imatrix_slice::operator+=(const srmatrix& B) {
01489   return fsp_mm_addassign(*this,B);
01490 }
01491 
01492 inline imatrix_slice& imatrix_slice::operator+=(const simatrix& B) {
01493   return fsp_mm_addassign(*this,B);
01494 }
01495 
01496 inline imatrix& imatrix::operator-=(const srmatrix& B) {
01497   return fsp_mm_subassign(*this,B);
01498 }
01499 
01500 inline imatrix& imatrix::operator-=(const simatrix& B) {
01501   return fsp_mm_subassign(*this,B);
01502 }
01503 
01504 inline imatrix_slice& imatrix_slice::operator-=(const srmatrix& B) {
01505   return fsp_mm_subassign(*this,B);
01506 }
01507 
01508 inline imatrix_slice& imatrix_slice::operator-=(const simatrix& B) {
01509   return fsp_mm_subassign(*this,B);
01510 }
01511 
01512 inline imatrix& imatrix::operator*=(const srmatrix& B) {
01513   return fsp_mm_multassign<imatrix,srmatrix,sparse_idot,imatrix>(*this,B);
01514 }
01515 
01516 inline imatrix& imatrix::operator*=(const simatrix& B) {
01517   return fsp_mm_multassign<imatrix,simatrix,sparse_idot,imatrix>(*this,B);
01518 }
01519 
01520 inline imatrix_slice& imatrix_slice::operator*=(const srmatrix& B) {
01521   return fsp_mm_multassign<imatrix_slice,srmatrix,sparse_idot,imatrix>(*this,B);
01522 }
01523 
01524 inline imatrix_slice& imatrix_slice::operator*=(const simatrix& B) {
01525   return fsp_mm_multassign<imatrix_slice,simatrix,sparse_idot,imatrix>(*this,B);
01526 }
01527 
01528 inline imatrix& imatrix::operator|=(const srmatrix& B) {
01529   return fsp_mm_hullassign(*this,B);
01530 }
01531 
01532 inline imatrix& imatrix::operator|=(const simatrix& B) {
01533   return fsp_mm_hullassign(*this,B);
01534 }
01535 
01536 inline imatrix_slice& imatrix_slice::operator|=(const srmatrix& B) {
01537   return fsp_mm_hullassign(*this,B);
01538 }
01539 
01540 inline imatrix_slice& imatrix_slice::operator|=(const simatrix& B) {
01541   return fsp_mm_hullassign(*this,B);
01542 }
01543 
01544 inline imatrix& imatrix::operator&=(const srmatrix& B) {
01545   return fsp_mm_intersectassign(*this,B);
01546 }
01547 
01548 inline imatrix& imatrix::operator&=(const simatrix& B) {
01549   return fsp_mm_intersectassign(*this,B);
01550 }
01551 
01552 inline imatrix_slice& imatrix_slice::operator&=(const srmatrix& B) {
01553   return fsp_mm_intersectassign(*this,B);
01554 }
01555 
01556 inline imatrix_slice& imatrix_slice::operator&=(const simatrix& B) {
01557   return fsp_mm_intersectassign(*this,B);
01558 }
01559 
01560 inline bool operator==(const simatrix& A, const srmatrix& B) {
01561   return spsp_mm_comp(A,B);
01562 }
01563 
01564 inline bool operator==(const srmatrix& A, const simatrix& B) {
01565   return spsp_mm_comp(A,B);
01566 }
01567 
01568 inline bool operator==(const simatrix& A, const simatrix& B) {
01569   return spsp_mm_comp(A,B);
01570 }
01571 
01572 inline bool operator==(const simatrix& A, const rmatrix& B) {
01573   return spf_mm_comp(A,B);
01574 }
01575 
01576 inline bool operator==(const srmatrix& A, const imatrix& B) {
01577   return spf_mm_comp(A,B);
01578 }
01579 
01580 inline bool operator==(const simatrix& A, const imatrix& B) {
01581   return spf_mm_comp(A,B);
01582 }
01583 
01584 inline bool operator==(const imatrix& A, const srmatrix& B) {
01585   return fsp_mm_comp(A,B);
01586 }
01587 
01588 inline bool operator==(const rmatrix& A, const simatrix& B) {
01589   return fsp_mm_comp(A,B);
01590 }
01591 
01592 inline bool operator==(const imatrix& A, const simatrix& B) {
01593   return fsp_mm_comp(A,B);
01594 }
01595 
01596 inline bool operator==(const imatrix_slice& A, const srmatrix& B) {
01597   return fsp_mm_comp(A,B);
01598 }
01599 
01600 inline bool operator==(const rmatrix_slice& A, const simatrix& B) {
01601   return fsp_mm_comp(A,B);
01602 }
01603 
01604 inline bool operator==(const imatrix_slice& A, const simatrix& B) {
01605   return fsp_mm_comp(A,B);
01606 }
01607 
01608 inline bool operator==(const simatrix& A, const rmatrix_slice& B) {
01609   return spf_mm_comp(A,B);
01610 }
01611 
01612 inline bool operator==(const srmatrix& A, const imatrix_slice& B) {
01613   return spf_mm_comp(A,B);
01614 }
01615 
01616 inline bool operator==(const simatrix& A, const imatrix_slice& B) {
01617   return spf_mm_comp(A,B);
01618 }
01619 
01620 inline bool operator!=(const simatrix& A, const srmatrix& B) {
01621   return !spsp_mm_comp(A,B);
01622 }
01623 
01624 inline bool operator!=(const srmatrix& A, const simatrix& B) {
01625   return !spsp_mm_comp(A,B);
01626 }
01627 
01628 inline bool operator!=(const simatrix& A, const simatrix& B) {
01629   return !spsp_mm_comp(A,B);
01630 }
01631 
01632 inline bool operator!=(const simatrix& A, const rmatrix& B) {
01633   return !spf_mm_comp(A,B);
01634 }
01635 
01636 inline bool operator!=(const srmatrix& A, const imatrix& B) {
01637   return !spf_mm_comp(A,B);
01638 }
01639 
01640 inline bool operator!=(const simatrix& A, const imatrix& B) {
01641   return !spf_mm_comp(A,B);
01642 }
01643 
01644 inline bool operator!=(const imatrix& A, const srmatrix& B) {
01645   return !fsp_mm_comp(A,B);
01646 }
01647 
01648 inline bool operator!=(const rmatrix& A, const simatrix& B) {
01649   return !fsp_mm_comp(A,B);
01650 }
01651 
01652 inline bool operator!=(const imatrix& A, const simatrix& B) {
01653   return !fsp_mm_comp(A,B);
01654 }
01655 
01656 inline bool operator!=(const imatrix_slice& A, const srmatrix& B) {
01657   return !fsp_mm_comp(A,B);
01658 }
01659 
01660 inline bool operator!=(const rmatrix_slice& A, const simatrix& B) {
01661   return !fsp_mm_comp(A,B);
01662 }
01663 
01664 inline bool operator!=(const imatrix_slice& A, const simatrix& B) {
01665   return !fsp_mm_comp(A,B);
01666 }
01667 
01668 inline bool operator!=(const simatrix& A, const rmatrix_slice& B) {
01669   return !spf_mm_comp(A,B);
01670 }
01671 
01672 inline bool operator!=(const srmatrix& A, const imatrix_slice& B) {
01673   return !spf_mm_comp(A,B);
01674 }
01675 
01676 inline bool operator!=(const simatrix& A, const imatrix_slice& B) {
01677   return !spf_mm_comp(A,B);
01678 }
01679 
01680 inline bool operator<(const srmatrix& A, const simatrix& B) {
01681   return spsp_mm_less<srmatrix,simatrix,interval>(A,B);
01682 }
01683 
01684 inline bool operator<(const simatrix& A, const simatrix& B) {
01685   return spsp_mm_less<simatrix,simatrix,interval>(A,B);
01686 }
01687 
01688 inline bool operator<(const srmatrix& A, const imatrix& B) {
01689   return spf_mm_less<srmatrix,imatrix,interval>(A,B);
01690 }
01691 
01692 inline bool operator<(const simatrix& A, const imatrix& B) {
01693   return spf_mm_less<simatrix,imatrix,interval>(A,B);
01694 }
01695 
01696 inline bool operator<(const rmatrix& A, const simatrix& B) {
01697   return fsp_mm_less<rmatrix,simatrix,interval>(A,B);
01698 }
01699 
01700 inline bool operator<(const imatrix& A, const simatrix& B) {
01701   return fsp_mm_less<imatrix,simatrix,interval>(A,B);
01702 }
01703 
01704 inline bool operator<(const rmatrix_slice& A, const simatrix& B) {
01705   return fsp_mm_less<rmatrix_slice,simatrix,interval>(A,B);
01706 }
01707 
01708 inline bool operator<(const imatrix_slice& A, const simatrix& B) {
01709   return fsp_mm_less<imatrix_slice,simatrix,interval>(A,B);
01710 }
01711 
01712 inline bool operator<(const srmatrix& A, const imatrix_slice& B) {
01713   return spf_mm_less<srmatrix,imatrix_slice,interval>(A,B);
01714 }
01715 
01716 inline bool operator<(const simatrix& A, const imatrix_slice& B) {
01717   return spf_mm_less<simatrix,imatrix_slice,interval>(A,B);
01718 }
01719 
01720 inline bool operator<=(const srmatrix& A, const simatrix& B) {
01721   return spsp_mm_leq<srmatrix,simatrix,interval>(A,B);
01722 }
01723 
01724 inline bool operator<=(const simatrix& A, const simatrix& B) {
01725   return spsp_mm_leq<simatrix,simatrix,interval>(A,B);
01726 }
01727 
01728 inline bool operator<=(const srmatrix& A, const imatrix& B) {
01729   return spf_mm_leq<srmatrix,imatrix,interval>(A,B);
01730 }
01731 
01732 inline bool operator<=(const simatrix& A, const imatrix& B) {
01733   return spf_mm_leq<simatrix,imatrix,interval>(A,B);
01734 }
01735 
01736 inline bool operator<=(const rmatrix& A, const simatrix& B) {
01737   return fsp_mm_leq<rmatrix,simatrix,interval>(A,B);
01738 }
01739 
01740 inline bool operator<=(const imatrix& A, const simatrix& B) {
01741   return fsp_mm_leq<imatrix,simatrix,interval>(A,B);
01742 }
01743 
01744 inline bool operator<=(const rmatrix_slice& A, const simatrix& B) {
01745   return fsp_mm_leq<rmatrix_slice,simatrix,interval>(A,B);
01746 }
01747 
01748 inline bool operator<=(const imatrix_slice& A, const simatrix& B) {
01749   return fsp_mm_leq<imatrix_slice,simatrix,interval>(A,B);
01750 }
01751 
01752 inline bool operator<=(const srmatrix& A, const imatrix_slice& B) {
01753   return spf_mm_leq<srmatrix,imatrix_slice,interval>(A,B);
01754 }
01755 
01756 inline bool operator<=(const simatrix& A, const imatrix_slice& B) {
01757   return spf_mm_leq<simatrix,imatrix_slice,interval>(A,B);
01758 }
01759 
01760 inline bool operator>(const simatrix& A, const srmatrix& B) {
01761   return spsp_mm_greater<simatrix,srmatrix,interval>(A,B);
01762 }
01763 
01764 inline bool operator>(const simatrix& A, const simatrix& B) {
01765   return spsp_mm_greater<simatrix,simatrix,interval>(A,B);
01766 }
01767 
01768 inline bool operator>(const simatrix& A, const rmatrix& B) {
01769   return spf_mm_greater<simatrix,rmatrix,interval>(A,B);
01770 }
01771 
01772 inline bool operator>(const simatrix& A, const imatrix& B) {
01773   return spf_mm_greater<simatrix,imatrix,interval>(A,B);
01774 }
01775 
01776 inline bool operator>(const imatrix& A, const srmatrix& B) {
01777   return fsp_mm_greater<imatrix,srmatrix,interval>(A,B);
01778 }
01779 
01780 inline bool operator>(const imatrix& A, const simatrix& B) {
01781   return fsp_mm_greater<imatrix,simatrix,interval>(A,B);
01782 }
01783 
01784 inline bool operator>(const imatrix_slice& A, const srmatrix& B) {
01785   return fsp_mm_greater<imatrix_slice,srmatrix,interval>(A,B);
01786 }
01787 
01788 inline bool operator>(const imatrix_slice& A, const simatrix& B) {
01789   return fsp_mm_greater<imatrix_slice,simatrix,interval>(A,B);
01790 }
01791 
01792 inline bool operator>(const simatrix& A, const rmatrix_slice& B) {
01793   return spf_mm_greater<simatrix,rmatrix_slice,interval>(A,B);
01794 }
01795 
01796 inline bool operator>(const simatrix& A, const imatrix_slice& B) {
01797   return spf_mm_greater<simatrix,imatrix_slice,interval>(A,B);
01798 }
01799 
01800 inline bool operator>=(const simatrix& A, const srmatrix& B) {
01801   return spsp_mm_geq<simatrix,srmatrix,interval>(A,B);
01802 }
01803 
01804 inline bool operator>=(const simatrix& A, const simatrix& B) {
01805   return spsp_mm_geq<simatrix,simatrix,interval>(A,B);
01806 }
01807 
01808 inline bool operator>=(const simatrix& A, const rmatrix& B) {
01809   return spf_mm_geq<simatrix,rmatrix,interval>(A,B);
01810 }
01811 
01812 inline bool operator>=(const simatrix& A, const imatrix& B) {
01813   return spf_mm_geq<simatrix,imatrix,interval>(A,B);
01814 }
01815 
01816 inline bool operator>=(const imatrix& A, const srmatrix& B) {
01817   return fsp_mm_geq<imatrix,srmatrix,interval>(A,B);
01818 }
01819 
01820 inline bool operator>=(const imatrix& A, const simatrix& B) {
01821   return fsp_mm_geq<imatrix,simatrix,interval>(A,B);
01822 }
01823 
01824 inline bool operator>=(const imatrix_slice& A, const srmatrix& B) {
01825   return fsp_mm_geq<imatrix_slice,srmatrix,interval>(A,B);
01826 }
01827 
01828 inline bool operator>=(const imatrix_slice& A, const simatrix& B) {
01829   return fsp_mm_geq<imatrix_slice,simatrix,interval>(A,B);
01830 }
01831 
01832 inline bool operator>=(const simatrix& A, const rmatrix_slice& B) {
01833   return spf_mm_geq<simatrix,rmatrix_slice,interval>(A,B);
01834 }
01835 
01836 inline bool operator>=(const simatrix& A, const imatrix_slice& B) {
01837   return spf_mm_geq<simatrix,imatrix_slice,interval>(A,B);
01838 }
01839 
01840 inline bool operator!(const simatrix& A) {
01841   return sp_m_not(A);
01842 }
01843 
01844 inline std::ostream& operator<<(std::ostream& os, const simatrix& A) {
01845   return sp_m_output<simatrix,interval>(os,A);
01846 }
01847 
01848 inline std::istream& operator>>(std::istream& is, simatrix& A) {
01849   return sp_m_input<simatrix,interval>(is,A);
01850 }
01851 
01852 class simatrix_slice {
01853   public:
01854     simatrix  A;
01855     simatrix* M; //Originalmatrix
01856 
01857   private:
01858     simatrix_slice(simatrix& Mat, int sl1l, int sl1u, int sl2l, int sl2u) {    
01859         A.lb1 = sl1l;
01860         A.lb2 = sl2l;
01861         A.ub1 = sl1u;
01862         A.ub2 = sl2u;
01863         A.m   = sl1u-sl1l+1;
01864         A.n   = sl2u-sl2l+1;
01865  
01866         //Kopieren der Werte aus A
01867         A.p = std::vector<int>(A.n+1, 0);
01868         A.ind.reserve(A.m + A.n);
01869         A.x.reserve(A.m + A.n);
01870 
01871         for(int i=0 ; i<A.n ; i++) {
01872            A.p[i+1] = A.p[i];
01873            for(int j=Mat.p[sl2l-Mat.lb2+i] ; j<Mat.p[sl2l-Mat.lb2+i+1] ; j++) {
01874               if(Mat.ind[j] >= sl1l-Mat.lb1  &&  Mat.ind[j] <= sl1u-Mat.lb1) {
01875                 A.ind.push_back(Mat.ind[j]-(sl1l-Mat.lb1));
01876                 A.x.push_back(Mat.x[j]);
01877                 A.p[i+1]++;
01878               }
01879            }
01880         }
01881 
01882         //Zeiger auf A fuer Datenmanipulationen
01883         M = &Mat;
01884     }
01885 
01886     simatrix_slice(const simatrix& Mat, int sl1l, int sl1u, int sl2l, int sl2u) {    
01887         A.lb1 = sl1l;
01888         A.lb2 = sl2l;
01889         A.ub1 = sl1u;
01890         A.ub2 = sl2u;
01891         A.m   = sl1u-sl1l+1;
01892         A.n   = sl2u-sl2l+1;
01893  
01894         //Kopieren der Werte aus A
01895         A.p = std::vector<int>(A.n+1, 0);
01896         A.ind.reserve(A.m + A.n);
01897         A.x.reserve(A.m + A.n);
01898 
01899         for(int i=0 ; i<A.n ; i++) {
01900            A.p[i+1] = A.p[i];
01901            for(int j=Mat.p[sl2l-Mat.lb2+i] ; j<Mat.p[sl2l-Mat.lb2+i+1] ; j++) {
01902               if(Mat.ind[j] >= sl1l-Mat.lb1  &&  Mat.ind[j] <= sl1u-Mat.lb1) {
01903                 A.ind.push_back(Mat.ind[j]-(sl1l-Mat.lb1));
01904                 A.x.push_back(Mat.x[j]);
01905                 A.p[i+1]++;
01906               }
01907            }
01908         }
01909 
01910         //Zeiger auf A fuer Datenmanipulationen
01911         M = const_cast<simatrix*>(&Mat); //Vorgehen noetig um Schreibweise A[i][j] bei auslesen von const A zu ermoeglichen
01912     }
01913 
01914 
01915   public:
01916     simatrix_slice& operator=(const real& C) {
01917       return sl_ms_assign<simatrix_slice, real, std::vector<interval>::iterator, interval>(*this,C);
01918     }
01919 
01920     simatrix_slice& operator=(const interval& C) {
01921       return sl_ms_assign<simatrix_slice, interval, std::vector<interval>::iterator, interval>(*this,C);
01922     }
01923 
01924     simatrix_slice& operator=(const srmatrix& C) {
01925       return slsp_mm_assign<simatrix_slice, srmatrix, std::vector<interval>::iterator>(*this,C);
01926     }
01927 
01928     simatrix_slice& operator=(const simatrix& C) {
01929       return slsp_mm_assign<simatrix_slice, simatrix, std::vector<interval>::iterator>(*this,C);
01930     }
01931 
01932     simatrix_slice& operator=(const rmatrix& C) {
01933       return slf_mm_assign<simatrix_slice, rmatrix, std::vector<interval>::iterator, interval>(*this,C);
01934     }
01935 
01936     simatrix_slice& operator=(const imatrix& C) {
01937       return slf_mm_assign<simatrix_slice, imatrix, std::vector<interval>::iterator, interval>(*this,C);
01938     }
01939 
01940     simatrix_slice& operator=(const rmatrix_slice& C) {
01941       return slf_mm_assign<simatrix_slice, rmatrix_slice, std::vector<interval>::iterator, interval>(*this,C);
01942     }
01943 
01944     simatrix_slice& operator=(const imatrix_slice& C) {
01945       return slf_mm_assign<simatrix_slice, imatrix_slice, std::vector<interval>::iterator, interval>(*this,C);
01946     }
01947 
01948     simatrix_slice& operator=(const srmatrix_slice& C) {
01949       *this = C.A;
01950       return *this;
01951     }
01952 
01953     simatrix_slice& operator=(const simatrix_slice& C) {
01954       *this = C.A;
01955       return *this;
01956     }
01957 
01958     simatrix_slice& operator*=(const srmatrix_slice& M) {
01959       *this = A*M.A;
01960       return *this;
01961     }
01962 
01963     simatrix_slice& operator*=(const simatrix_slice& M) {
01964       *this = A*M.A;
01965       return *this;
01966     }
01967 
01968     simatrix_slice& operator*=(const srmatrix& M) {
01969       *this = A*M;
01970       return *this;
01971     }
01972 
01973     simatrix_slice& operator*=(const simatrix& M) {
01974       *this = A*M;
01975       return *this;
01976     }
01977 
01978     simatrix_slice& operator*=(const rmatrix& M) {
01979       *this = A*M;
01980       return *this;
01981     }
01982 
01983     simatrix_slice& operator*=(const imatrix& M) {
01984       *this = A*M;
01985       return *this;
01986     }
01987 
01988     simatrix_slice& operator*=(const rmatrix_slice& M) {
01989       *this = A*M;
01990       return *this;
01991     }
01992 
01993     simatrix_slice& operator*=(const imatrix_slice& M) {
01994       *this = A*M;
01995       return *this;
01996     }
01997 
01998     simatrix_slice& operator*=(const real& r) {
01999       *this = A*r;
02000       return *this;
02001     }
02002 
02003     simatrix_slice& operator*=(const interval& r) {
02004       *this = A*r;
02005       return *this;
02006     }
02007 
02008     simatrix_slice& operator/=(const real& r) {
02009       *this = A/r;
02010       return *this;
02011     }
02012 
02013     simatrix_slice& operator/=(const interval& r) {
02014       *this = A/r;
02015       return *this;
02016     }
02017 
02018     simatrix_slice& operator+=(const srmatrix_slice& M) {
02019       *this = A+M.A;
02020       return *this;
02021     } 
02022 
02023     simatrix_slice& operator+=(const simatrix_slice& M) {
02024       *this = A+M.A;
02025       return *this;
02026     } 
02027 
02028     simatrix_slice& operator+=(const srmatrix& M) {
02029       *this = A+M;
02030       return *this;
02031     } 
02032 
02033     simatrix_slice& operator+=(const simatrix& M) {
02034       *this = A+M;
02035       return *this;
02036     } 
02037 
02038     simatrix_slice& operator+=(const rmatrix& M) {
02039       *this = A+M;
02040       return *this;
02041     } 
02042 
02043     simatrix_slice& operator+=(const imatrix& M) {
02044       *this = A+M;
02045       return *this;
02046     } 
02047 
02048     simatrix_slice& operator+=(const rmatrix_slice& M) {
02049       *this = A+M;
02050       return *this;
02051     } 
02052 
02053     simatrix_slice& operator+=(const imatrix_slice& M) {
02054       *this = A+M;
02055       return *this;
02056     } 
02057 
02058     simatrix_slice& operator-=(const srmatrix_slice& M) {
02059       *this = A-M.A;
02060       return *this;
02061     } 
02062 
02063     simatrix_slice& operator-=(const simatrix_slice& M) {
02064       *this = A-M.A;
02065       return *this;
02066     } 
02067 
02068     simatrix_slice& operator-=(const srmatrix& M) {
02069       *this = A-M;
02070       return *this;
02071     } 
02072 
02073     simatrix_slice& operator-=(const simatrix& M) {
02074       *this = A-M;
02075       return *this;
02076     } 
02077 
02078     simatrix_slice& operator-=(const rmatrix& M) {
02079       *this = A-M;
02080       return *this;
02081     } 
02082 
02083     simatrix_slice& operator-=(const imatrix& M) {
02084       *this = A-M;
02085       return *this;
02086     } 
02087 
02088     simatrix_slice& operator-=(const rmatrix_slice& M) {
02089       *this = A-M;
02090       return *this;
02091     }
02092 
02093     simatrix_slice& operator-=(const imatrix_slice& M) {
02094       *this = A-M;
02095       return *this;
02096     }
02097 
02098     simatrix_slice& operator|=(const srmatrix_slice& M) {
02099       *this = A|M.A;
02100       return *this;
02101     } 
02102 
02103     simatrix_slice& operator|=(const simatrix_slice& M) {
02104       *this = A|M.A;
02105       return *this;
02106     } 
02107 
02108     simatrix_slice& operator|=(const srmatrix& M) {
02109       *this = A|M;
02110       return *this;
02111     } 
02112 
02113     simatrix_slice& operator|=(const simatrix& M) {
02114       *this = A|M;
02115       return *this;
02116     } 
02117 
02118     simatrix_slice& operator|=(const rmatrix& M) {
02119       *this = A|M;
02120       return *this;
02121     } 
02122 
02123     simatrix_slice& operator|=(const imatrix& M) {
02124       *this = A|M;
02125       return *this;
02126     } 
02127 
02128     simatrix_slice& operator|=(const rmatrix_slice& M) {
02129       *this = A|M;
02130       return *this;
02131     } 
02132 
02133     simatrix_slice& operator|=(const imatrix_slice& M) {
02134       *this = A|M;
02135       return *this;
02136     } 
02137 
02138     const interval operator()(const int i, const int j) const {
02139 #if(CXSC_INDEX_CHECK)
02140       if(i<A.lb1 || i>A.ub1 || j<A.lb2 || j>A.ub2)
02141         cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_slice::operator()(int, int)"));
02142 #endif
02143       interval r = A(i,j);
02144       return r;
02145     }
02146 
02147     interval& element(const int i, const int j) {
02148 #if(CXSC_INDEX_CHECK)
02149       if(i<A.lb1 || i>A.ub1 || j<A.lb2 || j>A.ub2)
02150         cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_slice::element(int, int)"));
02151 #endif
02152       return M->element(i,j);
02153     }
02154 
02155     simatrix_subv operator[](const int);
02156     simatrix_subv operator[](const cxscmatrix_column&);
02157     const simatrix_subv operator[](const int) const;
02158     const simatrix_subv operator[](const cxscmatrix_column&) const;
02159 
02160     friend std::ostream& operator<<(std::ostream&, const simatrix_slice&);
02161 
02162     friend int Lb(const simatrix_slice&, const int);
02163     friend int Ub(const simatrix_slice&, const int);
02164     friend srmatrix Inf(const simatrix_slice&);
02165     friend srmatrix Sup(const simatrix_slice&);
02166     friend simatrix abs(const simatrix_slice&);
02167     friend srmatrix mid(const simatrix_slice&);
02168     friend srmatrix diam(const simatrix_slice&);
02169     friend int RowLen(const simatrix_slice&);
02170     friend int ColLen(const simatrix_slice&);
02171 
02172     friend class srmatrix;
02173     friend class srmatrix_subv;
02174     friend class srvector;
02175     friend class simatrix;
02176     friend class simatrix_subv;
02177     friend class sivector;
02178     friend class scimatrix;
02179     friend class scimatrix_subv;
02180     friend class scimatrix_slice;
02181     friend class scivector;
02182     friend class imatrix;
02183     friend class cimatrix;
02184 
02185 
02186 #include "matrix_friend_declarations.inl"    
02187 };
02188 
02189 inline imatrix::imatrix(const srmatrix_slice& A) {
02190   dat = new interval[A.A.m*A.A.n];
02191   lb1 = A.A.lb1; lb2 = A.A.lb2; ub1 = A.A.ub1; ub2 = A.A.ub2;
02192   xsize = A.A.n;
02193   ysize = A.A.m;
02194   *this = 0.0;
02195   for(int j=0 ; j<A.A.n ; j++) {
02196      for(int k=A.A.p[j] ; k<A.A.p[j+1] ; k++) {
02197         dat[A.A.ind[k]*A.A.n+j] = A.A.x[k];
02198      }
02199   }
02200 }
02201 
02202 inline imatrix::imatrix(const simatrix_slice& A) {
02203   dat = new interval[A.A.m*A.A.n];
02204   lb1 = A.A.lb1; lb2 = A.A.lb2; ub1 = A.A.ub1; ub2 = A.A.ub2;
02205   xsize = A.A.n;
02206   ysize = A.A.m;
02207   *this = 0.0;
02208   for(int j=0 ; j<A.A.n ; j++) {
02209      for(int k=A.A.p[j] ; k<A.A.p[j+1] ; k++) {
02210         dat[A.A.ind[k]*A.A.n+j] = A.A.x[k];
02211      }
02212   }
02213 }
02214 
02215 inline int RowLen(const simatrix_slice& S) {
02216   return RowLen(S.A);
02217 }
02218 
02219 inline int ColLen(const simatrix_slice& S) {
02220   return ColLen(S.A);
02221 }
02222 
02223 inline simatrix_slice simatrix::operator()(const int i, const int j, const int k, const int l) {
02224 #if(CXSC_INDEX_CHECK)
02225   if(i<lb1 || j>ub1 || k<lb2 || l>ub2)
02226     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator()(int, int)"));
02227 #endif
02228   return simatrix_slice(*this, i, j, k, l);
02229 }
02230 
02231 inline int Lb(const simatrix_slice& S, const int i) {
02232   return Lb(S.A, i);
02233 }
02234 
02235 inline int Ub(const simatrix_slice& S, const int i) {
02236   return Ub(S.A, i);
02237 }
02238 
02239 inline srmatrix Inf(const simatrix_slice& S) {
02240   return Inf(S.A);
02241 }
02242 
02243 inline srmatrix Sup(const simatrix_slice& S) {
02244   return Sup(S.A);
02245 }
02246 
02247 inline simatrix abs(const simatrix_slice& S) {
02248   return abs(S.A);
02249 }
02250 
02251 inline srmatrix mid(const simatrix_slice& S) {
02252   return mid(S.A);
02253 }
02254 
02255 inline srmatrix diam(const simatrix_slice& S) {
02256   return diam(S.A);
02257 }
02258 
02259 inline simatrix::simatrix(const srmatrix_slice& S) {
02260   m = S.A.m;
02261   n = S.A.n;
02262   lb1 = S.A.lb1;
02263   ub1 = S.A.ub1;
02264   lb2 = S.A.lb2;
02265   ub2 = S.A.ub2;
02266   *this = S.A;
02267 }
02268 
02269 inline simatrix::simatrix(const simatrix_slice& S) {
02270   m = S.A.m;
02271   n = S.A.n;
02272   lb1 = S.A.lb1;
02273   ub1 = S.A.ub1;
02274   lb2 = S.A.lb2;
02275   ub2 = S.A.ub2;
02276   *this = S.A;
02277 }
02278 
02279 inline simatrix& simatrix::operator=(const srmatrix_slice& S) {
02280   *this = S.A;
02281   return *this;
02282 }
02283 
02284 inline simatrix& simatrix::operator=(const simatrix_slice& S) {
02285   *this = S.A;
02286   return *this;
02287 }
02288 
02289 inline imatrix& imatrix::operator=(const srmatrix_slice& M) {
02290   *this = rmatrix(M);
02291   return *this;
02292 }
02293 
02294 inline imatrix& imatrix::operator=(const simatrix_slice& M) {
02295   *this = imatrix(M);
02296   return *this;
02297 }
02298 
02299 inline imatrix& imatrix::operator+=(const srmatrix_slice& M) {
02300   *this += M.A;
02301   return *this;
02302 }
02303 
02304 inline imatrix& imatrix::operator+=(const simatrix_slice& M) {
02305   *this += M.A;
02306   return *this;
02307 }
02308 
02309 inline imatrix_slice& imatrix_slice::operator+=(const srmatrix_slice& M) {
02310   *this += M.A;
02311   return *this;
02312 }
02313 
02314 inline imatrix_slice& imatrix_slice::operator+=(const simatrix_slice& M) {
02315   *this += M.A;
02316   return *this;
02317 }
02318 
02319 inline imatrix& imatrix::operator-=(const srmatrix_slice& M) {
02320   *this -= M.A;
02321   return *this;
02322 }
02323 
02324 inline imatrix& imatrix::operator-=(const simatrix_slice& M) {
02325   *this -= M.A;
02326   return *this;
02327 }
02328 
02329 inline imatrix_slice& imatrix_slice::operator-=(const srmatrix_slice& M) {
02330   *this -= M.A;
02331   return *this;
02332 }
02333 
02334 inline imatrix_slice& imatrix_slice::operator-=(const simatrix_slice& M) {
02335   *this -= M.A;
02336   return *this;
02337 }
02338 
02339 inline imatrix& imatrix::operator*=(const srmatrix_slice& M) {
02340   *this *= M.A;
02341   return *this;
02342 }
02343 
02344 inline imatrix& imatrix::operator*=(const simatrix_slice& M) {
02345   *this *= M.A;
02346   return *this;
02347 }
02348 
02349 inline imatrix_slice& imatrix_slice::operator*=(const srmatrix_slice& M) {
02350   *this *= M.A;
02351   return *this;
02352 }
02353 
02354 inline imatrix_slice& imatrix_slice::operator*=(const simatrix_slice& M) {
02355   *this *= M.A;
02356   return *this;
02357 }
02358 
02359 inline imatrix& imatrix::operator|=(const srmatrix_slice& M) {
02360   *this |= M.A;
02361   return *this;
02362 }
02363 
02364 inline imatrix& imatrix::operator|=(const simatrix_slice& M) {
02365   *this |= M.A;
02366   return *this;
02367 }
02368 
02369 inline imatrix_slice& imatrix_slice::operator|=(const srmatrix_slice& M) {
02370   *this |= M.A;
02371   return *this;
02372 }
02373 
02374 inline imatrix_slice& imatrix_slice::operator|=(const simatrix_slice& M) {
02375   *this |= M.A;
02376   return *this;
02377 }
02378 
02379 inline imatrix& imatrix::operator&=(const srmatrix_slice& M) {
02380   *this &= M.A;
02381   return *this;
02382 }
02383 
02384 inline imatrix& imatrix::operator&=(const simatrix_slice& M) {
02385   *this &= M.A;
02386   return *this;
02387 }
02388 
02389 inline imatrix_slice& imatrix_slice::operator&=(const srmatrix_slice& M) {
02390   *this &= M.A;
02391   return *this;
02392 }
02393 
02394 inline imatrix_slice& imatrix_slice::operator&=(const simatrix_slice& M) {
02395   *this &= M.A;
02396   return *this;
02397 }
02398 
02399 inline simatrix operator-(const simatrix_slice& M) {
02400   return sp_m_negative<simatrix,simatrix>(M.A);
02401 }
02402 
02403 inline simatrix operator+(const simatrix_slice& M) {
02404   return M.A;
02405 }
02406 
02407 inline simatrix operator*(const simatrix_slice& M1, const srmatrix_slice& M2) {
02408   return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1.A,M2.A);
02409 }
02410 
02411 inline simatrix operator*(const srmatrix_slice& M1, const simatrix_slice& M2) {
02412   return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2.A);
02413 }
02414 
02415 inline simatrix operator*(const simatrix_slice& M1, const simatrix_slice& M2) {
02416   return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2.A);
02417 }
02418 
02419 inline simatrix operator*(const simatrix_slice& M1, const srmatrix& M2) {
02420   return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1.A,M2);
02421 }
02422 
02423 inline simatrix operator*(const srmatrix_slice& M1, const simatrix& M2) {
02424   return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2);
02425 }
02426 
02427 inline simatrix operator*(const simatrix_slice& M1, const simatrix& M2) {
02428   return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1.A,M2);
02429 }
02430 
02431 inline simatrix operator*(const simatrix& M1, const srmatrix_slice& M2) {
02432   return spsp_mm_mult<simatrix,srmatrix,simatrix,sparse_idot,interval>(M1,M2.A);
02433 }
02434 
02435 inline simatrix operator*(const srmatrix& M1, const simatrix_slice& M2) {
02436   return spsp_mm_mult<srmatrix,simatrix,simatrix,sparse_idot,interval>(M1,M2.A);
02437 }
02438 
02439 inline simatrix operator*(const simatrix& M1, const simatrix_slice& M2) {
02440   return spsp_mm_mult<simatrix,simatrix,simatrix,sparse_idot,interval>(M1,M2.A);
02441 }
02442 
02443 inline imatrix operator*(const simatrix_slice& M1, const rmatrix& M2) {
02444   return spf_mm_mult<simatrix,rmatrix,imatrix,sparse_idot>(M1.A,M2);
02445 }
02446 
02447 inline imatrix operator*(const srmatrix_slice& M1, const imatrix& M2) {
02448   return spf_mm_mult<srmatrix,imatrix,imatrix,sparse_idot>(M1.A,M2);
02449 }
02450 
02451 inline imatrix operator*(const simatrix_slice& M1, const imatrix& M2) {
02452   return spf_mm_mult<simatrix,imatrix,imatrix,sparse_idot>(M1.A,M2);
02453 }
02454 
02455 inline imatrix operator*(const imatrix& M1, const srmatrix_slice& M2) {
02456   return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(M1,M2.A);
02457 }
02458 
02459 inline imatrix operator*(const rmatrix& M1, const simatrix_slice& M2) {
02460   return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
02461 }
02462 
02463 inline imatrix operator*(const imatrix& M1, const simatrix_slice& M2) {
02464   return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
02465 }
02466 
02467 inline imatrix operator*(const simatrix_slice& M1, const rmatrix_slice& M2) {
02468   return spf_mm_mult<simatrix,rmatrix_slice,imatrix,sparse_idot>(M1.A,M2);
02469 }
02470 
02471 inline imatrix operator*(const srmatrix_slice& M1, const imatrix_slice& M2) {
02472   return spf_mm_mult<srmatrix,imatrix_slice,imatrix,sparse_idot>(M1.A,M2);
02473 }
02474 
02475 inline imatrix operator*(const simatrix_slice& M1, const imatrix_slice& M2) {
02476   return spf_mm_mult<simatrix,imatrix_slice,imatrix,sparse_idot>(M1.A,M2);
02477 }
02478 
02479 inline imatrix operator*(const imatrix_slice& M1, const srmatrix_slice& M2) {
02480   return fsp_mm_mult<imatrix,srmatrix,imatrix,sparse_idot>(M1,M2.A);
02481 }
02482 
02483 inline imatrix operator*(const rmatrix_slice& M1, const simatrix_slice& M2) {
02484   return fsp_mm_mult<rmatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
02485 }
02486 
02487 inline imatrix operator*(const imatrix_slice& M1, const simatrix_slice& M2) {
02488   return fsp_mm_mult<imatrix,simatrix,imatrix,sparse_idot>(M1,M2.A);
02489 }
02490 
02491 inline sivector operator*(const simatrix_slice& M, const srvector& v) {
02492   return spsp_mv_mult<simatrix,srvector,sivector,sparse_idot,interval>(M.A,v);
02493 }
02494 
02495 inline sivector operator*(const srmatrix_slice& M, const sivector& v) {
02496   return spsp_mv_mult<srmatrix,sivector,sivector,sparse_idot,interval>(M.A,v);
02497 }
02498 
02499 inline sivector operator*(const simatrix_slice& M, const sivector& v) {
02500   return spsp_mv_mult<simatrix,sivector,sivector,sparse_idot,interval>(M.A,v);
02501 }
02502 
02503 inline sivector operator*(const simatrix_slice& M, const srvector_slice& v) {
02504   return spsl_mv_mult<simatrix,srvector_slice,sivector,sparse_idot,interval>(M.A,v);
02505 }
02506 
02507 inline sivector operator*(const srmatrix_slice& M, const sivector_slice& v) {
02508   return spsl_mv_mult<srmatrix,sivector_slice,sivector,sparse_idot,interval>(M.A,v);
02509 }
02510 
02511 inline sivector operator*(const simatrix_slice& M, const sivector_slice& v) {
02512   return spsl_mv_mult<simatrix,sivector_slice,sivector,sparse_idot,interval>(M.A,v);
02513 }
02514 
02515 inline ivector operator*(const simatrix_slice& M, const rvector& v) {
02516   return spf_mv_mult<simatrix,rvector,ivector,sparse_idot>(M.A,v);
02517 }
02518 
02519 inline ivector operator*(const srmatrix_slice& M, const ivector& v) {
02520   return spf_mv_mult<srmatrix,ivector,ivector,sparse_idot>(M.A,v);
02521 }
02522 
02523 inline ivector operator*(const simatrix_slice& M, const ivector& v) {
02524   return spf_mv_mult<simatrix,ivector,ivector,sparse_idot>(M.A,v);
02525 }
02526 
02527 inline ivector operator*(const simatrix_slice& M, const rvector_slice& v) {
02528   return spf_mv_mult<simatrix,rvector_slice,ivector,sparse_idot>(M.A,v);
02529 }
02530 
02531 inline ivector operator*(const srmatrix_slice& M, const ivector_slice& v) {
02532   return spf_mv_mult<srmatrix,ivector_slice,ivector,sparse_idot>(M.A,v);
02533 }
02534 
02535 inline ivector operator*(const simatrix_slice& M, const ivector_slice& v) {
02536   return spf_mv_mult<simatrix,ivector_slice,ivector,sparse_idot>(M.A,v);
02537 }
02538 
02539 inline simatrix operator/(const simatrix_slice& M, const real& r) {
02540   return sp_ms_div<simatrix,real,simatrix>(M.A,r);
02541 }
02542 
02543 inline simatrix operator/(const simatrix_slice& M, const interval& r) {
02544   return sp_ms_div<simatrix,interval,simatrix>(M.A,r);
02545 }
02546 
02547 inline simatrix operator/(const srmatrix_slice& M, const interval& r) {
02548   return sp_ms_div<srmatrix,interval,simatrix>(M.A,r);
02549 }
02550 
02551 inline simatrix operator*(const simatrix_slice& M, const real& r) {
02552   return sp_ms_mult<simatrix,real,simatrix>(M.A,r);
02553 }
02554 
02555 inline simatrix operator*(const simatrix_slice& M, const interval& r) {
02556   return sp_ms_mult<simatrix,interval,simatrix>(M.A,r);
02557 }
02558 
02559 inline simatrix operator*(const srmatrix_slice& M, const interval& r) {
02560   return sp_ms_mult<srmatrix,interval,simatrix>(M.A,r);
02561 }
02562 
02563 inline simatrix operator*(const real& r, const simatrix_slice& M) {
02564   return sp_sm_mult<real,simatrix,simatrix>(r,M.A);
02565 }
02566 
02567 inline simatrix operator*(const interval& r, const srmatrix_slice& M) {
02568   return sp_sm_mult<interval,srmatrix,simatrix>(r,M.A);
02569 }
02570 
02571 inline simatrix operator*(const interval& r, const simatrix_slice& M) {
02572   return sp_sm_mult<interval,simatrix,simatrix>(r,M.A);
02573 }
02574 
02575 inline simatrix operator+(const simatrix_slice& M1, const srmatrix_slice& M2) {
02576   return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
02577 }
02578 
02579 inline simatrix operator+(const srmatrix_slice& M1, const simatrix_slice& M2) {
02580   return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02581 }
02582 
02583 inline simatrix operator+(const simatrix_slice& M1, const simatrix_slice& M2) {
02584   return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02585 }
02586 
02587 inline simatrix operator+(const simatrix_slice& M1, const srmatrix& M2) {
02588   return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1.A,M2);
02589 }
02590 
02591 inline simatrix operator+(const srmatrix_slice& M1, const simatrix& M2) {
02592   return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1.A,M2);
02593 }
02594 
02595 inline simatrix operator+(const simatrix_slice& M1, const simatrix& M2) {
02596   return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1.A,M2);
02597 }
02598 
02599 inline simatrix operator+(const simatrix& M1, const srmatrix_slice& M2) {
02600   return spsp_mm_add<simatrix,srmatrix,simatrix,interval>(M1,M2.A);
02601 }
02602 
02603 inline simatrix operator+(const srmatrix& M1, const simatrix_slice& M2) {
02604   return spsp_mm_add<srmatrix,simatrix,simatrix,interval>(M1,M2.A);
02605 }
02606 
02607 inline simatrix operator+(const simatrix& M1, const simatrix_slice& M2) {
02608   return spsp_mm_add<simatrix,simatrix,simatrix,interval>(M1,M2.A);
02609 }
02610 
02611 inline imatrix operator+(const simatrix_slice& M1, const rmatrix& M2) {
02612   return spf_mm_add<simatrix,rmatrix,imatrix>(M1.A,M2);
02613 }
02614 
02615 inline imatrix operator+(const srmatrix_slice& M1, const imatrix& M2) {
02616   return spf_mm_add<srmatrix,imatrix,imatrix>(M1.A,M2);
02617 }
02618 
02619 inline imatrix operator+(const simatrix_slice& M1, const imatrix& M2) {
02620   return spf_mm_add<simatrix,imatrix,imatrix>(M1.A,M2);
02621 }
02622 
02623 inline imatrix operator+(const imatrix& M1, const srmatrix_slice& M2) {
02624   return fsp_mm_add<imatrix,srmatrix,imatrix>(M1,M2.A);
02625 }
02626 
02627 inline imatrix operator+(const rmatrix& M1, const simatrix_slice& M2) {
02628   return fsp_mm_add<rmatrix,simatrix,imatrix>(M1,M2.A);
02629 }
02630 
02631 inline imatrix operator+(const imatrix& M1, const simatrix_slice& M2) {
02632   return fsp_mm_add<imatrix,simatrix,imatrix>(M1,M2.A);
02633 }
02634 
02635 inline imatrix operator+(const simatrix_slice& M1, const rmatrix_slice& M2) {
02636   return spf_mm_add<simatrix,rmatrix_slice,imatrix>(M1.A,M2);
02637 }
02638 
02639 inline imatrix operator+(const srmatrix_slice& M1, const imatrix_slice& M2) {
02640   return spf_mm_add<srmatrix,imatrix_slice,imatrix>(M1.A,M2);
02641 }
02642 
02643 inline imatrix operator+(const simatrix_slice& M1, const imatrix_slice& M2) {
02644   return spf_mm_add<simatrix,imatrix_slice,imatrix>(M1.A,M2);
02645 }
02646 
02647 inline imatrix operator+(const imatrix_slice& M1, const srmatrix_slice& M2) {
02648   return fsp_mm_add<imatrix_slice,srmatrix,imatrix>(M1,M2.A);
02649 }
02650 
02651 inline imatrix operator+(const rmatrix_slice& M1, const simatrix_slice& M2) {
02652   return fsp_mm_add<rmatrix_slice,simatrix,imatrix>(M1,M2.A);
02653 }
02654 
02655 inline imatrix operator+(const imatrix_slice& M1, const simatrix_slice& M2) {
02656   return fsp_mm_add<imatrix_slice,simatrix,imatrix>(M1,M2.A);
02657 }
02658 
02659 inline simatrix operator-(const simatrix_slice& M1, const srmatrix_slice& M2) {
02660   return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
02661 }
02662 
02663 inline simatrix operator-(const srmatrix_slice& M1, const simatrix_slice& M2) {
02664   return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02665 }
02666 
02667 inline simatrix operator-(const simatrix_slice& M1, const simatrix_slice& M2) {
02668   return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02669 }
02670 
02671 inline simatrix operator-(const simatrix_slice& M1, const srmatrix& M2) {
02672   return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1.A,M2);
02673 }
02674 
02675 inline simatrix operator-(const srmatrix_slice& M1, const simatrix& M2) {
02676   return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1.A,M2);
02677 }
02678 
02679 inline simatrix operator-(const simatrix_slice& M1, const simatrix& M2) {
02680   return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1.A,M2);
02681 }
02682 
02683 inline simatrix operator-(const simatrix& M1, const srmatrix_slice& M2) {
02684   return spsp_mm_sub<simatrix,srmatrix,simatrix,interval>(M1,M2.A);
02685 }
02686 
02687 inline simatrix operator-(const srmatrix& M1, const simatrix_slice& M2) {
02688   return spsp_mm_sub<srmatrix,simatrix,simatrix,interval>(M1,M2.A);
02689 }
02690 
02691 inline simatrix operator-(const simatrix& M1, const simatrix_slice& M2) {
02692   return spsp_mm_sub<simatrix,simatrix,simatrix,interval>(M1,M2.A);
02693 }
02694 
02695 inline imatrix operator-(const simatrix_slice& M1, const rmatrix& M2) {
02696   return spf_mm_sub<simatrix,rmatrix,imatrix>(M1.A,M2);
02697 }
02698 
02699 inline imatrix operator-(const srmatrix_slice& M1, const imatrix& M2) {
02700   return spf_mm_sub<srmatrix,imatrix,imatrix>(M1.A,M2);
02701 }
02702 
02703 inline imatrix operator-(const simatrix_slice& M1, const imatrix& M2) {
02704   return spf_mm_sub<simatrix,imatrix,imatrix>(M1.A,M2);
02705 }
02706 
02707 inline imatrix operator-(const imatrix& M1, const srmatrix_slice& M2) {
02708   return fsp_mm_sub<imatrix,srmatrix,imatrix>(M1,M2.A);
02709 }
02710 
02711 inline imatrix operator-(const rmatrix& M1, const simatrix_slice& M2) {
02712   return fsp_mm_sub<rmatrix,simatrix,imatrix>(M1,M2.A);
02713 }
02714 
02715 inline imatrix operator-(const imatrix& M1, const simatrix_slice& M2) {
02716   return fsp_mm_sub<imatrix,simatrix,imatrix>(M1,M2.A);
02717 }
02718 
02719 inline imatrix operator-(const simatrix_slice& M1, const rmatrix_slice& M2) {
02720   return spf_mm_sub<simatrix,rmatrix_slice,imatrix>(M1.A,M2);
02721 }
02722 
02723 inline imatrix operator-(const srmatrix_slice& M1, const imatrix_slice& M2) {
02724   return spf_mm_sub<srmatrix,imatrix_slice,imatrix>(M1.A,M2);
02725 }
02726 
02727 inline imatrix operator-(const simatrix_slice& M1, const imatrix_slice& M2) {
02728   return spf_mm_sub<simatrix,imatrix_slice,imatrix>(M1.A,M2);
02729 }
02730 
02731 inline imatrix operator-(const imatrix_slice& M1, const srmatrix_slice& M2) {
02732   return fsp_mm_sub<imatrix_slice,srmatrix,imatrix>(M1,M2.A);
02733 }
02734 
02735 inline imatrix operator-(const rmatrix_slice& M1, const simatrix_slice& M2) {
02736   return fsp_mm_sub<rmatrix_slice,simatrix,imatrix>(M1,M2.A);
02737 }
02738 
02739 inline imatrix operator-(const imatrix_slice& M1, const simatrix_slice& M2) {
02740   return fsp_mm_sub<imatrix_slice,simatrix,imatrix>(M1,M2.A);
02741 }
02742 
02743 inline simatrix operator|(const simatrix_slice& M1, const srmatrix_slice& M2) {
02744   return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
02745 }
02746 
02747 inline simatrix operator|(const srmatrix_slice& M1, const simatrix_slice& M2) {
02748   return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02749 }
02750 
02751 inline simatrix operator|(const simatrix_slice& M1, const simatrix_slice& M2) {
02752   return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02753 }
02754 
02755 inline simatrix operator|(const simatrix_slice& M1, const srmatrix& M2) {
02756   return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1.A,M2);
02757 }
02758 
02759 inline simatrix operator|(const srmatrix_slice& M1, const simatrix& M2) {
02760   return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1.A,M2);
02761 }
02762 
02763 inline simatrix operator|(const simatrix_slice& M1, const simatrix& M2) {
02764   return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1.A,M2);
02765 }
02766 
02767 inline simatrix operator|(const simatrix& M1, const srmatrix_slice& M2) {
02768   return spsp_mm_hull<simatrix,srmatrix,simatrix,interval>(M1,M2.A);
02769 }
02770 
02771 inline simatrix operator|(const srmatrix& M1, const simatrix_slice& M2) {
02772   return spsp_mm_hull<srmatrix,simatrix,simatrix,interval>(M1,M2.A);
02773 }
02774 
02775 inline simatrix operator|(const simatrix& M1, const simatrix_slice& M2) {
02776   return spsp_mm_hull<simatrix,simatrix,simatrix,interval>(M1,M2.A);
02777 }
02778 
02779 inline imatrix operator|(const simatrix_slice& M1, const rmatrix& M2) {
02780   return spf_mm_hull<simatrix,rmatrix,imatrix>(M1.A,M2);
02781 }
02782 
02783 inline imatrix operator|(const srmatrix_slice& M1, const imatrix& M2) {
02784   return spf_mm_hull<srmatrix,imatrix,imatrix>(M1.A,M2);
02785 }
02786 
02787 inline imatrix operator|(const simatrix_slice& M1, const imatrix& M2) {
02788   return spf_mm_hull<simatrix,imatrix,imatrix>(M1.A,M2);
02789 }
02790 
02791 inline imatrix operator|(const imatrix& M1, const srmatrix_slice& M2) {
02792   return fsp_mm_hull<imatrix,srmatrix,imatrix>(M1,M2.A);
02793 }
02794 
02795 inline imatrix operator|(const rmatrix& M1, const simatrix_slice& M2) {
02796   return fsp_mm_hull<rmatrix,simatrix,imatrix>(M1,M2.A);
02797 }
02798 
02799 inline imatrix operator|(const imatrix& M1, const simatrix_slice& M2) {
02800   return fsp_mm_hull<imatrix,simatrix,imatrix>(M1,M2.A);
02801 }
02802 
02803 inline imatrix operator|(const simatrix_slice& M1, const rmatrix_slice& M2) {
02804   return spf_mm_hull<simatrix,rmatrix_slice,imatrix>(M1.A,M2);
02805 }
02806 
02807 inline imatrix operator|(const srmatrix_slice& M1, const imatrix_slice& M2) {
02808   return spf_mm_hull<srmatrix,imatrix_slice,imatrix>(M1.A,M2);
02809 }
02810 
02811 inline imatrix operator|(const simatrix_slice& M1, const imatrix_slice& M2) {
02812   return spf_mm_hull<simatrix,imatrix_slice,imatrix>(M1.A,M2);
02813 }
02814 
02815 inline imatrix operator|(const imatrix_slice& M1, const srmatrix_slice& M2) {
02816   return fsp_mm_hull<imatrix_slice,srmatrix,imatrix>(M1,M2.A);
02817 }
02818 
02819 inline imatrix operator|(const rmatrix_slice& M1, const simatrix_slice& M2) {
02820   return fsp_mm_hull<rmatrix_slice,simatrix,imatrix>(M1,M2.A);
02821 }
02822 
02823 inline imatrix operator|(const imatrix_slice& M1, const simatrix_slice& M2) {
02824   return fsp_mm_hull<imatrix_slice,simatrix,imatrix>(M1,M2.A);
02825 }
02826 
02827 inline simatrix operator|(const srmatrix_slice& M1, const srmatrix_slice& M2) {
02828   return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1.A,M2.A);
02829 }
02830 
02831 inline simatrix operator|(const srmatrix_slice& M1, const srmatrix& M2) {
02832   return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1.A,M2);
02833 }
02834 
02835 inline simatrix operator|(const srmatrix& M1, const srmatrix_slice& M2) {
02836   return spsp_mm_hull<srmatrix,srmatrix,simatrix,interval>(M1,M2.A);
02837 }
02838 
02839 inline imatrix operator|(const srmatrix_slice& M1, const rmatrix& M2) {
02840   return spf_mm_hull<srmatrix,rmatrix,imatrix>(M1.A,M2);
02841 }
02842 
02843 inline imatrix operator|(const rmatrix& M1, const srmatrix_slice& M2) {
02844   return fsp_mm_hull<rmatrix,srmatrix,imatrix>(M1,M2.A);
02845 }
02846 
02847 inline imatrix operator|(const srmatrix_slice& M1, const rmatrix_slice& M2) {
02848   return spf_mm_hull<srmatrix,rmatrix_slice,imatrix>(M1.A,M2);
02849 }
02850 
02851 inline imatrix operator|(const rmatrix_slice& M1, const srmatrix_slice& M2) {
02852   return fsp_mm_hull<rmatrix_slice,srmatrix,imatrix>(M1,M2.A);
02853 }
02854 
02855 inline simatrix operator&(const simatrix_slice& M1, const simatrix_slice& M2) {
02856   return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1.A,M2.A);
02857 }
02858 
02859 inline simatrix operator&(const simatrix_slice& M1, const simatrix& M2) {
02860   return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1.A,M2);
02861 }
02862 
02863 inline simatrix operator&(const simatrix& M1, const simatrix_slice& M2) {
02864   return spsp_mm_intersect<simatrix,simatrix,simatrix,interval>(M1,M2.A);
02865 }
02866 
02867 inline imatrix operator&(const simatrix_slice& M1, const imatrix& M2) {
02868   return spf_mm_intersect<simatrix,imatrix,imatrix>(M1.A,M2);
02869 }
02870 
02871 inline imatrix operator&(const imatrix& M1, const simatrix_slice& M2) {
02872   return fsp_mm_intersect<imatrix,simatrix,imatrix>(M1,M2.A);
02873 }
02874 
02875 inline imatrix operator&(const simatrix_slice& M1, const imatrix_slice& M2) {
02876   return spf_mm_intersect<simatrix,imatrix_slice,imatrix>(M1.A,M2);
02877 }
02878 
02879 inline imatrix operator&(const imatrix_slice& M1, const simatrix_slice& M2) {
02880   return fsp_mm_intersect<imatrix_slice,simatrix,imatrix>(M1,M2.A);
02881 }
02882 
02883 inline bool operator==(const simatrix_slice& M1, const srmatrix_slice& M2) {
02884   return spsp_mm_comp(M1.A,M2.A);
02885 }
02886 
02887 inline bool operator==(const srmatrix_slice& M1, const simatrix_slice& M2) {
02888   return spsp_mm_comp(M1.A,M2.A);
02889 }
02890 
02891 inline bool operator==(const simatrix_slice& M1, const simatrix_slice& M2) {
02892   return spsp_mm_comp(M1.A,M2.A);
02893 }
02894 
02895 inline bool operator==(const simatrix_slice& M1, const srmatrix& M2) {
02896   return spsp_mm_comp(M1.A,M2);
02897 }
02898 
02899 inline bool operator==(const srmatrix_slice& M1, const simatrix& M2) {
02900   return spsp_mm_comp(M1.A,M2);
02901 }
02902 
02903 inline bool operator==(const simatrix_slice& M1, const simatrix& M2) {
02904   return spsp_mm_comp(M1.A,M2);
02905 }
02906 
02907 inline bool operator==(const simatrix& M1, const srmatrix_slice& M2) {
02908   return spsp_mm_comp(M1,M2.A);
02909 }
02910 
02911 inline bool operator==(const srmatrix& M1, const simatrix_slice& M2) {
02912   return spsp_mm_comp(M1,M2.A);
02913 }
02914 
02915 inline bool operator==(const simatrix& M1, const simatrix_slice& M2) {
02916   return spsp_mm_comp(M1,M2.A);
02917 }
02918 
02919 inline bool operator==(const simatrix_slice& M1, const rmatrix& M2) {
02920   return spf_mm_comp(M1.A,M2);
02921 }
02922 
02923 inline bool operator==(const srmatrix_slice& M1, const imatrix& M2) {
02924   return spf_mm_comp(M1.A,M2);
02925 }
02926 
02927 inline bool operator==(const simatrix_slice& M1, const imatrix& M2) {
02928   return spf_mm_comp(M1.A,M2);
02929 }
02930 
02931 inline bool operator==(const imatrix& M1, const srmatrix_slice& M2) {
02932   return fsp_mm_comp(M1,M2.A);
02933 }
02934 
02935 inline bool operator==(const rmatrix& M1, const simatrix_slice& M2) {
02936   return fsp_mm_comp(M1,M2.A);
02937 }
02938 
02939 inline bool operator==(const imatrix& M1, const simatrix_slice& M2) {
02940   return fsp_mm_comp(M1,M2.A);
02941 }
02942 
02943 inline bool operator==(const imatrix_slice& M1, const srmatrix_slice& M2) {
02944   return fsp_mm_comp(M1,M2.A);
02945 }
02946 
02947 inline bool operator==(const rmatrix_slice& M1, const simatrix_slice& M2) {
02948   return fsp_mm_comp(M1,M2.A);
02949 }
02950 
02951 inline bool operator==(const imatrix_slice& M1, const simatrix_slice& M2) {
02952   return fsp_mm_comp(M1,M2.A);
02953 }
02954 
02955 inline bool operator==(const simatrix_slice& M1, const rmatrix_slice& M2) {
02956   return spf_mm_comp(M1.A,M2);
02957 }
02958 
02959 inline bool operator==(const srmatrix_slice& M1, const imatrix_slice& M2) {
02960   return spf_mm_comp(M1.A,M2);
02961 }
02962 
02963 inline bool operator==(const simatrix_slice& M1, const imatrix_slice& M2) {
02964   return spf_mm_comp(M1.A,M2);
02965 }
02966 
02967 inline bool operator!=(const simatrix_slice& M1, const srmatrix_slice& M2) {
02968   return !spsp_mm_comp(M1.A,M2.A);
02969 }
02970 
02971 inline bool operator!=(const srmatrix_slice& M1, const simatrix_slice& M2) {
02972   return !spsp_mm_comp(M1.A,M2.A);
02973 }
02974 
02975 inline bool operator!=(const simatrix_slice& M1, const simatrix_slice& M2) {
02976   return !spsp_mm_comp(M1.A,M2.A);
02977 }
02978 
02979 inline bool operator!=(const simatrix_slice& M1, const srmatrix& M2) {
02980   return !spsp_mm_comp(M1.A,M2);
02981 }
02982 
02983 inline bool operator!=(const srmatrix_slice& M1, const simatrix& M2) {
02984   return !spsp_mm_comp(M1.A,M2);
02985 }
02986 
02987 inline bool operator!=(const simatrix_slice& M1, const simatrix& M2) {
02988   return !spsp_mm_comp(M1.A,M2);
02989 }
02990 
02991 inline bool operator!=(const simatrix& M1, const srmatrix_slice& M2) {
02992   return !spsp_mm_comp(M1,M2.A);
02993 }
02994 
02995 inline bool operator!=(const srmatrix& M1, const simatrix_slice& M2) {
02996   return !spsp_mm_comp(M1,M2.A);
02997 }
02998 
02999 inline bool operator!=(const simatrix& M1, const simatrix_slice& M2) {
03000   return !spsp_mm_comp(M1,M2.A);
03001 }
03002 
03003 inline bool operator!=(const simatrix_slice& M1, const rmatrix& M2) {
03004   return !spf_mm_comp(M1.A,M2);
03005 }
03006 
03007 inline bool operator!=(const srmatrix_slice& M1, const imatrix& M2) {
03008   return !spf_mm_comp(M1.A,M2);
03009 }
03010 
03011 inline bool operator!=(const simatrix_slice& M1, const imatrix& M2) {
03012   return !spf_mm_comp(M1.A,M2);
03013 }
03014 
03015 inline bool operator!=(const imatrix& M1, const srmatrix_slice& M2) {
03016   return !fsp_mm_comp(M1,M2.A);
03017 }
03018 
03019 inline bool operator!=(const rmatrix& M1, const simatrix_slice& M2) {
03020   return !fsp_mm_comp(M1,M2.A);
03021 }
03022 
03023 inline bool operator!=(const imatrix& M1, const simatrix_slice& M2) {
03024   return !fsp_mm_comp(M1,M2.A);
03025 }
03026 
03027 inline bool operator!=(const imatrix_slice& M1, const srmatrix_slice& M2) {
03028   return !fsp_mm_comp(M1,M2.A);
03029 }
03030 
03031 inline bool operator!=(const rmatrix_slice& M1, const simatrix_slice& M2) {
03032   return !fsp_mm_comp(M1,M2.A);
03033 }
03034 
03035 inline bool operator!=(const imatrix_slice& M1, const simatrix_slice& M2) {
03036   return !fsp_mm_comp(M1,M2.A);
03037 }
03038 
03039 inline bool operator!=(const simatrix_slice& M1, const rmatrix_slice& M2) {
03040   return !spf_mm_comp(M1.A,M2);
03041 }
03042 
03043 inline bool operator!=(const srmatrix_slice& M1, const imatrix_slice& M2) {
03044   return !spf_mm_comp(M1.A,M2);
03045 }
03046 
03047 inline bool operator!=(const simatrix_slice& M1, const imatrix_slice& M2) {
03048   return !spf_mm_comp(M1.A,M2);
03049 }
03050 
03051 inline bool operator<(const srmatrix_slice& M1, const simatrix_slice& M2) {
03052   return spsp_mm_less<srmatrix,simatrix,interval>(M1.A,M2.A);
03053 }
03054 
03055 inline bool operator<(const simatrix_slice& M1, const simatrix_slice& M2) {
03056   return spsp_mm_less<simatrix,simatrix,interval>(M1.A,M2.A);
03057 }
03058 
03059 inline bool operator<(const srmatrix_slice& M1, const simatrix& M2) {
03060   return spsp_mm_less<srmatrix,simatrix,interval>(M1.A,M2);
03061 }
03062 
03063 inline bool operator<(const simatrix_slice& M1, const simatrix& M2) {
03064   return spsp_mm_less<simatrix,simatrix,interval>(M1.A,M2);
03065 }
03066 
03067 inline bool operator<(const srmatrix& M1, const simatrix_slice& M2) {
03068   return spsp_mm_less<srmatrix,simatrix,interval>(M1,M2.A);
03069 }
03070 
03071 inline bool operator<(const simatrix& M1, const simatrix_slice& M2) {
03072   return spsp_mm_less<simatrix,simatrix,interval>(M1,M2.A);
03073 }
03074 
03075 inline bool operator<(const srmatrix_slice& M1, const imatrix& M2) {
03076   return spf_mm_less<srmatrix,imatrix,interval>(M1.A,M2);
03077 }
03078 
03079 inline bool operator<(const simatrix_slice& M1, const imatrix& M2) {
03080   return spf_mm_less<simatrix,imatrix,interval>(M1.A,M2);
03081 }
03082 
03083 inline bool operator<(const rmatrix& M1, const simatrix_slice& M2) {
03084   return fsp_mm_less<rmatrix,simatrix,interval>(M1,M2.A);
03085 }
03086 
03087 inline bool operator<(const imatrix& M1, const simatrix_slice& M2) {
03088   return fsp_mm_less<imatrix,simatrix,interval>(M1,M2.A);
03089 }
03090 
03091 inline bool operator<(const rmatrix_slice& M1, const simatrix_slice& M2) {
03092   return fsp_mm_less<rmatrix_slice,simatrix,interval>(M1,M2.A);
03093 }
03094 
03095 inline bool operator<(const imatrix_slice& M1, const simatrix_slice& M2) {
03096   return fsp_mm_less<imatrix_slice,simatrix,interval>(M1,M2.A);
03097 }
03098 
03099 inline bool operator<(const srmatrix_slice& M1, const imatrix_slice& M2) {
03100   return spf_mm_less<srmatrix,imatrix_slice,interval>(M1.A,M2);
03101 }
03102 
03103 inline bool operator<(const simatrix_slice& M1, const imatrix_slice& M2) {
03104   return spf_mm_less<simatrix,imatrix_slice,interval>(M1.A,M2);
03105 }
03106 
03107 inline bool operator<=(const srmatrix_slice& M1, const simatrix_slice& M2) {
03108   return spsp_mm_leq<srmatrix,simatrix,interval>(M1.A,M2.A);
03109 }
03110 
03111 inline bool operator<=(const simatrix_slice& M1, const simatrix_slice& M2) {
03112   return spsp_mm_leq<simatrix,simatrix,interval>(M1.A,M2.A);
03113 }
03114 
03115 inline bool operator<=(const srmatrix_slice& M1, const simatrix& M2) {
03116   return spsp_mm_leq<srmatrix,simatrix,interval>(M1.A,M2);
03117 }
03118 
03119 inline bool operator<=(const simatrix_slice& M1, const simatrix& M2) {
03120   return spsp_mm_leq<simatrix,simatrix,interval>(M1.A,M2);
03121 }
03122 
03123 inline bool operator<=(const srmatrix& M1, const simatrix_slice& M2) {
03124   return spsp_mm_leq<srmatrix,simatrix,interval>(M1,M2.A);
03125 }
03126 
03127 inline bool operator<=(const simatrix& M1, const simatrix_slice& M2) {
03128   return spsp_mm_leq<simatrix,simatrix,interval>(M1,M2.A);
03129 }
03130 
03131 inline bool operator<=(const srmatrix_slice& M1, const imatrix& M2) {
03132   return spf_mm_leq<srmatrix,imatrix,interval>(M1.A,M2);
03133 }
03134 
03135 inline bool operator<=(const simatrix_slice& M1, const imatrix& M2) {
03136   return spf_mm_leq<simatrix,imatrix,interval>(M1.A,M2);
03137 }
03138 
03139 inline bool operator<=(const rmatrix& M1, const simatrix_slice& M2) {
03140   return fsp_mm_leq<rmatrix,simatrix,interval>(M1,M2.A);
03141 }
03142 
03143 inline bool operator<=(const imatrix& M1, const simatrix_slice& M2) {
03144   return fsp_mm_leq<imatrix,simatrix,interval>(M1,M2.A);
03145 }
03146 
03147 inline bool operator<=(const rmatrix_slice& M1, const simatrix_slice& M2) {
03148   return fsp_mm_leq<rmatrix_slice,simatrix,interval>(M1,M2.A);
03149 }
03150 
03151 inline bool operator<=(const imatrix_slice& M1, const simatrix_slice& M2) {
03152   return fsp_mm_leq<imatrix_slice,simatrix,interval>(M1,M2.A);
03153 }
03154 
03155 inline bool operator<=(const srmatrix_slice& M1, const imatrix_slice& M2) {
03156   return spf_mm_leq<srmatrix,imatrix_slice,interval>(M1.A,M2);
03157 }
03158 
03159 inline bool operator<=(const simatrix_slice& M1, const imatrix_slice& M2) {
03160   return spf_mm_leq<simatrix,imatrix_slice,interval>(M1.A,M2);
03161 }
03162 
03163 inline bool operator>(const simatrix_slice& M1, const srmatrix_slice& M2) {
03164   return spsp_mm_greater<simatrix,srmatrix,interval>(M1.A,M2.A);
03165 }
03166 
03167 inline bool operator>(const simatrix_slice& M1, const simatrix_slice& M2) {
03168   return spsp_mm_greater<simatrix,simatrix,interval>(M1.A,M2.A);
03169 }
03170 
03171 inline bool operator>(const simatrix_slice& M1, const srmatrix& M2) {
03172   return spsp_mm_greater<simatrix,srmatrix,interval>(M1.A,M2);
03173 }
03174 
03175 inline bool operator>(const simatrix_slice& M1, const simatrix& M2) {
03176   return spsp_mm_greater<simatrix,simatrix,interval>(M1.A,M2);
03177 }
03178 
03179 inline bool operator>(const simatrix& M1, const srmatrix_slice& M2) {
03180   return spsp_mm_greater<simatrix,srmatrix,interval>(M1,M2.A);
03181 }
03182 
03183 inline bool operator>(const simatrix& M1, const simatrix_slice& M2) {
03184   return spsp_mm_greater<simatrix,simatrix,interval>(M1,M2.A);
03185 }
03186 
03187 inline bool operator>(const simatrix_slice& M1, const rmatrix& M2) {
03188   return spf_mm_greater<simatrix,rmatrix,interval>(M1.A,M2);
03189 }
03190 
03191 inline bool operator>(const simatrix_slice& M1, const imatrix& M2) {
03192   return spf_mm_greater<simatrix,imatrix,interval>(M1.A,M2);
03193 }
03194 
03195 inline bool operator>(const imatrix& M1, const srmatrix_slice& M2) {
03196   return fsp_mm_greater<imatrix,srmatrix,interval>(M1,M2.A);
03197 }
03198 
03199 inline bool operator>(const imatrix& M1, const simatrix_slice& M2) {
03200   return fsp_mm_greater<imatrix,simatrix,interval>(M1,M2.A);
03201 }
03202 
03203 inline bool operator>(const imatrix_slice& M1, const srmatrix_slice& M2) {
03204   return fsp_mm_greater<imatrix,srmatrix,interval>(M1,M2.A);
03205 }
03206 
03207 inline bool operator>(const imatrix_slice& M1, const simatrix_slice& M2) {
03208   return fsp_mm_greater<imatrix_slice,simatrix,interval>(M1,M2.A);
03209 }
03210 
03211 inline bool operator>(const simatrix_slice& M1, const rmatrix_slice& M2) {
03212   return spf_mm_greater<simatrix,rmatrix_slice,interval>(M1.A,M2);
03213 }
03214 
03215 inline bool operator>(const simatrix_slice& M1, const imatrix_slice& M2) {
03216   return spf_mm_greater<simatrix,imatrix_slice,interval>(M1.A,M2);
03217 }
03218 
03219 inline bool operator>=(const simatrix_slice& M1, const srmatrix_slice& M2) {
03220   return spsp_mm_geq<simatrix,srmatrix,interval>(M1.A,M2.A);
03221 }
03222 
03223 inline bool operator>=(const simatrix_slice& M1, const simatrix_slice& M2) {
03224   return spsp_mm_geq<simatrix,simatrix,interval>(M1.A,M2.A);
03225 }
03226 
03227 inline bool operator>=(const simatrix_slice& M1, const srmatrix& M2) {
03228   return spsp_mm_geq<simatrix,srmatrix,interval>(M1.A,M2);
03229 }
03230 
03231 inline bool operator>=(const simatrix_slice& M1, const simatrix& M2) {
03232   return spsp_mm_geq<simatrix,simatrix,interval>(M1.A,M2);
03233 }
03234 
03235 inline bool operator>=(const simatrix& M1, const srmatrix_slice& M2) {
03236   return spsp_mm_geq<simatrix,srmatrix,interval>(M1,M2.A);
03237 }
03238 
03239 inline bool operator>=(const simatrix& M1, const simatrix_slice& M2) {
03240   return spsp_mm_geq<simatrix,simatrix,interval>(M1,M2.A);
03241 }
03242 
03243 inline bool operator>=(const simatrix_slice& M1, const rmatrix& M2) {
03244   return spf_mm_geq<simatrix,rmatrix,interval>(M1.A,M2);
03245 }
03246 
03247 inline bool operator>=(const simatrix_slice& M1, const imatrix& M2) {
03248   return spf_mm_geq<simatrix,imatrix,interval>(M1.A,M2);
03249 }
03250 
03251 inline bool operator>=(const imatrix& M1, const srmatrix_slice& M2) {
03252   return fsp_mm_geq<imatrix,srmatrix,interval>(M1,M2.A);
03253 }
03254 
03255 inline bool operator>=(const imatrix& M1, const simatrix_slice& M2) {
03256   return fsp_mm_geq<imatrix,simatrix,interval>(M1,M2.A);
03257 }
03258 
03259 inline bool operator>=(const imatrix_slice& M1, const srmatrix_slice& M2) {
03260   return fsp_mm_geq<imatrix,srmatrix,interval>(M1,M2.A);
03261 }
03262 
03263 inline bool operator>=(const imatrix_slice& M1, const simatrix_slice& M2) {
03264   return fsp_mm_geq<imatrix_slice,simatrix,interval>(M1,M2.A);
03265 }
03266 
03267 inline bool operator>=(const simatrix_slice& M1, const rmatrix_slice& M2) {
03268   return spf_mm_geq<simatrix,rmatrix_slice,interval>(M1.A,M2);
03269 }
03270 
03271 inline bool operator>=(const simatrix_slice& M1, const imatrix_slice& M2) {
03272   return spf_mm_geq<simatrix,imatrix_slice,interval>(M1.A,M2);
03273 }
03274 
03275 inline bool operator!(const simatrix_slice& M) {
03276   return sp_m_not(M.A);
03277 }
03278 
03279 inline std::ostream& operator<<(std::ostream& os, const simatrix_slice& M) {
03280   return sp_m_output<simatrix,interval>(os, M.A);
03281 }
03282 
03283 inline std::istream& operator>>(std::istream& is, simatrix_slice& M) {
03284   simatrix tmp(M.A.m, M.A.n);
03285   sp_m_input<simatrix,interval>(is, tmp);
03286   M = tmp;
03287   return is;
03288 }
03289 
03290 
03291 class simatrix_subv {
03292   private:
03293     simatrix_slice dat;
03294     bool row;
03295     int index;
03296 
03297     simatrix_subv(simatrix& A, bool r, int i, int j, int k, int l) : dat(A,i,j,k,l), row(r) {
03298        if(row) index=i; else index=k;
03299     }
03300 
03301     simatrix_subv(const simatrix& A, bool r, int i, int j, int k, int l) : dat(A,i,j,k,l), row(r) {
03302        if(row) index=i; else index=k;
03303     }
03304 
03305   public:
03306     interval& operator[](const int i) {
03307       if(row) {
03308 #if(CXSC_INDEX_CHECK)
03309         if(i<dat.A.lb2 || i>dat.A.ub2)
03310           cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)"));
03311 #endif
03312         return dat.element(index,i);
03313       } else {
03314 #if(CXSC_INDEX_CHECK)
03315         if(i<dat.A.lb1 || i>dat.A.ub1)
03316           cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)"));
03317 #endif
03318         return dat.element(i,index);
03319       }
03320     }
03321 
03322     const interval operator[](const int i) const{
03323       if(row) {
03324 #if(CXSC_INDEX_CHECK)
03325         if(i<dat.A.lb2 || i>dat.A.ub2)
03326           cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)"));
03327 #endif
03328         return dat(index,i);
03329       } else {
03330 #if(CXSC_INDEX_CHECK)
03331         if(i<dat.A.lb1 || i>dat.A.ub1)
03332           cxscthrow(ELEMENT_NOT_IN_VEC("simatrix_subv::operator[](int)"));
03333 #endif
03334         return dat(i,index);
03335       }
03336     }
03337 
03338     simatrix_subv& operator=(const real& v) {
03339       return sv_vs_assign(*this,v);
03340     }
03341 
03342     simatrix_subv& operator=(const interval& v) {
03343       return sv_vs_assign(*this,v);
03344     }
03345 
03346     simatrix_subv& operator=(const srvector& v) {
03347       return svsp_vv_assign(*this,v);
03348     }
03349 
03350     simatrix_subv& operator=(const sivector& v) {
03351       return svsp_vv_assign(*this,v);
03352     }
03353 
03354     simatrix_subv& operator=(const srvector_slice& v) {
03355       return svsl_vv_assign(*this,v);
03356     }
03357 
03358     simatrix_subv& operator=(const sivector_slice& v) {
03359       return svsl_vv_assign(*this,v);
03360     }
03361 
03362     simatrix_subv& operator=(const rvector& v) {
03363       return svf_vv_assign(*this,v);
03364     }
03365 
03366     simatrix_subv& operator=(const ivector& v) {
03367       return svf_vv_assign(*this,v);
03368     }
03369 
03370     simatrix_subv& operator=(const rvector_slice& v) {
03371       return svf_vv_assign(*this,v);
03372     }
03373 
03374     simatrix_subv& operator=(const ivector_slice& v) {
03375       return svf_vv_assign(*this,v);
03376     }
03377 
03378     simatrix_subv& operator=(const srmatrix_subv& v) {
03379       return svsp_vv_assign(*this,srvector(v));
03380     }
03381 
03382     simatrix_subv& operator=(const simatrix_subv& v) {
03383       return svsp_vv_assign(*this,sivector(v));
03384     }
03385 
03386     simatrix_subv& operator*=(const real&);
03387     simatrix_subv& operator*=(const interval&);
03388     simatrix_subv& operator/=(const real&);
03389     simatrix_subv& operator/=(const interval&);
03390     simatrix_subv& operator+=(const srvector&);
03391     simatrix_subv& operator+=(const srvector_slice&);
03392     simatrix_subv& operator+=(const rvector&);
03393     simatrix_subv& operator+=(const rvector_slice&);
03394     simatrix_subv& operator-=(const srvector&);
03395     simatrix_subv& operator-=(const srvector_slice&);
03396     simatrix_subv& operator-=(const rvector&);
03397     simatrix_subv& operator-=(const rvector_slice&);
03398     simatrix_subv& operator+=(const sivector&);
03399     simatrix_subv& operator+=(const sivector_slice&);
03400     simatrix_subv& operator+=(const ivector&);
03401     simatrix_subv& operator+=(const ivector_slice&);
03402     simatrix_subv& operator-=(const sivector&);
03403     simatrix_subv& operator-=(const sivector_slice&);
03404     simatrix_subv& operator-=(const ivector&);
03405     simatrix_subv& operator-=(const ivector_slice&);
03406     simatrix_subv& operator|=(const srvector&);
03407     simatrix_subv& operator|=(const srvector_slice&);
03408     simatrix_subv& operator|=(const rvector&);
03409     simatrix_subv& operator|=(const rvector_slice&);
03410     simatrix_subv& operator|=(const sivector&);
03411     simatrix_subv& operator|=(const sivector_slice&);
03412     simatrix_subv& operator|=(const ivector&);
03413     simatrix_subv& operator|=(const ivector_slice&);
03414 
03415     friend sivector operator-(const simatrix_subv&);
03416 
03417     friend std::istream& operator>>(std::istream&, simatrix_subv&);
03418 
03419     friend int Lb(const simatrix_subv&);
03420     friend int Ub(const simatrix_subv&);
03421     friend int VecLen(const simatrix_subv&);
03422     friend srvector Inf(const simatrix_subv&);
03423     friend srvector Sup(const simatrix_subv&);
03424 
03425     friend class srvector;
03426     friend class srmatrix;
03427     friend class srmatrix_slice;
03428     friend class sivector;
03429     friend class simatrix;
03430     friend class simatrix_slice;
03431     friend class scivector;
03432     friend class scimatrix;
03433     friend class scimatrix_slice;
03434 
03435 #include "vector_friend_declarations.inl"
03436 };
03437 
03438 inline int Lb(const simatrix_subv& S) {
03439   if(S.row)
03440     return Lb(S.dat, 2);
03441   else
03442     return Lb(S.dat, 1);
03443 }
03444 
03445 inline int Ub(const simatrix_subv& S) {
03446   if(S.row)
03447     return Ub(S.dat, 2);
03448   else
03449     return Ub(S.dat, 1);
03450 }
03451 
03452 inline int VecLen(const simatrix_subv& S) {
03453   return Ub(S)-Lb(S)+1;
03454 }
03455 
03456 inline srvector Inf(const simatrix_subv& S) {
03457   return Inf(sivector(S));
03458 }
03459 
03460 inline srvector Sup(const simatrix_subv& S) {
03461   return Sup(sivector(S));
03462 }
03463 
03464 inline srvector mid(const simatrix_subv& S) {
03465   return mid(sivector(S));
03466 }
03467 
03468 inline srvector diam(const simatrix_subv& S) {
03469   return diam(sivector(S));
03470 }
03471 
03472 inline sivector abs(const simatrix_subv& S) {
03473   return abs(sivector(S));
03474 }
03475 
03476 inline std::ostream& operator<<(std::ostream& os, const simatrix_subv& v) {
03477   os << sivector(v);
03478   return os;
03479 }
03480 
03481 inline std::istream& operator>>(std::istream& is, simatrix_subv& v) {
03482   int n = 0;
03483   if(v.row) n=v.dat.A.n; else n=v.dat.A.m;
03484   sivector tmp(n);
03485   is >> tmp;
03486   v = tmp;
03487   return is;
03488 }
03489 
03490 inline simatrix_subv simatrix::operator[](const cxscmatrix_column& c) {
03491 #if(CXSC_INDEX_CHECK)
03492   if(c.col()<lb2 || c.col()>ub2)
03493     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)"));
03494 #endif
03495   return simatrix_subv(*this, false, lb1, ub1, c.col(), c.col());
03496 }
03497 
03498 inline simatrix_subv simatrix::operator[](const int i) {
03499 #if(CXSC_INDEX_CHECK)
03500   if(i<lb1 || i>ub1)
03501     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int)"));
03502 #endif
03503   return simatrix_subv(*this, true, i, i, lb2, ub2);
03504 }
03505 
03506 inline const simatrix_subv simatrix::operator[](const cxscmatrix_column& c) const {
03507 #if(CXSC_INDEX_CHECK)
03508   if(c.col()<lb2 || c.col()>ub2)
03509     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)"));
03510 #endif
03511   return simatrix_subv(*this, false, lb1, ub1, c.col(), c.col());
03512 }
03513 
03514 inline const simatrix_subv simatrix::operator[](const int i) const {
03515 #if(CXSC_INDEX_CHECK)
03516   if(i<lb1 || i>ub1)
03517     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int)"));
03518 #endif
03519   return simatrix_subv(*this, true, i, i, lb2, ub2);
03520 }
03521 
03522 inline simatrix_subv simatrix_slice::operator[](const int i) {
03523 #if(CXSC_INDEX_CHECK)
03524   if(i<A.lb1 || i>A.ub1)
03525     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int"));
03526 #endif
03527   return simatrix_subv(*M, true, i, i, A.lb2, A.ub2);
03528 }
03529 
03530 inline simatrix_subv simatrix_slice::operator[](const cxscmatrix_column& c) {
03531 #if(CXSC_INDEX_CHECK)
03532   if(c.col()<A.lb2 || c.col()>A.ub2)
03533     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)"));
03534 #endif
03535   return simatrix_subv(*M, false, A.lb1, A.ub1, c.col(), c.col());
03536 }
03537 
03538 inline const simatrix_subv simatrix_slice::operator[](const int i) const {
03539 #if(CXSC_INDEX_CHECK)
03540   if(i<A.lb1 || i>A.ub1)
03541     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const int"));
03542 #endif
03543   return simatrix_subv(*M, true, i, i, A.lb2, A.ub2);
03544 }
03545 
03546 inline const simatrix_subv simatrix_slice::operator[](const cxscmatrix_column& c) const {
03547 #if(CXSC_INDEX_CHECK)
03548   if(c.col()<A.lb2 || c.col()>A.ub2)
03549     cxscthrow(ROW_OR_COL_NOT_IN_MAT("simatrix::operator[](const cxscmatrix_column&)"));
03550 #endif
03551   return simatrix_subv(*M, false, A.lb1, A.ub1, c.col(), c.col());
03552 }
03553 
03554 inline sivector::sivector(const simatrix_subv& A) {
03555   int nnz = A.dat.A.get_nnz();
03556   p.reserve(nnz);
03557   x.reserve(nnz);
03558 
03559   if(A.row) {
03560     lb = A.dat.A.lb2;
03561     ub = A.dat.A.ub2;
03562     n = ub-lb+1; 
03563 
03564     for(int j=0 ; j<n ; j++) {
03565       for(int k=A.dat.A.p[j] ; k<A.dat.A.p[j+1] ; k++) {
03566         p.push_back(j);
03567         x.push_back(A.dat.A.x[k]);
03568       }
03569     }
03570 
03571   } else {
03572     lb = A.dat.A.lb1;
03573     ub = A.dat.A.ub1;
03574     n = ub-lb+1; 
03575 
03576     for(unsigned int k=0 ; k<A.dat.A.ind.size() ; k++) {
03577         p.push_back(A.dat.A.ind[k]);
03578         x.push_back(A.dat.A.x[k]);
03579     }
03580   }
03581 }
03582 
03583 inline sivector operator-(const simatrix_subv& v) {
03584  sivector s(v);
03585  return -s;
03586 }
03587 
03588 inline sivector operator/(const simatrix_subv& v1, const real& v2) {
03589   return sivector(v1) / v2;
03590 }
03591 
03592 inline sivector operator/(const simatrix_subv& v1, const interval& v2) {
03593   return sivector(v1) / v2;
03594 }
03595 
03596 inline sivector operator/(const srmatrix_subv& v1, const interval& v2) {
03597   return srvector(v1) / v2;
03598 }
03599 
03600 inline sivector operator*(const simatrix_subv& v1, const real& v2) {
03601   return sivector(v1) * v2;
03602 }
03603 
03604 inline sivector operator*(const simatrix_subv& v1, const interval& v2) {
03605   return sivector(v1) * v2;
03606 }
03607 
03608 inline sivector operator*(const srmatrix_subv& v1, const interval& v2) {
03609   return srvector(v1) * v2;
03610 }
03611 
03612 inline sivector operator*(const real& v1, const simatrix_subv& v2) {
03613   return v1 * sivector(v2);
03614 }
03615 
03616 inline sivector operator*(const interval& v1, const simatrix_subv& v2) {
03617   return v1 * sivector(v2);
03618 }
03619 
03620 inline sivector operator*(const interval& v1, const srmatrix_subv& v2) {
03621   return v1 * srvector(v2);
03622 }
03623 
03624 inline interval operator*(const simatrix_subv& v1, const srvector& v2) {
03625   return sivector(v1) * v2;
03626 }
03627 
03628 inline interval operator*(const srmatrix_subv& v1, const sivector& v2) {
03629   return srvector(v1) * v2;
03630 }
03631 
03632 inline interval operator*(const simatrix_subv& v1, const sivector& v2) {
03633   return sivector(v1) * v2;
03634 }
03635 
03636 inline interval operator*(const simatrix_subv& v1, const srvector_slice& v2) {
03637   return sivector(v1) * v2;
03638 }
03639 
03640 inline interval operator*(const srmatrix_subv& v1, const sivector_slice& v2) {
03641   return srvector(v1) * v2;
03642 }
03643 
03644 inline interval operator*(const simatrix_subv& v1, const sivector_slice& v2) {
03645   return sivector(v1) * v2;
03646 }
03647 
03648 inline interval operator*(const simatrix_subv& v1, const rvector& v2) {
03649   return sivector(v1) * v2;
03650 }
03651 
03652 inline interval operator*(const srmatrix_subv& v1, const ivector& v2) {
03653   return srvector(v1) * v2;
03654 }
03655 
03656 inline interval operator*(const simatrix_subv& v1, const ivector& v2) {
03657   return sivector(v1) * v2;
03658 }
03659 
03660 inline interval operator*(const simatrix_subv& v1, const rvector_slice& v2) {
03661   return sivector(v1) * v2;
03662 }
03663 
03664 inline interval operator*(const srmatrix_subv& v1, const ivector_slice& v2) {
03665   return srvector(v1) * v2;
03666 }
03667 
03668 inline interval operator*(const simatrix_subv& v1, const ivector_slice& v2) {
03669   return sivector(v1) * v2;
03670 }
03671 
03672 inline interval operator*(const sivector& v1, const srmatrix_subv& v2) {
03673   return v1 * srvector(v2);
03674 }
03675 
03676 inline interval operator*(const srvector& v1, const simatrix_subv& v2) {
03677   return v1 * sivector(v2);
03678 }
03679 
03680 inline interval operator*(const sivector& v1, const simatrix_subv& v2) {
03681   return v1 * sivector(v2);
03682 }
03683 
03684 inline interval operator*(const sivector_slice& v1, const srmatrix_subv& v2) {
03685   return v1 * srvector(v2);
03686 }
03687 
03688 inline interval operator*(const srvector_slice& v1, const simatrix_subv& v2) {
03689   return v1 * sivector(v2);
03690 }
03691 
03692 inline interval operator*(const sivector_slice& v1, const simatrix_subv& v2) {
03693   return v1 * sivector(v2);
03694 }
03695 
03696 inline interval operator*(const ivector& v1, const srmatrix_subv& v2) {
03697   return v1 * srvector(v2);
03698 }
03699 
03700 inline interval operator*(const rvector& v1, const simatrix_subv& v2) {
03701   return v1 * sivector(v2);
03702 }
03703 
03704 inline interval operator*(const ivector& v1, const simatrix_subv& v2) {
03705   return v1 * sivector(v2);
03706 }
03707 
03708 inline interval operator*(const ivector_slice& v1, const srmatrix_subv& v2) {
03709   return v1 * srvector(v2);
03710 }
03711 
03712 inline interval operator*(const rvector_slice& v1, const simatrix_subv& v2) {
03713   return v1 * sivector(v2);
03714 }
03715 
03716 inline interval operator*(const ivector_slice& v1, const simatrix_subv& v2) {
03717   return v1 * sivector(v2);
03718 }
03719 
03720 inline sivector operator+(const simatrix_subv& v1, const srvector& v2) {
03721   return sivector(v1) + v2;
03722 }
03723 
03724 inline sivector operator+(const srmatrix_subv& v1, const sivector& v2) {
03725   return srvector(v1) + v2;
03726 }
03727 
03728 inline sivector operator+(const simatrix_subv& v1, const sivector& v2) {
03729   return sivector(v1) + v2;
03730 }
03731 
03732 inline sivector operator+(const simatrix_subv& v1, const srvector_slice& v2) {
03733   return sivector(v1) + v2;
03734 }
03735 
03736 inline sivector operator+(const srmatrix_subv& v1, const sivector_slice& v2) {
03737   return srvector(v1) + v2;
03738 }
03739 
03740 inline sivector operator+(const simatrix_subv& v1, const sivector_slice& v2) {
03741   return sivector(v1) + v2;
03742 }
03743 
03744 inline ivector operator+(const simatrix_subv& v1, const rvector& v2) {
03745   return sivector(v1) + v2;
03746 }
03747 
03748 inline ivector operator+(const srmatrix_subv& v1, const ivector& v2) {
03749   return srvector(v1) + v2;
03750 }
03751 
03752 inline ivector operator+(const simatrix_subv& v1, const ivector& v2) {
03753   return sivector(v1) + v2;
03754 }
03755 
03756 inline ivector operator+(const simatrix_subv& v1, const rvector_slice& v2) {
03757   return sivector(v1) + v2;
03758 }
03759 
03760 inline ivector operator+(const srmatrix_subv& v1, const ivector_slice& v2) {
03761   return srvector(v1) + v2;
03762 }
03763 
03764 inline ivector operator+(const simatrix_subv& v1, const ivector_slice& v2) {
03765   return sivector(v1) + v2;
03766 }
03767 
03768 inline sivector operator+(const sivector& v1, const srmatrix_subv& v2) {
03769   return v1 + srvector(v2);
03770 }
03771 
03772 inline sivector operator+(const srvector& v1, const simatrix_subv& v2) {
03773   return v1 + sivector(v2);
03774 }
03775 
03776 inline sivector operator+(const sivector& v1, const simatrix_subv& v2) {
03777   return v1 + sivector(v2);
03778 }
03779 
03780 inline sivector operator+(const sivector_slice& v1, const srmatrix_subv& v2) {
03781   return v1 + srvector(v2);
03782 }
03783 
03784 inline sivector operator+(const srvector_slice& v1, const simatrix_subv& v2) {
03785   return v1 + sivector(v2);
03786 }
03787 
03788 inline sivector operator+(const sivector_slice& v1, const simatrix_subv& v2) {
03789   return v1 + sivector(v2);
03790 }
03791 
03792 inline ivector operator+(const ivector& v1, const srmatrix_subv& v2) {
03793   return v1 + srvector(v2);
03794 }
03795 
03796 inline ivector operator+(const rvector& v1, const simatrix_subv& v2) {
03797   return v1 + sivector(v2);
03798 }
03799 
03800 inline ivector operator+(const ivector& v1, const simatrix_subv& v2) {
03801   return v1 + sivector(v2);
03802 }
03803 
03804 inline ivector operator+(const ivector_slice& v1, const srmatrix_subv& v2) {
03805   return v1 + srvector(v2);
03806 }
03807 
03808 inline ivector operator+(const rvector_slice& v1, const simatrix_subv& v2) {
03809   return v1 + sivector(v2);
03810 }
03811 
03812 inline ivector operator+(const ivector_slice& v1, const simatrix_subv& v2) {
03813   return v1 + sivector(v2);
03814 }
03815 
03816 inline sivector operator-(const simatrix_subv& v1, const srvector& v2) {
03817   return sivector(v1) - v2;
03818 }
03819 
03820 inline sivector operator-(const srmatrix_subv& v1, const sivector& v2) {
03821   return srvector(v1) - v2;
03822 }
03823 
03824 inline sivector operator-(const simatrix_subv& v1, const sivector& v2) {
03825   return sivector(v1) - v2;
03826 }
03827 
03828 inline sivector operator-(const simatrix_subv& v1, const srvector_slice& v2) {
03829   return sivector(v1) - v2;
03830 }
03831 
03832 inline sivector operator-(const srmatrix_subv& v1, const sivector_slice& v2) {
03833   return srvector(v1) - v2;
03834 }
03835 
03836 inline sivector operator-(const simatrix_subv& v1, const sivector_slice& v2) {
03837   return sivector(v1) - v2;
03838 }
03839 
03840 inline ivector operator-(const simatrix_subv& v1, const rvector& v2) {
03841   return sivector(v1) - v2;
03842 }
03843 
03844 inline ivector operator-(const srmatrix_subv& v1, const ivector& v2) {
03845   return srvector(v1) - v2;
03846 }
03847 
03848 inline ivector operator-(const simatrix_subv& v1, const ivector& v2) {
03849   return sivector(v1) - v2;
03850 }
03851 
03852 inline ivector operator-(const simatrix_subv& v1, const rvector_slice& v2) {
03853   return sivector(v1) - v2;
03854 }
03855 
03856 inline ivector operator-(const srmatrix_subv& v1, const ivector_slice& v2) {
03857   return srvector(v1) - v2;
03858 }
03859 
03860 inline ivector operator-(const simatrix_subv& v1, const ivector_slice& v2) {
03861   return sivector(v1) - v2;
03862 }
03863 
03864 inline sivector operator-(const sivector& v1, const srmatrix_subv& v2) {
03865   return v1 - srvector(v2);
03866 }
03867 
03868 inline sivector operator-(const srvector& v1, const simatrix_subv& v2) {
03869   return v1 - sivector(v2);
03870 }
03871 
03872 inline sivector operator-(const sivector& v1, const simatrix_subv& v2) {
03873   return v1 - sivector(v2);
03874 }
03875 
03876 inline sivector operator-(const sivector_slice& v1, const srmatrix_subv& v2) {
03877   return v1 - srvector(v2);
03878 }
03879 
03880 inline sivector operator-(const srvector_slice& v1, const simatrix_subv& v2) {
03881   return v1 - sivector(v2);
03882 }
03883 
03884 inline sivector operator-(const sivector_slice& v1, const simatrix_subv& v2) {
03885   return v1 - sivector(v2);
03886 }
03887 
03888 inline ivector operator-(const ivector& v1, const srmatrix_subv& v2) {
03889   return v1 - srvector(v2);
03890 }
03891 
03892 inline ivector operator-(const rvector& v1, const simatrix_subv& v2) {
03893   return v1 - sivector(v2);
03894 }
03895 
03896 inline ivector operator-(const ivector& v1, const simatrix_subv& v2) {
03897   return v1 - sivector(v2);
03898 }
03899 
03900 inline ivector operator-(const ivector_slice& v1, const srmatrix_subv& v2) {
03901   return v1 - srvector(v2);
03902 }
03903 
03904 inline ivector operator-(const rvector_slice& v1, const simatrix_subv& v2) {
03905   return v1 - sivector(v2);
03906 }
03907 
03908 inline ivector operator-(const ivector_slice& v1, const simatrix_subv& v2) {
03909   return v1 - sivector(v2);
03910 }
03911 
03912 inline sivector operator|(const simatrix_subv& v1, const srvector& v2) {
03913   return sivector(v1) | v2;
03914 }
03915 
03916 inline sivector operator|(const srmatrix_subv& v1, const sivector& v2) {
03917   return srvector(v1) | v2;
03918 }
03919 
03920 inline sivector operator|(const simatrix_subv& v1, const sivector& v2) {
03921   return sivector(v1) | v2;
03922 }
03923 
03924 inline sivector operator|(const simatrix_subv& v1, const srvector_slice& v2) {
03925   return sivector(v1) | v2;
03926 }
03927 
03928 inline sivector operator|(const srmatrix_subv& v1, const sivector_slice& v2) {
03929   return srvector(v1) | v2;
03930 }
03931 
03932 inline sivector operator|(const simatrix_subv& v1, const sivector_slice& v2) {
03933   return sivector(v1) | v2;
03934 }
03935 
03936 inline ivector operator|(const simatrix_subv& v1, const rvector& v2) {
03937   return sivector(v1) | v2;
03938 }
03939 
03940 inline ivector operator|(const srmatrix_subv& v1, const ivector& v2) {
03941   return srvector(v1) | v2;
03942 }
03943 
03944 inline ivector operator|(const simatrix_subv& v1, const ivector& v2) {
03945   return sivector(v1) | v2;
03946 }
03947 
03948 inline ivector operator|(const simatrix_subv& v1, const rvector_slice& v2) {
03949   return sivector(v1) | v2;
03950 }
03951 
03952 inline ivector operator|(const srmatrix_subv& v1, const ivector_slice& v2) {
03953   return srvector(v1) | v2;
03954 }
03955 
03956 inline ivector operator|(const simatrix_subv& v1, const ivector_slice& v2) {
03957   return sivector(v1) | v2;
03958 }
03959 
03960 inline sivector operator|(const sivector& v1, const srmatrix_subv& v2) {
03961   return v1 | srvector(v2);
03962 }
03963 
03964 inline sivector operator|(const srvector& v1, const simatrix_subv& v2) {
03965   return v1 | sivector(v2);
03966 }
03967 
03968 inline sivector operator|(const sivector& v1, const simatrix_subv& v2) {
03969   return v1 | sivector(v2);
03970 }
03971 
03972 inline sivector operator|(const sivector_slice& v1, const srmatrix_subv& v2) {
03973   return v1 | srvector(v2);
03974 }
03975 
03976 inline sivector operator|(const srvector_slice& v1, const simatrix_subv& v2) {
03977   return v1 | sivector(v2);
03978 }
03979 
03980 inline sivector operator|(const sivector_slice& v1, const simatrix_subv& v2) {
03981   return v1 | sivector(v2);
03982 }
03983 
03984 inline ivector operator|(const ivector& v1, const srmatrix_subv& v2) {
03985   return v1 | srvector(v2);
03986 }
03987 
03988 inline ivector operator|(const rvector& v1, const simatrix_subv& v2) {
03989   return v1 | sivector(v2);
03990 }
03991 
03992 inline ivector operator|(const ivector& v1, const simatrix_subv& v2) {
03993   return v1 | sivector(v2);
03994 }
03995 
03996 inline ivector operator|(const ivector_slice& v1, const srmatrix_subv& v2) {
03997   return v1 | srvector(v2);
03998 }
03999 
04000 inline ivector operator|(const rvector_slice& v1, const simatrix_subv& v2) {
04001   return v1 | sivector(v2);
04002 }
04003 
04004 inline ivector operator|(const ivector_slice& v1, const simatrix_subv& v2) {
04005   return v1 | sivector(v2);
04006 }
04007 
04008 inline sivector operator|(const srmatrix_subv& v1, const srvector& v2) {
04009   return srvector(v1) | v2;
04010 }
04011 
04012 inline sivector operator|(const srmatrix_subv& v1, const srvector_slice& v2) {
04013   return srvector(v1) | v2;
04014 }
04015 
04016 inline ivector operator|(const srmatrix_subv& v1, const rvector& v2) {
04017   return srvector(v1) | v2;
04018 }
04019 
04020 inline ivector operator|(const srmatrix_subv& v1, const rvector_slice& v2) {
04021   return srvector(v1) | v2;
04022 }
04023 
04024 inline sivector operator|(const srvector& v1, const srmatrix_subv& v2) {
04025   return v1 | srvector(v2);
04026 }
04027 
04028 inline sivector operator|(const srvector_slice& v1, const srmatrix_subv& v2) {
04029   return v1 | srvector(v2);
04030 }
04031 
04032 inline ivector operator|(const rvector& v1, const srmatrix_subv& v2) {
04033   return v1 | srvector(v2);
04034 }
04035 
04036 inline ivector operator|(const rvector_slice& v1, const srmatrix_subv& v2) {
04037   return v1 | srvector(v2);
04038 }
04039 
04040 inline simatrix_subv& simatrix_subv::operator*=(const real& v) {
04041   *this = *this * v;
04042   return *this;
04043 }
04044 
04045 inline simatrix_subv& simatrix_subv::operator*=(const interval& v) {
04046   *this = *this * v;
04047   return *this;
04048 }
04049 
04050 inline simatrix_subv& simatrix_subv::operator/=(const real& v) {
04051   *this = *this / v;
04052   return *this;
04053 }
04054 
04055 inline simatrix_subv& simatrix_subv::operator/=(const interval& v) {
04056   *this = *this / v;
04057   return *this;
04058 }
04059 
04060 inline simatrix_subv& simatrix_subv::operator+=(const srvector& v) {
04061   *this = *this + v;
04062   return *this;
04063 }
04064 
04065 inline simatrix_subv& simatrix_subv::operator+=(const srvector_slice& v) {
04066   *this = *this + v;
04067   return *this;
04068 }
04069 
04070 inline simatrix_subv& simatrix_subv::operator+=(const rvector& v) {
04071   *this = *this + v;
04072   return *this;
04073 }
04074 
04075 inline simatrix_subv& simatrix_subv::operator+=(const rvector_slice& v) {
04076   *this = *this + v;
04077   return *this;
04078 }
04079 
04080 inline simatrix_subv& simatrix_subv::operator-=(const srvector& v) {
04081   *this = *this - v;
04082   return *this;
04083 }
04084 
04085 inline simatrix_subv& simatrix_subv::operator-=(const srvector_slice& v) {
04086   *this = *this - v;
04087   return *this;
04088 }
04089 
04090 inline simatrix_subv& simatrix_subv::operator-=(const rvector& v) {
04091   *this = *this - v;
04092   return *this;
04093 }
04094 
04095 inline simatrix_subv& simatrix_subv::operator-=(const rvector_slice& v) {
04096   *this = *this - v;
04097   return *this;
04098 }
04099 
04100 inline simatrix_subv& simatrix_subv::operator+=(const sivector& v) {
04101   *this = *this + v;
04102   return *this;
04103 }
04104 
04105 inline simatrix_subv& simatrix_subv::operator+=(const sivector_slice& v) {
04106   *this = *this + v;
04107   return *this;
04108 }
04109 
04110 inline simatrix_subv& simatrix_subv::operator+=(const ivector& v) {
04111   *this = *this + v;
04112   return *this;
04113 }
04114 
04115 inline simatrix_subv& simatrix_subv::operator+=(const ivector_slice& v) {
04116   *this = *this + v;
04117   return *this;
04118 }
04119 
04120 inline simatrix_subv& simatrix_subv::operator-=(const sivector& v) {
04121   *this = *this - v;
04122   return *this;
04123 }
04124 
04125 inline simatrix_subv& simatrix_subv::operator-=(const sivector_slice& v) {
04126   *this = *this - v;
04127   return *this;
04128 }
04129 
04130 inline simatrix_subv& simatrix_subv::operator-=(const ivector& v) {
04131   *this = *this - v;
04132   return *this;
04133 }
04134 
04135 inline simatrix_subv& simatrix_subv::operator-=(const ivector_slice& v) {
04136   *this = *this - v;
04137   return *this;
04138 }
04139 
04140 inline simatrix_subv& simatrix_subv::operator|=(const srvector& v) {
04141   *this = *this | v;
04142   return *this;
04143 }
04144 
04145 inline simatrix_subv& simatrix_subv::operator|=(const srvector_slice& v) {
04146   *this = *this | v;
04147   return *this;
04148 }
04149 
04150 inline simatrix_subv& simatrix_subv::operator|=(const rvector& v) {
04151   *this = *this | v;
04152   return *this;
04153 }
04154 
04155 inline simatrix_subv& simatrix_subv::operator|=(const rvector_slice& v) {
04156   *this = *this | v;
04157   return *this;
04158 }
04159 
04160 inline simatrix_subv& simatrix_subv::operator|=(const sivector& v) {
04161   *this = *this | v;
04162   return *this;
04163 }
04164 
04165 inline simatrix_subv& simatrix_subv::operator|=(const sivector_slice& v) {
04166   *this = *this | v;
04167   return *this;
04168 }
04169 
04170 inline simatrix_subv& simatrix_subv::operator|=(const ivector& v) {
04171   *this = *this | v;
04172   return *this;
04173 }
04174 
04175 inline simatrix_subv& simatrix_subv::operator|=(const ivector_slice& v) {
04176   *this = *this | v;
04177   return *this;
04178 }
04179 
04180 inline imatrix_subv& imatrix_subv::operator+=(const srmatrix_subv& v) {
04181   *this += rvector(v);
04182   return *this;
04183 }
04184 
04185 inline imatrix_subv& imatrix_subv::operator+=(const simatrix_subv& v) {
04186   *this += ivector(v);
04187   return *this;
04188 }
04189 
04190 inline imatrix_subv& imatrix_subv::operator+=(const srvector& v) {
04191   *this += rvector(v);
04192   return *this;
04193 }
04194 
04195 inline imatrix_subv& imatrix_subv::operator+=(const sivector& v) {
04196   *this += ivector(v);
04197   return *this;
04198 }
04199 
04200 inline imatrix_subv& imatrix_subv::operator+=(const srvector_slice& v) {
04201   *this += rvector(v);
04202   return *this;
04203 }
04204 
04205 inline imatrix_subv& imatrix_subv::operator+=(const sivector_slice& v) {
04206   *this += ivector(v);
04207   return *this;
04208 }
04209 
04210 inline imatrix_subv& imatrix_subv::operator-=(const srmatrix_subv& v) {
04211   *this -= rvector(v);
04212   return *this;
04213 }
04214 
04215 inline imatrix_subv& imatrix_subv::operator-=(const simatrix_subv& v) {
04216   *this -= ivector(v);
04217   return *this;
04218 }
04219 
04220 inline imatrix_subv& imatrix_subv::operator-=(const srvector& v) {
04221   *this -= rvector(v);
04222   return *this;
04223 }
04224 
04225 inline imatrix_subv& imatrix_subv::operator-=(const sivector& v) {
04226   *this -= ivector(v);
04227   return *this;
04228 }
04229 
04230 inline imatrix_subv& imatrix_subv::operator-=(const srvector_slice& v) {
04231   *this -= rvector(v);
04232   return *this;
04233 }
04234 
04235 inline imatrix_subv& imatrix_subv::operator-=(const sivector_slice& v) {
04236   *this -= ivector(v);
04237   return *this;
04238 }
04239 
04240 inline imatrix_subv& imatrix_subv::operator|=(const srmatrix_subv& v) {
04241   *this |= rvector(v);
04242   return *this;
04243 }
04244 
04245 inline imatrix_subv& imatrix_subv::operator|=(const simatrix_subv& v) {
04246   *this |= ivector(v);
04247   return *this;
04248 }
04249 
04250 inline imatrix_subv& imatrix_subv::operator|=(const srvector& v) {
04251   *this |= rvector(v);
04252   return *this;
04253 }
04254 
04255 inline imatrix_subv& imatrix_subv::operator|=(const sivector& v) {
04256   *this |= ivector(v);
04257   return *this;
04258 }
04259 
04260 inline imatrix_subv& imatrix_subv::operator|=(const srvector_slice& v) {
04261   *this |= rvector(v);
04262   return *this;
04263 }
04264 
04265 inline imatrix_subv& imatrix_subv::operator|=(const sivector_slice& v) {
04266   *this |= ivector(v);
04267   return *this;
04268 }
04269 
04270 inline imatrix_subv& imatrix_subv::operator&=(const srmatrix_subv& v) {
04271   *this &= rvector(v);
04272   return *this;
04273 }
04274 
04275 inline imatrix_subv& imatrix_subv::operator&=(const simatrix_subv& v) {
04276   *this &= ivector(v);
04277   return *this;
04278 }
04279 
04280 inline imatrix_subv& imatrix_subv::operator&=(const srvector& v) {
04281   *this &= rvector(v);
04282   return *this;
04283 }
04284 
04285 inline imatrix_subv& imatrix_subv::operator&=(const sivector& v) {
04286   *this &= ivector(v);
04287   return *this;
04288 }
04289 
04290 inline imatrix_subv& imatrix_subv::operator&=(const srvector_slice& v) {
04291   *this &= rvector(v);
04292   return *this;
04293 }
04294 
04295 inline imatrix_subv& imatrix_subv::operator&=(const sivector_slice& v) {
04296   *this &= ivector(v);
04297   return *this;
04298 }
04299 
04300 inline imatrix_subv& imatrix_subv::operator=(const srvector& v) {
04301   *this = rvector(v);
04302   return *this;
04303 }
04304 
04305 inline imatrix_subv& imatrix_subv::operator=(const sivector& v) {
04306   *this = ivector(v);
04307   return *this;
04308 }
04309 
04310 inline imatrix_subv& imatrix_subv::operator=(const srvector_slice& v) {
04311   *this = rvector(v);
04312   return *this;
04313 }
04314 
04315 inline imatrix_subv& imatrix_subv::operator=(const sivector_slice& v) {
04316   *this = ivector(v);
04317   return *this;
04318 }
04319 
04320 inline imatrix_subv& imatrix_subv::operator=(const srmatrix_subv& v) {
04321   *this = rvector(v);
04322   return *this;
04323 }
04324 
04325 inline imatrix_subv& imatrix_subv::operator=(const simatrix_subv& v) {
04326   *this = ivector(v);
04327   return *this;
04328 }
04329 
04330 inline bool operator==(const simatrix_subv& v1, const srvector& v2) {
04331   return sivector(v1) == v2;
04332 }
04333 
04334 inline bool operator==(const srmatrix_subv& v1, const sivector& v2) {
04335   return srvector(v1) == v2;
04336 }
04337 
04338 inline bool operator==(const simatrix_subv& v1, const sivector& v2) {
04339   return sivector(v1) == v2;
04340 }
04341 
04342 inline bool operator==(const simatrix_subv& v1, const srvector_slice& v2) {
04343   return sivector(v1) == v2;
04344 }
04345 
04346 inline bool operator==(const srmatrix_subv& v1, const sivector_slice& v2) {
04347   return srvector(v1) == v2;
04348 }
04349 
04350 inline bool operator==(const simatrix_subv& v1, const sivector_slice& v2) {
04351   return sivector(v1) == v2;
04352 }
04353 
04354 inline bool operator==(const simatrix_subv& v1, const rvector& v2) {
04355   return sivector(v1) == v2;
04356 }
04357 
04358 inline bool operator==(const srmatrix_subv& v1, const ivector& v2) {
04359   return srvector(v1) == v2;
04360 }
04361 
04362 inline bool operator==(const simatrix_subv& v1, const ivector& v2) {
04363   return sivector(v1) == v2;
04364 }
04365 
04366 inline bool operator==(const simatrix_subv& v1, const rvector_slice& v2) {
04367   return sivector(v1) == v2;
04368 }
04369 
04370 inline bool operator==(const srmatrix_subv& v1, const ivector_slice& v2) {
04371   return srvector(v1) == v2;
04372 }
04373 
04374 inline bool operator==(const simatrix_subv& v1, const ivector_slice& v2) {
04375   return sivector(v1) == v2;
04376 }
04377 
04378 inline bool operator==(const sivector& v1, const srmatrix_subv& v2) {
04379   return v1 == srvector(v2);
04380 }
04381 
04382 inline bool operator==(const srvector& v1, const simatrix_subv& v2) {
04383   return v1 == sivector(v2);
04384 }
04385 
04386 inline bool operator==(const sivector& v1, const simatrix_subv& v2) {
04387   return v1 == sivector(v2);
04388 }
04389 
04390 inline bool operator==(const sivector_slice& v1, const srmatrix_subv& v2) {
04391   return v1 == srvector(v2);
04392 }
04393 
04394 inline bool operator==(const srvector_slice& v1, const simatrix_subv& v2) {
04395   return v1 == sivector(v2);
04396 }
04397 
04398 inline bool operator==(const sivector_slice& v1, const simatrix_subv& v2) {
04399   return v1 == sivector(v2);
04400 }
04401 
04402 inline bool operator==(const ivector& v1, const srmatrix_subv& v2) {
04403   return v1 == srvector(v2);
04404 }
04405 
04406 inline bool operator==(const rvector& v1, const simatrix_subv& v2) {
04407   return v1 == sivector(v2);
04408 }
04409 
04410 inline bool operator==(const ivector& v1, const simatrix_subv& v2) {
04411   return v1 == sivector(v2);
04412 }
04413 
04414 inline bool operator==(const ivector_slice& v1, const srmatrix_subv& v2) {
04415   return v1 == srvector(v2);
04416 }
04417 
04418 inline bool operator==(const rvector_slice& v1, const simatrix_subv& v2) {
04419   return v1 == sivector(v2);
04420 }
04421 
04422 inline bool operator==(const ivector_slice& v1, const simatrix_subv& v2) {
04423   return v1 == sivector(v2);
04424 }
04425 
04426 inline bool operator!=(const simatrix_subv& v1, const srvector& v2) {
04427   return sivector(v1) != v2;
04428 }
04429 
04430 inline bool operator!=(const srmatrix_subv& v1, const sivector& v2) {
04431   return srvector(v1) != v2;
04432 }
04433 
04434 inline bool operator!=(const simatrix_subv& v1, const sivector& v2) {
04435   return sivector(v1) != v2;
04436 }
04437 
04438 inline bool operator!=(const simatrix_subv& v1, const srvector_slice& v2) {
04439   return sivector(v1) != v2;
04440 }
04441 
04442 inline bool operator!=(const srmatrix_subv& v1, const sivector_slice& v2) {
04443   return srvector(v1) != v2;
04444 }
04445 
04446 inline bool operator!=(const simatrix_subv& v1, const sivector_slice& v2) {
04447   return sivector(v1) != v2;
04448 }
04449 
04450 inline bool operator!=(const simatrix_subv& v1, const rvector& v2) {
04451   return sivector(v1) != v2;
04452 }
04453 
04454 inline bool operator!=(const srmatrix_subv& v1, const ivector& v2) {
04455   return srvector(v1) != v2;
04456 }
04457 
04458 inline bool operator!=(const simatrix_subv& v1, const ivector& v2) {
04459   return sivector(v1) != v2;
04460 }
04461 
04462 inline bool operator!=(const simatrix_subv& v1, const rvector_slice& v2) {
04463   return sivector(v1) != v2;
04464 }
04465 
04466 inline bool operator!=(const srmatrix_subv& v1, const ivector_slice& v2) {
04467   return srvector(v1) != v2;
04468 }
04469 
04470 inline bool operator!=(const simatrix_subv& v1, const ivector_slice& v2) {
04471   return sivector(v1) != v2;
04472 }
04473 
04474 inline bool operator!=(const sivector& v1, const srmatrix_subv& v2) {
04475   return v1 != srvector(v2);
04476 }
04477 
04478 inline bool operator!=(const srvector& v1, const simatrix_subv& v2) {
04479   return v1 != sivector(v2);
04480 }
04481 
04482 inline bool operator!=(const sivector& v1, const simatrix_subv& v2) {
04483   return v1 != sivector(v2);
04484 }
04485 
04486 inline bool operator!=(const sivector_slice& v1, const srmatrix_subv& v2) {
04487   return v1 != srvector(v2);
04488 }
04489 
04490 inline bool operator!=(const srvector_slice& v1, const simatrix_subv& v2) {
04491   return v1 != sivector(v2);
04492 }
04493 
04494 inline bool operator!=(const sivector_slice& v1, const simatrix_subv& v2) {
04495   return v1 != sivector(v2);
04496 }
04497 
04498 inline bool operator!=(const ivector& v1, const srmatrix_subv& v2) {
04499   return v1 != srvector(v2);
04500 }
04501 
04502 inline bool operator!=(const rvector& v1, const simatrix_subv& v2) {
04503   return v1 != sivector(v2);
04504 }
04505 
04506 inline bool operator!=(const ivector& v1, const simatrix_subv& v2) {
04507   return v1 != sivector(v2);
04508 }
04509 
04510 inline bool operator!=(const ivector_slice& v1, const srmatrix_subv& v2) {
04511   return v1 != srvector(v2);
04512 }
04513 
04514 inline bool operator!=(const rvector_slice& v1, const simatrix_subv& v2) {
04515   return v1 != sivector(v2);
04516 }
04517 
04518 inline bool operator!=(const ivector_slice& v1, const simatrix_subv& v2) {
04519   return v1 != sivector(v2);
04520 }
04521 
04522 inline bool operator<(const srmatrix_subv& v1, const sivector& v2) {
04523   return srvector(v1) < v2;
04524 }
04525 
04526 inline bool operator<(const simatrix_subv& v1, const sivector& v2) {
04527   return sivector(v1) < v2;
04528 }
04529 
04530 inline bool operator<(const srmatrix_subv& v1, const sivector_slice& v2) {
04531   return srvector(v1) < v2;
04532 }
04533 
04534 inline bool operator<(const simatrix_subv& v1, const sivector_slice& v2) {
04535   return sivector(v1) < v2;
04536 }
04537 
04538 inline bool operator<(const srmatrix_subv& v1, const ivector& v2) {
04539   return srvector(v1) < v2;
04540 }
04541 
04542 inline bool operator<(const simatrix_subv& v1, const ivector& v2) {
04543   return sivector(v1) < v2;
04544 }
04545 
04546 inline bool operator<(const srmatrix_subv& v1, const ivector_slice& v2) {
04547   return srvector(v1) < v2;
04548 }
04549 
04550 inline bool operator<(const simatrix_subv& v1, const ivector_slice& v2) {
04551   return sivector(v1) < v2;
04552 }
04553 
04554 inline bool operator<(const srvector& v1, const simatrix_subv& v2) {
04555   return v1 < sivector(v2);
04556 }
04557 
04558 inline bool operator<(const sivector& v1, const simatrix_subv& v2) {
04559   return v1 < sivector(v2);
04560 }
04561 
04562 inline bool operator<(const srvector_slice& v1, const simatrix_subv& v2) {
04563   return v1 < sivector(v2);
04564 }
04565 
04566 inline bool operator<(const sivector_slice& v1, const simatrix_subv& v2) {
04567   return v1 < sivector(v2);
04568 }
04569 
04570 inline bool operator<(const rvector& v1, const simatrix_subv& v2) {
04571   return v1 < sivector(v2);
04572 }
04573 
04574 inline bool operator<(const ivector& v1, const simatrix_subv& v2) {
04575   return v1 < sivector(v2);
04576 }
04577 
04578 inline bool operator<(const rvector_slice& v1, const simatrix_subv& v2) {
04579   return v1 < sivector(v2);
04580 }
04581 
04582 inline bool operator<(const ivector_slice& v1, const simatrix_subv& v2) {
04583   return v1 < sivector(v2);
04584 }
04585 
04586 inline bool operator<=(const srmatrix_subv& v1, const sivector& v2) {
04587   return srvector(v1) <= v2;
04588 }
04589 
04590 inline bool operator<=(const simatrix_subv& v1, const sivector& v2) {
04591   return sivector(v1) <= v2;
04592 }
04593 
04594 inline bool operator<=(const srmatrix_subv& v1, const sivector_slice& v2) {
04595   return srvector(v1) <= v2;
04596 }
04597 
04598 inline bool operator<=(const simatrix_subv& v1, const sivector_slice& v2) {
04599   return sivector(v1) <= v2;
04600 }
04601 
04602 inline bool operator<=(const srmatrix_subv& v1, const ivector& v2) {
04603   return srvector(v1) <= v2;
04604 }
04605 
04606 inline bool operator<=(const simatrix_subv& v1, const ivector& v2) {
04607   return sivector(v1) <= v2;
04608 }
04609 
04610 inline bool operator<=(const srmatrix_subv& v1, const ivector_slice& v2) {
04611   return srvector(v1) <= v2;
04612 }
04613 
04614 inline bool operator<=(const simatrix_subv& v1, const ivector_slice& v2) {
04615   return sivector(v1) <= v2;
04616 }
04617 
04618 inline bool operator<=(const srvector& v1, const simatrix_subv& v2) {
04619   return v1 <= sivector(v2);
04620 }
04621 
04622 inline bool operator<=(const sivector& v1, const simatrix_subv& v2) {
04623   return v1 <= sivector(v2);
04624 }
04625 
04626 inline bool operator<=(const srvector_slice& v1, const simatrix_subv& v2) {
04627   return v1 <= sivector(v2);
04628 }
04629 
04630 inline bool operator<=(const sivector_slice& v1, const simatrix_subv& v2) {
04631   return v1 <= sivector(v2);
04632 }
04633 
04634 inline bool operator<=(const rvector& v1, const simatrix_subv& v2) {
04635   return v1 <= sivector(v2);
04636 }
04637 
04638 inline bool operator<=(const ivector& v1, const simatrix_subv& v2) {
04639   return v1 <= sivector(v2);
04640 }
04641 
04642 inline bool operator<=(const rvector_slice& v1, const simatrix_subv& v2) {
04643   return v1 <= sivector(v2);
04644 }
04645 
04646 inline bool operator<=(const ivector_slice& v1, const simatrix_subv& v2) {
04647   return v1 <= sivector(v2);
04648 }
04649 
04650 inline bool operator>(const simatrix_subv& v1, const srvector& v2) {
04651   return sivector(v1) > v2;
04652 }
04653 
04654 inline bool operator>(const simatrix_subv& v1, const sivector& v2) {
04655   return sivector(v1) > v2;
04656 }
04657 
04658 inline bool operator>(const simatrix_subv& v1, const srvector_slice& v2) {
04659   return sivector(v1) > v2;
04660 }
04661 
04662 inline bool operator>(const simatrix_subv& v1, const sivector_slice& v2) {
04663   return sivector(v1) > v2;
04664 }
04665 
04666 inline bool operator>(const simatrix_subv& v1, const rvector& v2) {
04667   return sivector(v1) > v2;
04668 }
04669 
04670 inline bool operator>(const simatrix_subv& v1, const ivector& v2) {
04671   return sivector(v1) > v2;
04672 }
04673 
04674 inline bool operator>(const simatrix_subv& v1, const rvector_slice& v2) {
04675   return sivector(v1) > v2;
04676 }
04677 
04678 inline bool operator>(const simatrix_subv& v1, const ivector_slice& v2) {
04679   return sivector(v1) > v2;
04680 }
04681 
04682 inline bool operator>(const sivector& v1, const srmatrix_subv& v2) {
04683   return v1 > srvector(v2);
04684 }
04685 
04686 inline bool operator>(const sivector& v1, const simatrix_subv& v2) {
04687   return v1 > sivector(v2);
04688 }
04689 
04690 inline bool operator>(const sivector_slice& v1, const srmatrix_subv& v2) {
04691   return v1 > srvector(v2);
04692 }
04693 
04694 inline bool operator>(const sivector_slice& v1, const simatrix_subv& v2) {
04695   return v1 > sivector(v2);
04696 }
04697 
04698 inline bool operator>(const ivector& v1, const srmatrix_subv& v2) {
04699   return v1 > srvector(v2);
04700 }
04701 
04702 inline bool operator>(const ivector& v1, const simatrix_subv& v2) {
04703   return v1 > sivector(v2);
04704 }
04705 
04706 inline bool operator>(const ivector_slice& v1, const srmatrix_subv& v2) {
04707   return v1 > srvector(v2);
04708 }
04709 
04710 inline bool operator>(const ivector_slice& v1, const simatrix_subv& v2) {
04711   return v1 > sivector(v2);
04712 }
04713 
04714 inline bool operator>=(const simatrix_subv& v1, const srvector& v2) {
04715   return sivector(v1) >= v2;
04716 }
04717 
04718 inline bool operator>=(const simatrix_subv& v1, const sivector& v2) {
04719   return sivector(v1) >= v2;
04720 }
04721 
04722 inline bool operator>=(const simatrix_subv& v1, const srvector_slice& v2) {
04723   return sivector(v1) >= v2;
04724 }
04725 
04726 inline bool operator>=(const simatrix_subv& v1, const sivector_slice& v2) {
04727   return sivector(v1) >= v2;
04728 }
04729 
04730 inline bool operator>=(const simatrix_subv& v1, const rvector& v2) {
04731   return sivector(v1) >= v2;
04732 }
04733 
04734 inline bool operator>=(const simatrix_subv& v1, const ivector& v2) {
04735   return sivector(v1) >= v2;
04736 }
04737 
04738 inline bool operator>=(const simatrix_subv& v1, const rvector_slice& v2) {
04739   return sivector(v1) >= v2;
04740 }
04741 
04742 inline bool operator>=(const simatrix_subv& v1, const ivector_slice& v2) {
04743   return sivector(v1) >= v2;
04744 }
04745 
04746 inline bool operator>=(const sivector& v1, const srmatrix_subv& v2) {
04747   return v1 >= srvector(v2);
04748 }
04749 
04750 inline bool operator>=(const sivector& v1, const simatrix_subv& v2) {
04751   return v1 >= sivector(v2);
04752 }
04753 
04754 inline bool operator>=(const sivector_slice& v1, const srmatrix_subv& v2) {
04755   return v1 >= srvector(v2);
04756 }
04757 
04758 inline bool operator>=(const sivector_slice& v1, const simatrix_subv& v2) {
04759   return v1 >= sivector(v2);
04760 }
04761 
04762 inline bool operator>=(const ivector& v1, const srmatrix_subv& v2) {
04763   return v1 >= srvector(v2);
04764 }
04765 
04766 inline bool operator>=(const ivector& v1, const simatrix_subv& v2) {
04767   return v1 >= sivector(v2);
04768 }
04769 
04770 inline bool operator>=(const ivector_slice& v1, const srmatrix_subv& v2) {
04771   return v1 >= srvector(v2);
04772 }
04773 
04774 inline bool operator>=(const ivector_slice& v1, const simatrix_subv& v2) {
04775   return v1 >= sivector(v2);
04776 }
04777 
04778 inline bool operator!(const simatrix_subv& x) {
04779   return sv_v_not(x);
04780 }
04781 
04782 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const simatrix_subv& v2) {
04783   spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, sivector(v1), sivector(v2));
04784 }
04785 
04786 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const srmatrix_subv& v2) {
04787   spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, sivector(v1), srvector(v2));
04788 }
04789 
04790 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const simatrix_subv& v2) {
04791   spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, srvector(v1), sivector(v2));
04792 }
04793 
04794 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const sivector& v2) {
04795   spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, sivector(v1), v2);
04796 }
04797 
04798 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const srvector& v2) {
04799   spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, sivector(v1), v2);
04800 }
04801 
04802 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const sivector& v2) {
04803   spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, srvector(v1), v2);
04804 }
04805 
04806 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const sivector_slice& v2) {
04807   spsl_vv_accu<idotprecision,sivector,sivector_slice,sparse_idot>(dot, sivector(v1), v2);
04808 }
04809 
04810 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const srvector_slice& v2) {
04811   spsl_vv_accu<idotprecision,sivector,srvector_slice,sparse_idot>(dot, sivector(v1), v2);
04812 }
04813 
04814 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const sivector_slice& v2) {
04815   spsl_vv_accu<idotprecision,srvector,sivector_slice,sparse_idot>(dot, srvector(v1), v2);
04816 }
04817 
04818 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const ivector& v2) {
04819   spf_vv_accu<idotprecision,sivector,ivector,sparse_idot>(dot, sivector(v1), v2);
04820 }
04821 
04822 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const rvector& v2) {
04823   spf_vv_accu<idotprecision,sivector,rvector,sparse_idot>(dot, sivector(v1), v2);
04824 }
04825 
04826 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const ivector& v2) {
04827   spf_vv_accu<idotprecision,srvector,ivector,sparse_idot>(dot, srvector(v1), v2);
04828 }
04829 
04830 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const ivector_slice& v2) {
04831   spf_vv_accu<idotprecision,sivector,ivector_slice,sparse_idot>(dot, sivector(v1), v2);
04832 }
04833 
04834 inline void accumulate(idotprecision& dot, const simatrix_subv& v1, const rvector_slice& v2) {
04835   spf_vv_accu<idotprecision,sivector,rvector_slice,sparse_idot>(dot, sivector(v1), v2);
04836 }
04837 
04838 inline void accumulate(idotprecision& dot, const srmatrix_subv& v1, const ivector_slice& v2) {
04839   spf_vv_accu<idotprecision,srvector,ivector_slice,sparse_idot>(dot, srvector(v1), v2);
04840 }
04841 
04842 inline void accumulate(idotprecision& dot, const sivector& v1, const simatrix_subv& v2) {
04843   spsp_vv_accu<idotprecision,sivector,sivector,sparse_idot>(dot, v1, sivector(v2));
04844 }
04845 
04846 inline void accumulate(idotprecision& dot, const sivector& v1, const srmatrix_subv& v2) {
04847   spsp_vv_accu<idotprecision,sivector,srvector,sparse_idot>(dot, v1, srvector(v2));
04848 }
04849 
04850 inline void accumulate(idotprecision& dot, const srvector& v1, const simatrix_subv& v2) {
04851   spsp_vv_accu<idotprecision,srvector,sivector,sparse_idot>(dot, v1, sivector(v2));
04852 }
04853 
04854 inline void accumulate(idotprecision& dot, const sivector_slice& v1, const simatrix_subv& v2) {
04855   slsp_vv_accu<idotprecision,sivector_slice,sivector,sparse_idot>(dot, v1, sivector(v2));
04856 }
04857 
04858 inline void accumulate(idotprecision& dot, const sivector_slice& v1, const srmatrix_subv& v2) {
04859   slsp_vv_accu<idotprecision,sivector_slice,srvector,sparse_idot>(dot, v1, srvector(v2));
04860 }
04861 
04862 inline void accumulate(idotprecision& dot, const srvector_slice& v1, const simatrix_subv& v2) {
04863   slsp_vv_accu<idotprecision,srvector_slice,sivector,sparse_idot>(dot, v1, sivector(v2));
04864 }
04865 
04866 inline void accumulate(idotprecision& dot, const ivector& v1, const simatrix_subv& v2) {
04867   fsp_vv_accu<idotprecision,ivector,sivector,sparse_idot>(dot, v1, sivector(v2));
04868 }
04869 
04870 inline void accumulate(idotprecision& dot, const ivector& v1, const srmatrix_subv& v2) {
04871   fsp_vv_accu<idotprecision,ivector,srvector,sparse_idot>(dot, v1, srvector(v2));
04872 }
04873 
04874 inline void accumulate(idotprecision& dot, const rvector& v1, const simatrix_subv& v2) {
04875   fsp_vv_accu<idotprecision,rvector,sivector,sparse_idot>(dot, v1, sivector(v2));
04876 }
04877 
04878 inline void accumulate(idotprecision& dot, const ivector_slice& v1, const simatrix_subv& v2) {
04879   fsp_vv_accu<idotprecision,ivector_slice,sivector,sparse_idot>(dot, v1, sivector(v2));
04880 }
04881 
04882 inline void accumulate(idotprecision& dot, const ivector_slice& v1, const srmatrix_subv& v2) {
04883   fsp_vv_accu<idotprecision,ivector_slice,srvector,sparse_idot>(dot, v1, srvector(v2));
04884 }
04885 
04886 inline void accumulate(idotprecision& dot, const rvector_slice& v1, const simatrix_subv& v2) {
04887   fsp_vv_accu<idotprecision,rvector_slice,sivector,sparse_idot>(dot, v1, sivector(v2));
04888 }
04889 
04890 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const simatrix_subv& v2) {
04891   idotprecision tmp(0.0);
04892   tmp.set_k(dot.get_k());
04893   accumulate(tmp,sivector(v1),sivector(v2));
04894   SetRe(dot, Re(dot) + tmp);
04895 }
04896 
04897 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const srmatrix_subv& v2) {
04898   idotprecision tmp(0.0);
04899   tmp.set_k(dot.get_k());
04900   accumulate(tmp,sivector(v1),srvector(v2));
04901   SetRe(dot, Re(dot) + tmp);
04902 }
04903 
04904 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const simatrix_subv& v2) {
04905   idotprecision tmp(0.0);
04906   tmp.set_k(dot.get_k());
04907   accumulate(tmp,srvector(v1),sivector(v2));
04908   SetRe(dot, Re(dot) + tmp);
04909 }
04910 
04911 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const sivector& v2) {
04912   idotprecision tmp(0.0);
04913   tmp.set_k(dot.get_k());
04914   accumulate(tmp,sivector(v1),v2);
04915   SetRe(dot, Re(dot) + tmp);
04916 }
04917 
04918 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const srvector& v2) {
04919   idotprecision tmp(0.0);
04920   tmp.set_k(dot.get_k());
04921   accumulate(tmp,sivector(v1),v2);
04922   SetRe(dot, Re(dot) + tmp);
04923 }
04924 
04925 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const sivector& v2) {
04926   idotprecision tmp(0.0);
04927   tmp.set_k(dot.get_k());
04928   accumulate(tmp,srvector(v1),v2);
04929   SetRe(dot, Re(dot) + tmp);
04930 }
04931 
04932 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const sivector_slice& v2) {
04933   idotprecision tmp(0.0);
04934   tmp.set_k(dot.get_k());
04935   accumulate(tmp,sivector(v1),v2);
04936   SetRe(dot, Re(dot) + tmp);
04937 }
04938 
04939 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const srvector_slice& v2) {
04940   idotprecision tmp(0.0);
04941   tmp.set_k(dot.get_k());
04942   accumulate(tmp,sivector(v1),v2);
04943   SetRe(dot, Re(dot) + tmp);
04944 }
04945 
04946 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const sivector_slice& v2) {
04947   idotprecision tmp(0.0);
04948   tmp.set_k(dot.get_k());
04949   accumulate(tmp,srvector(v1),v2);
04950   SetRe(dot, Re(dot) + tmp);
04951 }
04952 
04953 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const ivector& v2) {
04954   idotprecision tmp(0.0);
04955   tmp.set_k(dot.get_k());
04956   accumulate(tmp,sivector(v1),v2);
04957   SetRe(dot, Re(dot) + tmp);
04958 }
04959 
04960 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const rvector& v2) {
04961   idotprecision tmp(0.0);
04962   tmp.set_k(dot.get_k());
04963   accumulate(tmp,sivector(v1),v2);
04964   SetRe(dot, Re(dot) + tmp);
04965 }
04966 
04967 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const ivector& v2) {
04968   idotprecision tmp(0.0);
04969   tmp.set_k(dot.get_k());
04970   accumulate(tmp,srvector(v1),v2);
04971   SetRe(dot, Re(dot) + tmp);
04972 }
04973 
04974 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const ivector_slice& v2) {
04975   idotprecision tmp(0.0);
04976   tmp.set_k(dot.get_k());
04977   accumulate(tmp,sivector(v1),v2);
04978   SetRe(dot, Re(dot) + tmp);
04979 }
04980 
04981 inline void accumulate(cidotprecision& dot, const simatrix_subv& v1, const rvector_slice& v2) {
04982   idotprecision tmp(0.0);
04983   tmp.set_k(dot.get_k());
04984   accumulate(tmp,sivector(v1),v2);
04985   SetRe(dot, Re(dot) + tmp);
04986 }
04987 
04988 inline void accumulate(cidotprecision& dot, const srmatrix_subv& v1, const ivector_slice& v2) {
04989   idotprecision tmp(0.0);
04990   tmp.set_k(dot.get_k());
04991   accumulate(tmp,srvector(v1),v2);
04992   SetRe(dot, Re(dot) + tmp);
04993 }
04994 
04995 inline void accumulate(cidotprecision& dot, const sivector& v1, const simatrix_subv& v2) {
04996   idotprecision tmp(0.0);
04997   tmp.set_k(dot.get_k());
04998   accumulate(tmp,v1,sivector(v2));
04999   SetRe(dot, Re(dot) + tmp);
05000 }
05001 
05002 inline void accumulate(cidotprecision& dot, const sivector& v1, const srmatrix_subv& v2) {
05003   idotprecision tmp(0.0);
05004   tmp.set_k(dot.get_k());
05005   accumulate(tmp,v1,srvector(v2));
05006   SetRe(dot, Re(dot) + tmp);
05007 }
05008 
05009 inline void accumulate(cidotprecision& dot, const srvector& v1, const simatrix_subv& v2) {
05010   idotprecision tmp(0.0);
05011   tmp.set_k(dot.get_k());
05012   accumulate(tmp,v1,sivector(v2));
05013   SetRe(dot, Re(dot) + tmp);
05014 }
05015 
05016 inline void accumulate(cidotprecision& dot, const sivector_slice& v1, const simatrix_subv& v2) {
05017   idotprecision tmp(0.0);
05018   tmp.set_k(dot.get_k());
05019   accumulate(tmp,v1,sivector(v2));
05020   SetRe(dot, Re(dot) + tmp);
05021 }
05022 
05023 inline void accumulate(cidotprecision& dot, const sivector_slice& v1, const srmatrix_subv& v2) {
05024   idotprecision tmp(0.0);
05025   tmp.set_k(dot.get_k());
05026   accumulate(tmp,v1,srvector(v2));
05027   SetRe(dot, Re(dot) + tmp);
05028 }
05029 
05030 inline void accumulate(cidotprecision& dot, const srvector_slice& v1, const simatrix_subv& v2) {
05031   idotprecision tmp(0.0);
05032   tmp.set_k(dot.get_k());
05033   accumulate(tmp,v1,sivector(v2));
05034   SetRe(dot, Re(dot) + tmp);
05035 }
05036 
05037 inline void accumulate(cidotprecision& dot, const ivector& v1, const simatrix_subv& v2) {
05038   idotprecision tmp(0.0);
05039   tmp.set_k(dot.get_k());
05040   accumulate(tmp,v1,sivector(v2));
05041   SetRe(dot, Re(dot) + tmp);
05042 }
05043 
05044 inline void accumulate(cidotprecision& dot, const ivector& v1, const srmatrix_subv& v2) {
05045   idotprecision tmp(0.0);
05046   tmp.set_k(dot.get_k());
05047   accumulate(tmp,v1,srvector(v2));
05048   SetRe(dot, Re(dot) + tmp);
05049 }
05050 
05051 inline void accumulate(cidotprecision& dot, const rvector& v1, const simatrix_subv& v2) {
05052   idotprecision tmp(0.0);
05053   tmp.set_k(dot.get_k());
05054   accumulate(tmp,v1,sivector(v2));
05055   SetRe(dot, Re(dot) + tmp);
05056 }
05057 
05058 inline void accumulate(cidotprecision& dot, const ivector_slice& v1, const simatrix_subv& v2) {
05059   idotprecision tmp(0.0);
05060   tmp.set_k(dot.get_k());
05061   accumulate(tmp,v1,sivector(v2));
05062   SetRe(dot, Re(dot) + tmp);
05063 }
05064 
05065 inline void accumulate(cidotprecision& dot, const ivector_slice& v1, const srmatrix_subv& v2) {
05066   idotprecision tmp(0.0);
05067   tmp.set_k(dot.get_k());
05068   accumulate(tmp,v1,srvector(v2));
05069   SetRe(dot, Re(dot) + tmp);
05070 }
05071 
05072 inline void accumulate(cidotprecision& dot, const rvector_slice& v1, const simatrix_subv& v2) {
05073   idotprecision tmp(0.0);
05074   tmp.set_k(dot.get_k());
05075   accumulate(tmp,v1,sivector(v2));
05076   SetRe(dot, Re(dot) + tmp);
05077 }
05078 
05079 }  //namespace cxsc;
05080 
05081 #include "sparsematrix.inl"
05082 
05083 #endif 
05084  

Generated on Thu Jun 9 11:22:17 2011 for C-XSC - A C++ Class Library for Extended Scientific Computing by  doxygen 1.4.6