C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
scvector.hpp
00001 /*
00002 **  CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
00003 **
00004 **  Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
00005 **                          Universitaet Karlsruhe, Germany
00006 **            (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
00007 **                          Universitaet Wuppertal, Germany   
00008 **
00009 **  This library is free software; you can redistribute it and/or
00010 **  modify it under the terms of the GNU Library General Public
00011 **  License as published by the Free Software Foundation; either
00012 **  version 2 of the License, or (at your option) any later version.
00013 **
00014 **  This library is distributed in the hope that it will be useful,
00015 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 **  Library General Public License for more details.
00018 **
00019 **  You should have received a copy of the GNU Library General Public
00020 **  License along with this library; if not, write to the Free
00021 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 /* CVS $Id: scvector.hpp,v 1.17 2014/01/30 17:23:48 cxsc Exp $ */
00025 
00026 #ifndef _CXSC_SCVECTOR_HPP_INCLUDED
00027 #define _CXSC_SCVECTOR_HPP_INCLUDED
00028 
00029 #include <complex.hpp>
00030 #include <cvector.hpp>
00031 #include <vector>
00032 #include <iostream>
00033 #include <srvector.hpp>
00034 #include <sparsecdot.hpp>
00035 #include <sparsevector.hpp>
00036 
00037 namespace cxsc {
00038 
00039 class srvector_slice;
00040 class srmatrix;
00041 class srmatrix_slice;
00042 class srmatrix_subv;
00043 class scvector_slice;
00044 class scmatrix;
00045 class scmatrix_slice;
00046 class scmatrix_subv;
00047 class scivector;
00048 class scivector_slice;
00049 class scimatrix;
00050 class scimatrix_slice;
00051 class scimatrix_subv;
00052 
00054 
00058 class scvector {
00059   private:
00060     std::vector<int> p;
00061     std::vector<complex> x;
00062     int lb;
00063     int ub;
00064     int n; 
00065 
00066   public:
00068     scvector() : lb(0), ub(-1) , n(0) {
00069     }
00070 
00072     explicit scvector(const int s) : lb(1), ub(s), n(s) {
00073         p.reserve((int)(s*0.1));
00074         x.reserve((int)(s*0.1));
00075     }
00076 
00078     scvector(const int s, const int b) : lb(1), ub(s), n(s) {
00079         p.reserve(b);
00080         x.reserve(b);
00081     }
00082 
00084     scvector(const cvector& v) : lb(Lb(v)), ub(Ub(v)), n(VecLen(v)) {
00085         for(int i=lb ; i<=ub ; i++) {
00086           if(v[i] != 0.0) {
00087             p.push_back(i-lb);
00088             x.push_back(v[i]);
00089           }
00090         }
00091     }
00092 
00094     scvector(const rvector& v) : lb(Lb(v)), ub(Ub(v)), n(VecLen(v)) {
00095         for(int i=lb ; i<=ub ; i++) {
00096           if(v[i] != 0.0) {
00097             p.push_back(i-lb);
00098             x.push_back(complex(v[i]));
00099           }
00100         }
00101     }
00102 
00104     scvector(const int n, const int nnz, const intvector& index, const cvector& values) : lb(1), ub(n) {
00105       this->n = n;
00106       for(int i=0 ; i<nnz ; i++) {
00107         if(values[i+Lb(values)] != 0.0) {
00108           p.push_back(index[i+Lb(index)]);
00109           x.push_back(values[i+Lb(values)]);
00110         }
00111       }
00112     }
00113 
00115     scvector(const int n, const int nnz, const int* index, const complex* values) : lb(1), ub(n) {
00116       this->n = n;
00117       for(int i=0 ; i<nnz ; i++) {
00118         if(values[i] != 0.0) {
00119           p.push_back(index[i]);
00120           x.push_back(values[i]);
00121         }
00122       } 
00123     }
00124 
00126     scvector(const srvector& v) : p(v.p), lb(v.lb), ub(v.ub), n(v.n) {
00127       x.reserve(v.get_nnz());
00128       for(int i=0 ; i<v.get_nnz() ; i++) 
00129         x.push_back(complex(v.x[i]));
00130     }
00131 
00133     scvector(const srvector_slice&);
00135     scvector(const scvector_slice&);
00137     scvector(const srmatrix_subv& A);
00139     scvector(const scmatrix_subv& A);
00140 
00142 
00147     std::vector<int>& row_indices() {
00148       return p;
00149     }
00150 
00152     std::vector<complex>& values() {
00156       return x;
00157     }
00158 
00160 
00165     const std::vector<int>& row_indices() const {
00166       return p;
00167     }
00168 
00170     const std::vector<complex>& values() const {
00174       return x;
00175     }
00176 
00178     int get_nnz() const {
00179       return x.size();
00180     }
00181 
00183     real density() const {
00184       return (double)x.size()/n;
00185     }
00186 
00188     void dropzeros() {
00189       for(int i=0 ; i<get_nnz() ; i++) {
00190         if(x[i] == 0.0) {
00191            x.erase(x.begin()+i);
00192            p.erase(p.begin()+i);
00193         }
00194       }
00195     }
00196 
00198     scvector& operator=(const srvector& v) {
00199       n = v.n;
00200       p = v.p;
00201       x.clear();
00202       x.reserve(v.get_nnz());
00203       for(unsigned int i=0 ; i<v.x.size() ; i++)
00204         x[i] = complex(v.x[i]);
00205       return *this;
00206     } 
00207 
00209     scvector& operator=(const real& v) {
00210       return sp_vs_assign<scvector,real,complex>(*this,v);
00211     }
00212 
00214     scvector& operator=(const complex& v) {
00215       return sp_vs_assign<scvector,complex,complex>(*this,v);
00216     }
00217 
00219     scvector& operator=(const rvector& v) {
00220       return spf_vv_assign<scvector,rvector,complex>(*this,v);
00221     }
00222 
00224     scvector& operator=(const cvector& v) {
00225       return spf_vv_assign<scvector,cvector,complex>(*this,v);
00226     }
00227 
00229     scvector& operator=(const rvector_slice& v) {
00230       return spf_vv_assign<scvector,rvector_slice,complex>(*this,v);
00231     }
00232 
00234     scvector& operator=(const cvector_slice& v) {
00235       return spf_vv_assign<scvector,cvector_slice,complex>(*this,v);
00236     }
00237 
00239     scvector& operator=(const scvector_slice&);
00241     scvector& operator=(const srvector_slice&);
00242 
00244 
00248     complex& operator[](const int i) {
00249 #if(CXSC_INDEX_CHECK)
00250       if(i<lb || i>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector::operator[](const int)"));
00251 #endif
00252       int k;
00253 
00254       for(k=0 ; k<get_nnz() && p[k]<=i-lb ; k++) {
00255         if(p[k] == i-lb) 
00256           return x[k];
00257       }
00258 
00259       p.insert(p.begin() + k, i-lb);
00260       x.insert(x.begin() + k, complex(0.0));
00261 
00262       return x[k];
00263     }
00264 
00266 
00270     complex operator[](const int i) const {
00271 #if(CXSC_INDEX_CHECK)
00272       if(i<lb || i>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector::operator[](const int)"));
00273 #endif
00274       return (*this)(i);
00275     }
00276 
00278 
00282     const complex operator()(const int i) const {
00283 #if(CXSC_INDEX_CHECK)
00284       if(i<lb || i>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector::operator()(const int)"));
00285 #endif
00286       complex r(0.0);
00287 
00288       for(int k=0 ; k<get_nnz() && p[k]<=i-lb ; k++) {
00289         if(p[k] == i-lb) 
00290           r = x[k];
00291       }
00292 
00293       return r; 
00294     }
00295 
00297 
00300     scvector operator()(const intvector& per) {
00301       scvector v(n,get_nnz());
00302       intvector pinv = perminv(per);
00303 
00304       std::map<int,complex> work;
00305       for(int i=0 ; i<get_nnz() ; i++)
00306          work.insert(std::make_pair(pinv[Lb(pinv)+p[i]], x[i]));
00307  
00308       for(std::map<int,complex>::iterator it=work.begin() ; it!=work.end() ; it++) {
00309          v.p.push_back(it->first);
00310          v.x.push_back(it->second);
00311       }
00312 
00313       return v;
00314     }
00315 
00317 
00323     scvector operator()(const intmatrix& P) {
00324       intvector p = permvec(P);
00325       return (*this)(p);
00326     }
00327 
00329 
00331     scvector_slice operator()(const int, const int);
00332 
00334     scvector& operator*=(const real& s) {
00335       return sp_vs_multassign(*this,s);
00336     }
00337 
00339     scvector& operator*=(const complex& s) {
00340       return sp_vs_multassign(*this,s);
00341     }
00342 
00344     scvector& operator/=(const real& s) {
00345       return sp_vs_divassign(*this,s);
00346     }
00347 
00349     scvector& operator/=(const complex& s) {
00350       return sp_vs_divassign(*this,s);
00351     }
00352 
00354     scvector& operator+=(const rvector& v) {
00355       return spf_vv_addassign(*this,v);
00356     }
00357 
00359     scvector& operator+=(const cvector& v) {
00360       return spf_vv_addassign(*this,v);
00361     }
00362 
00364     scvector& operator+=(const rvector_slice& v) {
00365       return spf_vv_addassign(*this,v);
00366     }
00367 
00369     scvector& operator+=(const cvector_slice& v) {
00370       return spf_vv_addassign(*this,v);
00371     }
00372 
00374     scvector& operator+=(const srvector& v) {
00375       return spsp_vv_addassign(*this,v);
00376     }
00377 
00379     scvector& operator+=(const scvector& v) {
00380       return spsp_vv_addassign(*this,v);
00381     }
00382 
00383 
00385     scvector& operator-=(const rvector& v) {
00386       return spf_vv_subassign(*this,v);
00387     }
00388 
00390     scvector& operator-=(const cvector& v) {
00391       return spf_vv_subassign(*this,v);
00392     }
00393 
00395     scvector& operator-=(const rvector_slice& v) {
00396       return spf_vv_subassign(*this,v);
00397     }
00398 
00400     scvector& operator-=(const cvector_slice& v) {
00401       return spf_vv_subassign(*this,v);
00402     }
00403 
00405     scvector& operator-=(const srvector& v) {
00406       return spsp_vv_subassign(*this,v);
00407     }
00408 
00410     scvector& operator-=(const scvector& v) {
00411       return spsp_vv_subassign(*this,v);
00412     }
00413 
00415     scvector& operator+=(const srvector_slice&);
00417     scvector& operator+=(const scvector_slice&);
00419     scvector& operator-=(const srvector_slice&);
00421     scvector& operator-=(const scvector_slice&);
00422 
00423     friend void SetLb(scvector&, const int);
00424     friend void SetUb(scvector&, const int);
00425     friend int Lb(const scvector&);
00426     friend int Ub(const scvector&);
00427     friend srvector Re(const scvector&);
00428     friend srvector Im (const scvector&);
00429     friend scvector Inf(const scivector&);
00430     friend scvector Sup (const scivector&);
00431     friend scvector mid(const scivector&);
00432     friend scvector diam(const scivector&);
00433     friend scvector mid(const scivector_slice&);
00434     friend scvector diam(const scivector_slice&);
00435     friend int VecLen(const scvector&);
00436     friend srvector abs(const scvector&);
00437 
00438     friend class srvector_slice;
00439     friend class scvector_slice;
00440     friend class scivector_slice;
00441     friend class scivector;
00442     friend class cvector;
00443     friend class cvector_slice;
00444     friend class civector;
00445     friend class civector_slice;
00446 
00447 #include "vector_friend_declarations.inl"
00448 };
00449 
00450 inline cvector::cvector(const scvector& v) {
00451   l = v.lb;
00452   u = v.ub;
00453   size = v.n;
00454   dat = new complex[v.n];
00455   for(int i=0 ; i<v.n ; i++)
00456     dat[i] = 0.0;
00457   for(int i=0 ; i<v.get_nnz() ; i++)
00458     dat[v.p[i]] = v.x[i];
00459 }
00460 
00461 inline cvector::cvector(const srvector& v) {
00462   l = v.lb;
00463   u = v.ub;
00464   size = v.n;
00465   dat = new complex[v.n];
00466   for(int i=0 ; i<v.n ; i++)
00467     dat[i] = 0.0;
00468   for(int i=0 ; i<v.get_nnz() ; i++)
00469     dat[v.p[i]] = v.x[i];
00470 }
00471 
00472 inline cvector& cvector::operator=(const scvector& v) {
00473   return fsp_vv_assign<cvector,scvector,complex>(*this,v);
00474 }
00475 
00476 inline cvector& cvector::operator=(const scvector_slice& v) {
00477   return fsl_vv_assign<cvector,scvector_slice,complex>(*this,v);
00478 }
00479 
00480 inline cvector& cvector::operator=(const srvector& v) {
00481   return fsp_vv_assign<cvector,srvector,complex>(*this,v);
00482 }
00483 
00484 inline cvector& cvector::operator=(const srvector_slice& v) {
00485   return fsl_vv_assign<cvector,srvector_slice,complex>(*this,v);
00486 }
00487 
00489 
00492 inline void SetLb(scvector& v, const int i) {
00493   v.lb = i;
00494   v.ub = v.lb + v.n - 1;
00495 }
00496 
00498 
00501 inline void SetUb(scvector& v, const int j) {
00502   v.ub = j;
00503   v.lb = v.ub - v.n + 1;
00504 }
00505 
00507 inline int Lb(const scvector& v) {
00508   return v.lb;
00509 }
00510 
00512 inline int Ub(const scvector& v) {
00513   return v.ub;
00514 }
00515 
00517 inline srvector Re(const scvector& v) {
00518   srvector res(v.n, v.get_nnz());
00519   res.lb = v.lb;
00520   res.ub = v.ub;
00521   res.p  = v.p;
00522   for(int i=0 ; i<v.get_nnz() ; i++)
00523     res.x[i] = Re(v.x[i]);
00524   return res;
00525 }
00526 
00528 inline srvector Im(const scvector& v) {
00529   srvector res(v.n, v.get_nnz());
00530   res.lb = v.lb;
00531   res.ub = v.ub;
00532   res.p  = v.p;
00533   for(int i=0 ; i<v.get_nnz() ; i++)
00534     res.x[i] = Im(v.x[i]);
00535   return res;
00536 }
00537 
00539 inline srvector abs(const scvector& v) {
00540   srvector ret(VecLen(v));
00541   const std::vector<int>& rv = v.row_indices();
00542   const std::vector<complex>& xv = v.values();
00543   std::vector<int>& r = ret.row_indices();  
00544   std::vector<real>& x = ret.values();
00545   
00546   for(unsigned int i=0 ; i<xv.size() ; i++) {
00547     x.push_back(abs(xv[i]));
00548     r.push_back(rv[i]);
00549   }
00550   
00551   return ret;
00552 }
00553 
00555 inline int VecLen(const scvector& v) {
00556   return v.n;
00557 }
00558 
00560 inline void Resize(scvector& v) {
00561   sp_v_resize(v);
00562 }
00563 
00565 
00568 inline void Resize(scvector& v, const int n) {
00569   sp_v_resize(v,n);
00570 }
00571 
00573 
00577 inline void Resize(scvector& v, const int l, const int u) {
00578   sp_v_resize(v,l,u);
00579 }
00580 
00582 inline scvector operator-(const scvector& v) {
00583   return sp_v_negative(v);
00584 }
00585 
00587 
00593 inline complex operator*(const scvector& v1, const cvector& v2) {
00594   return spf_vv_mult<scvector,cvector,complex,sparse_cdot>(v1,v2);
00595 }
00596 
00598 
00604 inline complex operator*(const scvector& v1, const rvector& v2) {
00605   return spf_vv_mult<scvector,rvector,complex,sparse_cdot>(v1,v2);
00606 }
00607 
00609 
00615 inline complex operator*(const srvector& v1, const cvector& v2) {
00616   return spf_vv_mult<srvector,cvector,complex,sparse_cdot>(v1,v2);
00617 }
00618 
00620 
00626 inline complex operator*(const rvector& v1, const scvector& v2) {
00627   return fsp_vv_mult<rvector,scvector,complex,sparse_cdot>(v1,v2);
00628 }
00629 
00631 
00637 inline complex operator*(const cvector& v1, const srvector& v2) {
00638   return fsp_vv_mult<cvector,srvector,complex,sparse_cdot>(v1,v2);
00639 }
00640 
00642 
00648 inline complex operator*(const cvector& v1, const scvector& v2) {
00649   return fsp_vv_mult<cvector,scvector,complex,sparse_cdot>(v1,v2);
00650 }
00651 
00653 
00659 inline complex operator*(const scvector& v1, const rvector_slice& v2) {
00660   return spf_vv_mult<scvector,rvector_slice,complex,sparse_cdot>(v1,v2);
00661 }
00662 
00664 
00670 inline complex operator*(const scvector& v1, const cvector_slice& v2) {
00671   return spf_vv_mult<scvector,cvector_slice,complex,sparse_cdot>(v1,v2);
00672 }
00673 
00675 
00681 inline complex operator*(const srvector& v1, const cvector_slice& v2) {
00682   return spf_vv_mult<srvector,cvector_slice,complex,sparse_cdot>(v1,v2);
00683 }
00684 
00686 
00692 inline complex operator*(const cvector_slice& v1, const srvector& v2) {
00693   return fsp_vv_mult<cvector_slice,srvector,complex,sparse_cdot>(v1,v2);
00694 }
00695 
00697 
00703 inline complex operator*(const cvector_slice& v1, const scvector& v2) {
00704   return fsp_vv_mult<cvector_slice,scvector,complex,sparse_cdot>(v1,v2);
00705 }
00706 
00708 
00714 inline complex operator*(const rvector_slice& v1, const scvector& v2) {
00715   return fsp_vv_mult<rvector_slice,scvector,complex,sparse_cdot>(v1,v2);
00716 }
00717 
00719 
00725 inline complex operator*(const scvector& v1, const srvector& v2) {
00726   return spsp_vv_mult<scvector,srvector,complex,sparse_cdot>(v1,v2);
00727 }
00728 
00730 
00736 inline complex operator*(const srvector& v1, const scvector& v2) {
00737   return spsp_vv_mult<srvector,scvector,complex,sparse_cdot>(v1,v2);
00738 }
00739 
00741 
00747 inline complex operator*(const scvector& v1, const scvector& v2) {
00748   return spsp_vv_mult<scvector,scvector,complex,sparse_cdot>(v1,v2);
00749 }
00750 
00752 inline scvector operator*(const scvector& v, const real& s) {
00753   return sp_vs_mult<scvector,real,scvector>(v,s);
00754 }
00755 
00757 inline scvector operator*(const scvector& v, const complex& s) {
00758   return sp_vs_mult<scvector,complex,scvector>(v,s);
00759 }
00760 
00762 inline scvector operator*(const srvector& v, const complex& s) {
00763   return sp_vs_mult<srvector,complex,scvector>(v,s);
00764 }
00765 
00767 inline scvector operator/(const scvector& v, const real& s) {
00768   return sp_vs_div<scvector,real,scvector>(v,s);
00769 }
00770 
00772 inline scvector operator/(const scvector& v, const complex& s) {
00773   return sp_vs_div<scvector,complex,scvector>(v,s);
00774 }
00775 
00777 inline scvector operator/(const srvector& v, const complex& s) {
00778   return sp_vs_div<srvector,complex,scvector>(v,s);
00779 }
00780 
00782 inline scvector operator*(const real& s, const scvector& v) {
00783   return sp_sv_mult<real,scvector,scvector>(s,v);
00784 }
00785 
00787 inline scvector operator*(const complex& s, const scvector& v) {
00788   return sp_sv_mult<complex,scvector,scvector>(s,v);
00789 }
00790 
00792 inline scvector operator*(const complex& s, const srvector& v) {
00793   return sp_sv_mult<complex,srvector,scvector>(s,v);
00794 }
00795 
00797 inline cvector operator+(const cvector& v1, const srvector& v2) {
00798   return fsp_vv_add<cvector,srvector,cvector>(v1,v2);
00799 }
00800 
00802 inline cvector operator+(const rvector& v1, const scvector& v2) {
00803   return fsp_vv_add<rvector,scvector,cvector>(v1,v2);
00804 }
00805 
00807 inline cvector operator+(const cvector& v1, const scvector& v2) {
00808   return fsp_vv_add<cvector,scvector,cvector>(v1,v2);
00809 }
00810 
00812 inline cvector operator+(const scvector& v1, const rvector& v2) {
00813   return spf_vv_add<scvector,rvector,cvector>(v1,v2);
00814 }
00815 
00817 inline cvector operator+(const srvector& v1, const cvector& v2) {
00818   return spf_vv_add<srvector,cvector,cvector>(v1,v2);
00819 }
00820 
00822 inline cvector operator+(const scvector& v1, const cvector& v2) {
00823   return spf_vv_add<scvector,cvector,cvector>(v1,v2);
00824 }
00825 
00827 inline cvector operator+(const cvector_slice& v1, const srvector& v2) {
00828   return fsp_vv_add<cvector_slice,srvector,cvector>(v1,v2);
00829 }
00830 
00832 inline cvector operator+(const rvector_slice& v1, const scvector& v2) {
00833   return fsp_vv_add<rvector_slice,scvector,cvector>(v1,v2);
00834 }
00835 
00837 inline cvector operator+(const cvector_slice& v1, const scvector& v2) {
00838   return fsp_vv_add<cvector_slice,scvector,cvector>(v1,v2);
00839 }
00840 
00842 inline cvector operator+(const scvector& v1, const rvector_slice& v2) {
00843   return spf_vv_add<scvector,rvector_slice,cvector>(v1,v2);
00844 }
00845 
00847 inline cvector operator+(const srvector& v1, const cvector_slice& v2) {
00848   return spf_vv_add<srvector,cvector_slice,cvector>(v1,v2);
00849 }
00850 
00852 inline cvector operator+(const scvector& v1, const cvector_slice& v2) {
00853   return spf_vv_add<scvector,cvector_slice,cvector>(v1,v2);
00854 }
00855 
00857 inline scvector operator+(const scvector& v1, const srvector& v2) {
00858   return spsp_vv_add<scvector,srvector,scvector,complex>(v1,v2);
00859 }
00860 
00862 inline scvector operator+(const srvector& v1, const scvector& v2) {
00863   return spsp_vv_add<srvector,scvector,scvector,complex>(v1,v2);
00864 }
00865 
00867 inline scvector operator+(const scvector& v1, const scvector& v2) {
00868   return spsp_vv_add<scvector,scvector,scvector,complex>(v1,v2);
00869 }
00870 
00872 inline cvector operator-(const cvector& v1, const srvector& v2) {
00873   return fsp_vv_sub<cvector,srvector,cvector>(v1,v2);
00874 }
00875 
00877 inline cvector operator-(const rvector& v1, const scvector& v2) {
00878   return fsp_vv_sub<rvector,scvector,cvector>(v1,v2);
00879 }
00880 
00882 inline cvector operator-(const cvector& v1, const scvector& v2) {
00883   return fsp_vv_sub<cvector,scvector,cvector>(v1,v2);
00884 }
00885 
00887 inline cvector operator-(const scvector& v1, const rvector& v2) {
00888   return spf_vv_sub<scvector,rvector,cvector>(v1,v2);
00889 }
00890 
00892 inline cvector operator-(const srvector& v1, const cvector& v2) {
00893   return spf_vv_sub<srvector,cvector,cvector>(v1,v2);
00894 }
00895 
00897 inline cvector operator-(const scvector& v1, const cvector& v2) {
00898   return spf_vv_sub<scvector,cvector,cvector>(v1,v2);
00899 }
00900 
00902 inline cvector operator-(const cvector_slice& v1, const srvector& v2) {
00903   return fsp_vv_sub<cvector_slice,srvector,cvector>(v1,v2);
00904 }
00905 
00907 inline cvector operator-(const rvector_slice& v1, const scvector& v2) {
00908   return fsp_vv_sub<rvector_slice,scvector,cvector>(v1,v2);
00909 }
00910 
00912 inline cvector operator-(const cvector_slice& v1, const scvector& v2) {
00913   return fsp_vv_sub<cvector_slice,scvector,cvector>(v1,v2);
00914 }
00915 
00917 inline cvector operator-(const scvector& v1, const rvector_slice& v2) {
00918   return spf_vv_sub<scvector,rvector_slice,cvector>(v1,v2);
00919 }
00920 
00922 inline cvector operator-(const srvector& v1, const cvector_slice& v2) {
00923   return spf_vv_sub<srvector,cvector_slice,cvector>(v1,v2);
00924 }
00925 
00927 inline cvector operator-(const scvector& v1, const cvector_slice& v2) {
00928   return spf_vv_sub<scvector,cvector_slice,cvector>(v1,v2);
00929 }
00930 
00932 inline scvector operator-(const scvector& v1, const srvector& v2) {
00933   return spsp_vv_sub<scvector,srvector,scvector,complex>(v1,v2);
00934 }
00935 
00937 inline scvector operator-(const srvector& v1, const scvector& v2) {
00938   return spsp_vv_sub<srvector,scvector,scvector,complex>(v1,v2);
00939 }
00940 
00942 inline scvector operator-(const scvector& v1, const scvector& v2) {
00943   return spsp_vv_sub<scvector,scvector,scvector,complex>(v1,v2);
00944 }
00945 
00946 inline cvector& cvector::operator+=(const srvector& v2) {
00947   return fsp_vv_addassign(*this,v2);
00948 }
00949 
00950 inline cvector& cvector::operator+=(const scvector& v2) {
00951   return fsp_vv_addassign(*this,v2);
00952 }
00953 
00954 inline cvector_slice& cvector_slice::operator+=(const srvector& v2) {
00955   return fsp_vv_addassign(*this,v2);
00956 }
00957 
00958 inline cvector_slice& cvector_slice::operator+=(const scvector& v2) {
00959   return fsp_vv_addassign(*this,v2);
00960 }
00961  
00962 inline cvector& cvector::operator-=(const srvector& v2) {
00963   return fsp_vv_subassign(*this,v2);
00964 }
00965 
00966 inline cvector& cvector::operator-=(const scvector& v2) {
00967   return fsp_vv_subassign(*this,v2);
00968 }
00969 
00970 inline cvector_slice& cvector_slice::operator-=(const srvector& v2) {
00971   return fsp_vv_subassign(*this,v2);
00972 }
00973 
00974 inline cvector_slice& cvector_slice::operator-=(const scvector& v2) {
00975   return fsp_vv_subassign(*this,v2);
00976 }
00977 
00979 
00982 inline bool operator==(const scvector& v1, const scvector& v2) {
00983   return spsp_vv_comp(v1,v2);
00984 }
00985 
00987 
00990 inline bool operator==(const scvector& v1, const srvector& v2) {
00991   return spsp_vv_comp(v1,v2);
00992 }
00993 
00995 
00998 inline bool operator==(const srvector& v1, const scvector& v2) {
00999   return spsp_vv_comp(v1,v2);
01000 }
01001 
01003 
01006 inline bool operator==(const scvector& v1, const rvector& v2) {
01007   return spf_vv_comp(v1,v2);
01008 }
01009 
01011 
01014 inline bool operator==(const srvector& v1, const cvector& v2) {
01015   return spf_vv_comp(v1,v2);
01016 }
01017 
01019 
01022 inline bool operator==(const scvector& v1, const cvector& v2) {
01023   return spf_vv_comp(v1,v2);
01024 }
01025 
01027 
01030 inline bool operator==(const cvector& v1, const srvector& v2) {
01031   return fsp_vv_comp(v1,v2);
01032 }
01033 
01035 
01038 inline bool operator==(const rvector& v1, const scvector& v2) {
01039   return fsp_vv_comp(v1,v2);
01040 }
01041 
01043 
01046 inline bool operator==(const cvector& v1, const scvector& v2) {
01047   return fsp_vv_comp(v1,v2);
01048 }
01049 
01051 
01054 inline bool operator==(const scvector& v1, const rvector_slice& v2) {
01055   return spf_vv_comp(v1,v2);
01056 }
01057 
01059 
01062 inline bool operator==(const srvector& v1, const cvector_slice& v2) {
01063   return spf_vv_comp(v1,v2);
01064 }
01065 
01067 
01070 inline bool operator==(const scvector& v1, const cvector_slice& v2) {
01071   return spf_vv_comp(v1,v2);
01072 }
01073 
01075 
01078 inline bool operator==(const cvector_slice& v1, const srvector& v2) {
01079   return fsp_vv_comp(v1,v2);
01080 }
01081 
01083 
01086 inline bool operator==(const rvector_slice& v1, const scvector& v2) {
01087   return fsp_vv_comp(v1,v2);
01088 }
01089 
01091 
01094 inline bool operator==(const cvector_slice& v1, const scvector& v2) {
01095   return fsp_vv_comp(v1,v2);
01096 }
01097 
01099 
01102 inline bool operator!=(const scvector& v1, const srvector& v2) {
01103   return !spsp_vv_comp(v1,v2);
01104 }
01105 
01107 
01110 inline bool operator!=(const srvector& v1, const scvector& v2) {
01111   return !spsp_vv_comp(v1,v2);
01112 }
01113 
01115 
01118 inline bool operator!=(const scvector& v1, const scvector& v2) {
01119   return !spsp_vv_comp(v1,v2);
01120 }
01121 
01123 
01126 inline bool operator!=(const scvector& v1, const rvector& v2) {
01127   return !spf_vv_comp(v1,v2);
01128 }
01129 
01131 
01134 inline bool operator!=(const srvector& v1, const cvector& v2) {
01135   return !spf_vv_comp(v1,v2);
01136 }
01137 
01139 
01142 inline bool operator!=(const scvector& v1, const cvector& v2) {
01143   return !spf_vv_comp(v1,v2);
01144 }
01145 
01147 
01150 inline bool operator!=(const cvector& v1, const srvector& v2) {
01151   return !fsp_vv_comp(v1,v2);
01152 }
01153 
01155 
01158 inline bool operator!=(const rvector& v1, const scvector& v2) {
01159   return !fsp_vv_comp(v1,v2);
01160 }
01161 
01163 
01166 inline bool operator!=(const cvector& v1, const scvector& v2) {
01167   return !fsp_vv_comp(v1,v2);
01168 }
01169 
01171 
01174 inline bool operator!=(const scvector& v1, const rvector_slice& v2) {
01175   return !spf_vv_comp(v1,v2);
01176 }
01177 
01179 
01182 inline bool operator!=(const srvector& v1, const cvector_slice& v2) {
01183   return !spf_vv_comp(v1,v2);
01184 }
01185 
01187 
01190 inline bool operator!=(const scvector& v1, const cvector_slice& v2) {
01191   return !spf_vv_comp(v1,v2);
01192 }
01193 
01195 
01198 inline bool operator!=(const cvector_slice& v1, const srvector& v2) {
01199   return !fsp_vv_comp(v1,v2);
01200 }
01201 
01203 
01206 inline bool operator!=(const rvector_slice& v1, const scvector& v2) {
01207   return !fsp_vv_comp(v1,v2);
01208 }
01209 
01211 
01214 inline bool operator!=(const cvector_slice& v1, const scvector& v2) {
01215   return !fsp_vv_comp(v1,v2);
01216 }
01217 
01219 
01224 inline std::ostream& operator<<(std::ostream& os, const scvector& v) {
01225   return sp_v_output<scvector,complex>(os,v);
01226 }
01227 
01229 
01234 inline std::istream& operator>>(std::istream& is, scvector& v) {
01235   return sp_v_input<scvector,complex>(is,v);
01236 }
01237 
01238 
01240 
01245 class scvector_slice {
01246   private:
01247     std::vector<int>& p;
01248     std::vector<complex>& x;
01249     scvector& orig;
01250     int start,end;
01251     int lb;
01252     int ub;
01253     int n;
01254     int nnz;
01255     int offset;
01256 
01258 
01262     scvector_slice(scvector& v, int l, int u) : p(v.p), x(v.x), orig(v), lb(l), ub(u), n(u-l+1)  {
01263       int i;
01264 
01265       for(i=0 ; i<v.get_nnz() && p[i]<lb-v.lb ; i++);
01266 
01267       start = i;
01268 
01269       for(i=start ; i<v.get_nnz() && p[i]<=ub-v.lb ; i++);
01270 
01271       end = i-1;
01272 
01273       nnz = end-start+1;
01274       offset = lb-v.lb;
01275     }
01276 
01277   public:
01278 
01280     int get_nnz() const {
01281       return nnz;
01282     }
01283 
01285     real density() const {
01286       return (double)nnz/n;
01287     }
01288 
01290 
01294     complex& operator[](const int i) {
01295 #if(CXSC_INDEX_CHECK)
01296       if(i<lb || i>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector_slice::operator[](const int)"));
01297 #endif
01298       int k;
01299 
01300       for(k=start ; k<end+1 && p[k]-start<=i-lb ; k++) {
01301         if(p[k]-offset == i-lb) 
01302           return x[k];
01303       }
01304 
01305       p.insert(p.begin() + k, i-lb);
01306       x.insert(x.begin() + k, complex(0.0));
01307       end++;
01308 
01309       return x[k];
01310     }
01311 
01313 
01317     complex operator[](const int i) const {
01318 #if(CXSC_INDEX_CHECK)
01319       if(i<lb || i>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector_slice::operator[](const int)"));
01320 #endif
01321       return (*this)(i);
01322     }
01323 
01325 
01329     const complex operator()(const int i) const {
01330 #if(CXSC_INDEX_CHECK)
01331       if(i<lb || i>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector_slice::operator()(const int)"));
01332 #endif
01333       complex r(0.0);
01334 
01335       for(int k=start ; k<end && p[k]-start<=i-lb ; k++) {
01336         if(p[k]-start == i-lb) 
01337           r = x[k];
01338       }
01339 
01340       return r; 
01341     }
01342 
01344     scvector_slice& operator=(const real& v) {
01345       return sl_vs_assign<scvector_slice,real,complex,std::vector<complex>::iterator>(*this,v);
01346     }
01347 
01349     scvector_slice& operator=(const complex& v) {
01350       return sl_vs_assign<scvector_slice,complex,complex,std::vector<complex>::iterator>(*this,v);
01351     }
01352 
01354     scvector_slice& operator=(const srvector_slice& v) {
01355       return slsl_vv_assign<scvector_slice,srvector_slice,complex,std::vector<complex>::iterator>(*this,v);
01356     }
01357 
01359     scvector_slice& operator=(const scvector_slice& v) {
01360       return slsl_vv_assign<scvector_slice,scvector_slice,complex,std::vector<complex>::iterator>(*this,v);
01361     }
01362 
01364     scvector_slice& operator=(const srvector& v) {
01365       return slsp_vv_assign<scvector_slice,srvector,complex,std::vector<complex>::iterator>(*this,v);
01366     }
01367 
01369     scvector_slice& operator=(const scvector& v) {
01370       return slsp_vv_assign<scvector_slice,scvector,complex,std::vector<complex>::iterator>(*this,v);
01371     }
01372 
01374     scvector_slice& operator=(const rvector& v) {
01375       return slf_vv_assign<scvector_slice,rvector,complex,std::vector<complex>::iterator>(*this,v);
01376     }
01377 
01379     scvector_slice& operator=(const cvector& v) {
01380       return slf_vv_assign<scvector_slice,cvector,complex,std::vector<complex>::iterator>(*this,v);
01381     }
01382 
01384     scvector_slice& operator=(const rvector_slice& v) {
01385       return slf_vv_assign<scvector_slice,rvector_slice,complex,std::vector<complex>::iterator>(*this,v);
01386     }
01387 
01389     scvector_slice& operator=(const cvector_slice& v) {
01390       return slf_vv_assign<scvector_slice,cvector_slice,complex,std::vector<complex>::iterator>(*this,v);
01391     }
01392 
01394     scvector_slice& operator*=(const real& s) {
01395       return sl_vs_multassign(*this,s);
01396     }
01397 
01399     scvector_slice& operator*=(const complex& s) {
01400       return sl_vs_multassign(*this,s);
01401     }
01402 
01404     scvector_slice& operator/=(const real& s) {
01405       return sl_vs_divassign(*this,s);
01406     }
01407 
01409     scvector_slice& operator/=(const complex& s) {
01410       return sl_vs_divassign(*this,s);
01411     }
01412 
01414     scvector_slice& operator+=(const rvector& v) {
01415       return slf_vv_addassign<scvector_slice,rvector,complex>(*this,v);
01416     }
01417 
01419     scvector_slice& operator+=(const cvector& v) {
01420       return slf_vv_addassign<scvector_slice,cvector,complex>(*this,v);
01421     }
01422 
01424     scvector_slice& operator+=(const rvector_slice& v) {
01425       return slf_vv_addassign<scvector_slice,rvector_slice,complex>(*this,v);
01426     }
01427 
01429     scvector_slice& operator+=(const cvector_slice& v) {
01430       return slf_vv_addassign<scvector_slice,cvector_slice,complex>(*this,v);
01431     }
01432 
01434     scvector_slice& operator+=(const srvector& v) {
01435       return slsp_vv_addassign(*this,v);
01436     }
01437 
01439     scvector_slice& operator+=(const scvector& v) {
01440       return slsp_vv_addassign(*this,v);
01441     }
01442 
01444     scvector_slice& operator+=(const srvector_slice& v) {
01445       return slsl_vv_addassign(*this,v);
01446     }
01447 
01449     scvector_slice& operator+=(const scvector_slice& v) {
01450       return slsl_vv_addassign(*this,v);
01451     }
01452 
01454     scvector_slice& operator-=(const rvector& v) {
01455       return slf_vv_subassign<scvector_slice,rvector,complex>(*this,v);
01456     }
01457 
01459     scvector_slice& operator-=(const cvector& v) {
01460       return slf_vv_subassign<scvector_slice,cvector,complex>(*this,v);
01461     }
01462 
01464     scvector_slice& operator-=(const rvector_slice& v) {
01465       return slf_vv_subassign<scvector_slice,rvector_slice,complex>(*this,v);
01466     }
01467 
01469     scvector_slice& operator-=(const cvector_slice& v) {
01470       return slf_vv_subassign<scvector_slice,cvector_slice,complex>(*this,v);
01471     }
01472 
01474     scvector_slice& operator-=(const srvector& v) {
01475       return slsp_vv_subassign(*this,v);
01476     }
01477 
01479     scvector_slice& operator-=(const scvector& v) {
01480       return slsp_vv_subassign(*this,v);
01481     }
01482 
01484     scvector_slice& operator-=(const srvector_slice& v) {
01485       return slsl_vv_subassign(*this,v);
01486     }
01487 
01489     scvector_slice& operator-=(const scvector_slice& v) {
01490       return slsl_vv_subassign(*this,v);
01491     }
01492 
01493     friend int Lb(const scvector_slice&);
01494     friend int Ub(const scvector_slice&);
01495     friend srvector Re(const scvector_slice&);
01496     friend srvector Im(const scvector_slice&);
01497     friend int VecLen(const scvector_slice&);
01498 
01499 //     friend srvector operator*(const srmatrix&, const srvector_slice&); //ok
01500 //     friend srvector operator*(const srmatrix_slice&, const srvector_slice&); //ok
01501 
01502     friend class srvector;
01503     friend class scvector;
01504     friend class scivector;
01505     friend class cvector;
01506     friend class cvector_slice;
01507     friend class civector;
01508     friend class civector_slice;
01509 
01510 #include "vector_friend_declarations.inl"
01511 };
01512 
01513 inline cvector::cvector(const scvector_slice& v) {
01514   l = v.lb;
01515   u = v.ub;
01516   size = v.n;
01517   dat = new complex[v.n];
01518   for(int i=0 ; i<v.n ; i++)
01519     dat[i] = 0.0;
01520   for(int i=v.start ; i<=v.end ; i++)
01521     dat[v.p[i]] = v.x[i];
01522 }
01523 
01524 inline cvector::cvector(const srvector_slice& v) {
01525   l = v.lb;
01526   u = v.ub;
01527   size = v.n;
01528   dat = new complex[v.n];
01529   for(int i=0 ; i<v.n ; i++)
01530     dat[i] = 0.0;
01531   for(int i=v.start ; i<=v.end ; i++)
01532     dat[v.p[i]] = v.x[i];
01533 }
01534 
01535 inline cvector_slice& cvector_slice::operator=(const srvector& v) {
01536   *this = rvector(v);
01537   return *this;
01538 }
01539 
01540 inline cvector_slice& cvector_slice::operator=(const srvector_slice& v) {
01541   *this = rvector(v);
01542   return *this;
01543 }
01544 
01545 inline cvector_slice& cvector_slice::operator=(const scvector& v) {
01546   *this = cvector(v);
01547   return *this;
01548 }
01549 
01550 inline cvector_slice& cvector_slice::operator=(const scvector_slice& v) {
01551   *this = cvector(v);
01552   return *this;
01553 }
01554 
01555 inline scvector::scvector(const srvector_slice& s) : lb(s.lb), ub(s.ub), n(s.n)  {
01556   p.reserve(s.nnz);
01557   x.reserve(s.nnz);
01558 
01559   for(int i=s.start ; i<=s.end ; i++) {
01560     p.push_back(s.p[i]-s.offset);
01561     x.push_back(complex(s.x[i]));
01562   }
01563 
01564 }
01565 
01566 inline scvector::scvector(const scvector_slice& s) : lb(s.lb), ub(s.ub), n(s.n) {
01567   p.reserve(s.nnz);
01568   x.reserve(s.nnz);
01569 
01570   for(int i=s.start ; i<=s.end ; i++) {
01571     p.push_back(s.p[i]-s.offset);
01572     x.push_back(s.x[i]);
01573   }
01574 
01575 }
01576 
01577 inline scvector& scvector::operator=(const srvector_slice& v) {
01578   return spsl_vv_assign<scvector,srvector_slice,complex>(*this,v);
01579 }
01580 
01581 inline scvector& scvector::operator=(const scvector_slice& v) {
01582   return spsl_vv_assign<scvector,scvector_slice,complex>(*this,v);
01583 }
01584 
01585 inline scvector_slice scvector::operator()(const int i, const int j) {
01586 #if(CXSC_INDEX_CHECK)
01587   if(i<lb || j>ub) cxscthrow(ELEMENT_NOT_IN_VEC("scvector_slice::operator()(const int, const int)"));
01588 #endif
01589   return scvector_slice(*this,i,j);
01590 }
01591 
01593 inline scvector operator-(const scvector_slice& v) {
01594   return sl_v_negative<scvector_slice,scvector>(v);
01595 }
01596 
01598 inline int Lb(const scvector_slice& v) {
01599   return v.lb;
01600 }
01601 
01603 inline int Ub(const scvector_slice& v) {
01604   return v.ub;
01605 }
01606 
01608 inline srvector Re(const scvector_slice& v) {
01609   return Re(scvector(v));
01610 }
01611 
01613 inline srvector Im(const scvector_slice& v) {
01614   return Im(scvector(v));
01615 }
01616 
01618 inline int VecLen(const scvector_slice& v) {
01619   return v.n;
01620 }
01621 
01623 
01629 inline complex operator*(const scvector_slice& v1, const rvector& v2) {
01630   return slf_vv_mult<scvector_slice,rvector,complex,sparse_cdot>(v1,v2);
01631 }
01632 
01634 
01640 inline complex operator*(const srvector_slice& v1, const cvector& v2) {
01641   return slf_vv_mult<srvector_slice,cvector,complex,sparse_cdot>(v1,v2);
01642 }
01643 
01645 
01651 inline complex operator*(const scvector_slice& v1, const cvector& v2) {
01652   return slf_vv_mult<scvector_slice,cvector,complex,sparse_cdot>(v1,v2);
01653 }
01654 
01656 
01662 inline complex operator*(const cvector& v1, const srvector_slice& v2) {
01663   return fsl_vv_mult<cvector,srvector_slice,complex,sparse_cdot>(v1,v2);
01664 }
01665 
01667 
01673 inline complex operator*(const rvector& v1, const scvector_slice& v2) {
01674   return fsl_vv_mult<rvector,scvector_slice,complex,sparse_cdot>(v1,v2);
01675 }
01676 
01678 
01684 inline complex operator*(const cvector& v1, const scvector_slice& v2) {
01685   return fsl_vv_mult<cvector,scvector_slice,complex,sparse_cdot>(v1,v2);
01686 }
01687 
01689 
01695 inline complex operator*(const scvector_slice& v1, const rvector_slice& v2) {
01696   return slf_vv_mult<scvector_slice,rvector_slice,complex,sparse_cdot>(v1,v2);
01697 }
01698 
01700 
01706 inline complex operator*(const srvector_slice& v1, const cvector_slice& v2) {
01707   return slf_vv_mult<srvector_slice,cvector_slice,complex,sparse_cdot>(v1,v2);
01708 }
01709 
01711 
01717 inline complex operator*(const scvector_slice& v1, const cvector_slice& v2) {
01718   return slf_vv_mult<scvector_slice,cvector_slice,complex,sparse_cdot>(v1,v2);
01719 }
01720 
01722 
01728 inline complex operator*(const cvector_slice& v1, const srvector_slice& v2) {
01729   return fsl_vv_mult<cvector_slice,srvector_slice,complex,sparse_cdot>(v1,v2);
01730 }
01731 
01733 
01739 inline complex operator*(const rvector_slice& v1, const scvector_slice& v2) {
01740   return fsl_vv_mult<rvector_slice,scvector_slice,complex,sparse_cdot>(v1,v2);
01741 }
01742 
01744 
01750 inline complex operator*(const cvector_slice& v1, const scvector_slice& v2) {
01751   return fsl_vv_mult<cvector_slice,scvector_slice,complex,sparse_cdot>(v1,v2);
01752 }
01753 
01755 
01761 inline complex operator*(const scvector& v1, const srvector_slice& v2) {
01762   return spsl_vv_mult<scvector,srvector_slice,complex,sparse_cdot>(v1,v2);
01763 }
01764 
01766 
01772 inline complex operator*(const srvector& v1, const scvector_slice& v2) {
01773   return spsl_vv_mult<srvector,scvector_slice,complex,sparse_cdot>(v1,v2);
01774 }
01775 
01777 
01783 inline complex operator*(const scvector& v1, const scvector_slice& v2) {
01784   return spsl_vv_mult<scvector,scvector_slice,complex,sparse_cdot>(v1,v2);
01785 }
01786 
01788 
01794 inline complex operator*(const scvector_slice& v1, const srvector& v2) {
01795   return slsp_vv_mult<scvector_slice,srvector,complex,sparse_cdot>(v1,v2);
01796 }
01797 
01799 
01805 inline complex operator*(const srvector_slice& v1, const scvector& v2) {
01806   return slsp_vv_mult<srvector_slice,scvector,complex,sparse_cdot>(v1,v2);
01807 }
01808 
01810 
01816 inline complex operator*(const scvector_slice& v1, const scvector& v2) {
01817   return slsp_vv_mult<scvector_slice,scvector,complex,sparse_cdot>(v1,v2);
01818 }
01819 
01821 
01827 inline complex operator*(const scvector_slice& v1, const srvector_slice& v2) {
01828   return slsl_vv_mult<scvector_slice,srvector_slice,complex,sparse_cdot>(v1,v2);
01829 }
01830 
01832 
01838 inline complex operator*(const srvector_slice& v1, const scvector_slice& v2) {
01839   return slsl_vv_mult<srvector_slice,scvector_slice,complex,sparse_cdot>(v1,v2);
01840 }
01841 
01843 
01849 inline complex operator*(const scvector_slice& v1, const scvector_slice& v2) {
01850   return slsl_vv_mult<scvector_slice,scvector_slice,complex,sparse_cdot>(v1,v2);
01851 }
01852 
01854 inline scvector operator*(const scvector_slice& v, const real& s) {
01855   return sp_vs_mult<scvector_slice,real,scvector>(v,s);
01856 }
01857 
01859 inline scvector operator*(const scvector_slice& v, const complex& s) {
01860   return sp_vs_mult<scvector_slice,complex,scvector>(v,s);
01861 }
01862 
01864 inline scvector operator*(const srvector_slice& v, const complex& s) {
01865   return sp_vs_mult<srvector_slice,complex,scvector>(v,s);
01866 }
01867 
01869 inline scvector operator/(const scvector_slice& v, const real& s) {
01870   return sp_vs_div<scvector_slice,real,scvector>(v,s);
01871 }
01872 
01874 inline scvector operator/(const scvector_slice& v, const complex& s) {
01875   return sp_vs_div<scvector_slice,complex,scvector>(v,s);
01876 }
01877 
01879 inline scvector operator/(const srvector_slice& v, const complex& s) {
01880   return sp_vs_div<srvector_slice,complex,scvector>(v,s);
01881 }
01882 
01884 inline scvector operator*(const real& s, const scvector_slice& v) {
01885   return sp_sv_mult<real,scvector_slice,scvector>(s,v);
01886 }
01887 
01889 inline scvector operator*(const complex& s, const scvector_slice& v) {
01890   return sp_sv_mult<complex,scvector_slice,scvector>(s,v);
01891 }
01892 
01894 inline scvector operator*(const complex& s, const srvector_slice& v) {
01895   return sp_sv_mult<complex,srvector_slice,scvector>(s,v);
01896 }
01897 
01899 inline cvector operator+(const cvector& v1, const srvector_slice& v2) {
01900   return fsl_vv_add<cvector,srvector_slice,cvector>(v1,v2);
01901 }
01902 
01904 inline cvector operator+(const rvector& v1, const scvector_slice& v2) {
01905   return fsl_vv_add<rvector,scvector_slice,cvector>(v1,v2);
01906 }
01907 
01909 inline cvector operator+(const cvector& v1, const scvector_slice& v2) {
01910   return fsl_vv_add<cvector,scvector_slice,cvector>(v1,v2);
01911 }
01912 
01914 inline cvector operator+(const scvector_slice& v1, const rvector& v2) {
01915   return slf_vv_add<scvector_slice,rvector,cvector>(v1,v2);
01916 }
01917 
01919 inline cvector operator+(const srvector_slice& v1, const cvector& v2) {
01920   return slf_vv_add<srvector_slice,cvector,cvector>(v1,v2);
01921 }
01922 
01924 inline cvector operator+(const scvector_slice& v1, const cvector& v2) {
01925   return slf_vv_add<scvector_slice,cvector,cvector>(v1,v2);
01926 }
01927 
01929 inline cvector operator+(const cvector_slice& v1, const srvector_slice& v2) {
01930   return fsl_vv_add<cvector_slice,srvector_slice,cvector>(v1,v2);
01931 }
01932 
01934 inline cvector operator+(const rvector_slice& v1, const scvector_slice& v2) {
01935   return fsl_vv_add<rvector_slice,scvector_slice,cvector>(v1,v2);
01936 }
01937 
01939 inline cvector operator+(const cvector_slice& v1, const scvector_slice& v2) {
01940   return fsl_vv_add<cvector_slice,scvector_slice,cvector>(v1,v2);
01941 }
01942 
01944 inline cvector operator+(const scvector_slice& v1, const rvector_slice& v2) {
01945   return slf_vv_add<scvector_slice,rvector_slice,cvector>(v1,v2);
01946 }
01947 
01949 inline cvector operator+(const srvector_slice& v1, const cvector_slice& v2) {
01950   return slf_vv_add<srvector_slice,cvector_slice,cvector>(v1,v2);
01951 }
01952 
01954 inline cvector operator+(const scvector_slice& v1, const cvector_slice& v2) {
01955   return slf_vv_add<scvector_slice,cvector_slice,cvector>(v1,v2);
01956 }
01957 
01959 inline scvector operator+(const scvector_slice& v1, const srvector_slice& v2) {
01960   return slsl_vv_add<scvector_slice,srvector_slice,scvector,complex>(v1,v2);
01961 }
01962 
01964 inline scvector operator+(const srvector_slice& v1, const scvector_slice& v2) {
01965   return slsl_vv_add<srvector_slice,scvector_slice,scvector,complex>(v1,v2);
01966 }
01967 
01969 inline scvector operator+(const scvector_slice& v1, const scvector_slice& v2) {
01970   return slsl_vv_add<scvector_slice,scvector_slice,scvector,complex>(v1,v2);
01971 }
01972 
01974 inline scvector operator+(const scvector& v1, const srvector_slice& v2) {
01975   return spsl_vv_add<scvector,srvector_slice,scvector,complex>(v1,v2);
01976 }
01977 
01979 inline scvector operator+(const srvector& v1, const scvector_slice& v2) {
01980   return spsl_vv_add<srvector,scvector_slice,scvector,complex>(v1,v2);
01981 }
01982 
01984 inline scvector operator+(const scvector& v1, const scvector_slice& v2) {
01985   return spsl_vv_add<scvector,scvector_slice,scvector,complex>(v1,v2);
01986 }
01987 
01989 inline scvector operator+(const scvector_slice& v1, const srvector& v2) {
01990   return slsp_vv_add<scvector_slice,srvector,scvector,complex>(v1,v2);
01991 }
01992 
01994 inline scvector operator+(const srvector_slice& v1, const scvector& v2) {
01995   return slsp_vv_add<srvector_slice,scvector,scvector,complex>(v1,v2);
01996 }
01997 
01999 inline scvector operator+(const scvector_slice& v1, const scvector& v2) {
02000   return slsp_vv_add<scvector_slice,scvector,scvector,complex>(v1,v2);
02001 }
02002 
02004 inline cvector operator-(const cvector& v1, const srvector_slice& v2) {
02005   return fsl_vv_sub<cvector,srvector_slice,cvector>(v1,v2);
02006 }
02007 
02009 inline cvector operator-(const rvector& v1, const scvector_slice& v2) {
02010   return fsl_vv_sub<rvector,scvector_slice,cvector>(v1,v2);
02011 }
02012 
02014 inline cvector operator-(const cvector& v1, const scvector_slice& v2) {
02015   return fsl_vv_sub<cvector,scvector_slice,cvector>(v1,v2);
02016 }
02017 
02019 inline cvector operator-(const scvector_slice& v1, const rvector& v2) {
02020   return slf_vv_sub<scvector_slice,rvector,cvector>(v1,v2);
02021 }
02022 
02024 inline cvector operator-(const srvector_slice& v1, const cvector& v2) {
02025   return slf_vv_sub<srvector_slice,cvector,cvector>(v1,v2);
02026 }
02027 
02029 inline cvector operator-(const scvector_slice& v1, const cvector& v2) {
02030   return slf_vv_sub<scvector_slice,cvector,cvector>(v1,v2);
02031 }
02032 
02034 inline cvector operator-(const cvector_slice& v1, const srvector_slice& v2) {
02035   return fsl_vv_sub<cvector_slice,srvector_slice,cvector>(v1,v2);
02036 }
02037 
02039 inline cvector operator-(const rvector_slice& v1, const scvector_slice& v2) {
02040   return fsl_vv_sub<rvector_slice,scvector_slice,cvector>(v1,v2);
02041 }
02042 
02044 inline cvector operator-(const cvector_slice& v1, const scvector_slice& v2) {
02045   return fsl_vv_sub<cvector_slice,scvector_slice,cvector>(v1,v2);
02046 }
02047 
02049 inline cvector operator-(const scvector_slice& v1, const rvector_slice& v2) {
02050   return slf_vv_sub<scvector_slice,rvector_slice,cvector>(v1,v2);
02051 }
02052 
02054 inline cvector operator-(const srvector_slice& v1, const cvector_slice& v2) {
02055   return slf_vv_sub<srvector_slice,cvector_slice,cvector>(v1,v2);
02056 }
02057 
02059 inline cvector operator-(const scvector_slice& v1, const cvector_slice& v2) {
02060   return slf_vv_sub<scvector_slice,cvector_slice,cvector>(v1,v2);
02061 }
02062 
02064 inline scvector operator-(const scvector_slice& v1, const srvector_slice& v2) {
02065   return slsl_vv_sub<scvector_slice,srvector_slice,scvector,complex>(v1,v2);
02066 }
02067 
02069 inline scvector operator-(const srvector_slice& v1, const scvector_slice& v2) {
02070   return slsl_vv_sub<srvector_slice,scvector_slice,scvector,complex>(v1,v2);
02071 }
02072 
02074 inline scvector operator-(const scvector_slice& v1, const scvector_slice& v2) {
02075   return slsl_vv_sub<scvector_slice,scvector_slice,scvector,complex>(v1,v2);
02076 }
02077 
02079 inline scvector operator-(const scvector& v1, const srvector_slice& v2) {
02080   return spsl_vv_sub<scvector,srvector_slice,scvector,complex>(v1,v2);
02081 }
02082 
02084 inline scvector operator-(const srvector& v1, const scvector_slice& v2) {
02085   return spsl_vv_sub<srvector,scvector_slice,scvector,complex>(v1,v2);
02086 }
02087 
02089 inline scvector operator-(const scvector& v1, const scvector_slice& v2) {
02090   return spsl_vv_sub<scvector,scvector_slice,scvector,complex>(v1,v2);
02091 }
02092 
02094 inline scvector operator-(const scvector_slice& v1, const srvector& v2) {
02095   return slsp_vv_sub<scvector_slice,srvector,scvector,complex>(v1,v2);
02096 }
02097 
02099 inline scvector operator-(const srvector_slice& v1, const scvector& v2) {
02100   return slsp_vv_sub<srvector_slice,scvector,scvector,complex>(v1,v2);
02101 }
02102 
02104 inline scvector operator-(const scvector_slice& v1, const scvector& v2) {
02105   return slsp_vv_sub<scvector_slice,scvector,scvector,complex>(v1,v2);
02106 }
02107 
02108 inline cvector& cvector::operator+=(const srvector_slice& v2) {
02109   return fsl_vv_addassign(*this,v2);
02110 }
02111 
02112 inline cvector& cvector::operator+=(const scvector_slice& v2) {
02113   return fsl_vv_addassign(*this,v2);
02114 }
02115 
02116 inline cvector_slice& cvector_slice::operator+=(const srvector_slice& v2) {
02117   return fsl_vv_addassign(*this,v2);
02118 }
02119 
02120 inline cvector_slice& cvector_slice::operator+=(const scvector_slice& v2) {
02121   return fsl_vv_addassign(*this,v2);
02122 }
02123 
02124 inline scvector& scvector::operator+=(const srvector_slice& v2) {
02125   return spsl_vv_addassign(*this,v2);
02126 }
02127 
02128 inline scvector& scvector::operator+=(const scvector_slice& v2) {
02129   return spsl_vv_addassign(*this,v2);
02130 }
02131 
02132 inline cvector& cvector::operator-=(const srvector_slice& v2) {
02133   return fsl_vv_subassign(*this,v2);
02134 }
02135 
02136 inline cvector& cvector::operator-=(const scvector_slice& v2) {
02137   return fsl_vv_subassign(*this,v2);
02138 }
02139 
02140 inline cvector_slice& cvector_slice::operator-=(const srvector_slice& v2) {
02141   return fsl_vv_subassign(*this,v2);
02142 }
02143 
02144 inline cvector_slice& cvector_slice::operator-=(const scvector_slice& v2) {
02145   return fsl_vv_subassign(*this,v2);
02146 }
02147 
02148 inline scvector& scvector::operator-=(const srvector_slice& v2) {
02149   return spsl_vv_subassign(*this,v2);
02150 }
02151 
02152 inline scvector& scvector::operator-=(const scvector_slice& v2) {
02153   return spsl_vv_subassign(*this,v2);
02154 }
02155 
02157 
02160 inline bool operator==(const scvector_slice& v1, const srvector_slice& v2) {
02161   return slsl_vv_comp(v1,v2);
02162 }
02163 
02165 
02168 inline bool operator==(const srvector_slice& v1, const scvector_slice& v2) {
02169   return slsl_vv_comp(v1,v2);
02170 }
02171 
02173 
02176 inline bool operator==(const scvector_slice& v1, const scvector_slice& v2) {
02177   return slsl_vv_comp(v1,v2);
02178 }
02179 
02181 
02184 inline bool operator==(const scvector_slice& v1, const srvector& v2) {
02185   return slsp_vv_comp(v1,v2);
02186 }
02187 
02189 
02192 inline bool operator==(const srvector_slice& v1, const scvector& v2) {
02193   return slsp_vv_comp(v1,v2);
02194 }
02195 
02197 
02200 inline bool operator==(const scvector_slice& v1, const scvector& v2) {
02201   return slsp_vv_comp(v1,v2);
02202 }
02203 
02205 
02208 inline bool operator==(const scvector& v1, const srvector_slice& v2) {
02209   return spsl_vv_comp(v1,v2);
02210 }
02211 
02213 
02216 inline bool operator==(const srvector& v1, const scvector_slice& v2) {
02217   return spsl_vv_comp(v1,v2);
02218 }
02219 
02221 
02224 inline bool operator==(const scvector& v1, const scvector_slice& v2) {
02225   return spsl_vv_comp(v1,v2);
02226 }
02227 
02229 
02232 inline bool operator==(const scvector_slice& v1, const rvector& v2) {
02233   return slf_vv_comp(v1,v2);
02234 }
02235 
02237 
02240 inline bool operator==(const srvector_slice& v1, const cvector& v2) {
02241   return slf_vv_comp(v1,v2);
02242 }
02243 
02245 
02248 inline bool operator==(const scvector_slice& v1, const cvector& v2) {
02249   return slf_vv_comp(v1,v2);
02250 }
02251 
02253 
02256 inline bool operator==(const cvector& v1, const srvector_slice& v2) {
02257   return fsl_vv_comp(v1,v2);
02258 }
02259 
02261 
02264 inline bool operator==(const rvector& v1, const scvector_slice& v2) {
02265   return fsl_vv_comp(v1,v2);
02266 }
02267 
02269 
02272 inline bool operator==(const cvector& v1, const scvector_slice& v2) {
02273   return fsl_vv_comp(v1,v2);
02274 }
02275 
02277 
02280 inline bool operator==(const scvector_slice& v1, const rvector_slice& v2) {
02281   return slf_vv_comp(v1,v2);
02282 }
02283 
02285 
02288 inline bool operator==(const srvector_slice& v1, const cvector_slice& v2) {
02289   return slf_vv_comp(v1,v2);
02290 }
02291 
02293 
02296 inline bool operator==(const scvector_slice& v1, const cvector_slice& v2) {
02297   return slf_vv_comp(v1,v2);
02298 }
02299 
02301 
02304 inline bool operator==(const cvector_slice& v1, const srvector_slice& v2) {
02305   return fsl_vv_comp(v1,v2);
02306 }
02307 
02309 
02312 inline bool operator==(const rvector_slice& v1, const scvector_slice& v2) {
02313   return fsl_vv_comp(v1,v2);
02314 }
02315 
02317 
02320 inline bool operator==(const cvector_slice& v1, const scvector_slice& v2) {
02321   return fsl_vv_comp(v1,v2);
02322 }
02323 
02325 
02328 inline bool operator!=(const scvector_slice& v1, const srvector_slice& v2) {
02329   return !slsl_vv_comp(v1,v2);
02330 }
02331 
02333 
02336 inline bool operator!=(const srvector_slice& v1, const scvector_slice& v2) {
02337   return !slsl_vv_comp(v1,v2);
02338 }
02339 
02341 
02344 inline bool operator!=(const scvector_slice& v1, const scvector_slice& v2) {
02345   return !slsl_vv_comp(v1,v2);
02346 }
02347 
02349 
02352 inline bool operator!=(const scvector_slice& v1, const rvector& v2) {
02353   return !slf_vv_comp(v1,v2);
02354 }
02355 
02357 
02360 inline bool operator!=(const srvector_slice& v1, const cvector& v2) {
02361   return !slf_vv_comp(v1,v2);
02362 }
02363 
02365 
02368 inline bool operator!=(const scvector_slice& v1, const cvector& v2) {
02369   return !slf_vv_comp(v1,v2);
02370 }
02371 
02373 
02376 inline bool operator!=(const cvector& v1, const srvector_slice& v2) {
02377   return !fsl_vv_comp(v1,v2);
02378 }
02379 
02381 
02384 inline bool operator!=(const rvector& v1, const scvector_slice& v2) {
02385   return !fsl_vv_comp(v1,v2);
02386 }
02387 
02389 
02392 inline bool operator!=(const cvector& v1, const scvector_slice& v2) {
02393   return !fsl_vv_comp(v1,v2);
02394 }
02395 
02397 
02400 inline bool operator!=(const scvector_slice& v1, const srvector& v2) {
02401   return !slsp_vv_comp(v1,v2);
02402 }
02403 
02405 
02408 inline bool operator!=(const srvector_slice& v1, const scvector& v2) {
02409   return !slsp_vv_comp(v1,v2);
02410 }
02411 
02413 
02416 inline bool operator!=(const scvector_slice& v1, const scvector& v2) {
02417   return !slsp_vv_comp(v1,v2);
02418 }
02419 
02421 
02424 inline bool operator!=(const scvector& v1, const srvector_slice& v2) {
02425   return !spsl_vv_comp(v1,v2);
02426 }
02427 
02429 
02432 inline bool operator!=(const srvector& v1, const scvector_slice& v2) {
02433   return !spsl_vv_comp(v1,v2);
02434 }
02435 
02437 
02440 inline bool operator!=(const scvector& v1, const scvector_slice& v2) {
02441   return !spsl_vv_comp(v1,v2);
02442 }
02443 
02445 
02448 inline bool operator!=(const scvector_slice& v1, const rvector_slice& v2) {
02449   return !slf_vv_comp(v1,v2);
02450 }
02451 
02453 
02456 inline bool operator!=(const srvector_slice& v1, const cvector_slice& v2) {
02457   return !slf_vv_comp(v1,v2);
02458 }
02459 
02461 
02464 inline bool operator!=(const scvector_slice& v1, const cvector_slice& v2) {
02465   return !slf_vv_comp(v1,v2);
02466 }
02467 
02469 
02472 inline bool operator!=(const cvector_slice& v1, const srvector_slice& v2) {
02473   return !fsl_vv_comp(v1,v2);
02474 }
02475 
02477 
02480 inline bool operator!=(const rvector_slice& v1, const scvector_slice& v2) {
02481   return !fsl_vv_comp(v1,v2);
02482 }
02483 
02485 
02488 inline bool operator!=(const cvector_slice& v1, const scvector_slice& v2) {
02489   return !fsl_vv_comp(v1,v2);
02490 }
02491 
02493 
02498 inline std::ostream& operator<<(std::ostream& os, const scvector_slice& v) {
02499   return sl_v_output<scvector_slice,complex>(os,v);
02500 }
02501 
02503 
02508 inline std::istream& operator>>(std::istream& is, scvector_slice& v) {
02509   return sl_v_input<scvector_slice,complex>(is,v);
02510 }
02511 
02513 
02516 inline void accumulate(cdotprecision& dot, const scvector& x, const scvector& y) {
02517   spsp_vv_accu<cdotprecision,scvector,scvector,sparse_cdot>(dot,x,y);
02518 }
02519 
02521 
02524 inline void accumulate(cdotprecision& dot, const scvector& x, const srvector& y) {
02525   spsp_vv_accu<cdotprecision,scvector,srvector,sparse_cdot>(dot,x,y);
02526 }
02527 
02529 
02532 inline void accumulate(cdotprecision& dot, const srvector& x, const scvector& y) {
02533   spsp_vv_accu<cdotprecision,srvector,scvector,sparse_cdot>(dot,x,y);
02534 }
02535 
02537 
02540 inline void accumulate(cdotprecision& dot, const scvector& x, const cvector& y) {
02541   spf_vv_accu<cdotprecision,scvector,cvector,sparse_cdot>(dot,x,y);
02542 }
02543 
02545 
02548 inline void accumulate(cdotprecision& dot, const scvector& x, const rvector& y) {
02549   spf_vv_accu<cdotprecision,scvector,rvector,sparse_cdot>(dot,x,y);
02550 }
02551 
02553 
02556 inline void accumulate(cdotprecision& dot, const srvector& x, const cvector& y) {
02557   spf_vv_accu<cdotprecision,srvector,cvector,sparse_cdot>(dot,x,y);
02558 }
02559 
02561 
02564 inline void accumulate(cdotprecision& dot, const scvector& x, const cvector_slice& y) {
02565   spf_vv_accu<cdotprecision,scvector,cvector_slice,sparse_cdot>(dot,x,y);
02566 }
02567 
02569 
02572 inline void accumulate(cdotprecision& dot, const scvector& x, const rvector_slice& y) {
02573   spf_vv_accu<cdotprecision,scvector,rvector_slice,sparse_cdot>(dot,x,y);
02574 }
02575 
02577 
02580 inline void accumulate(cdotprecision& dot, const srvector& x, const cvector_slice& y) {
02581   spf_vv_accu<cdotprecision,srvector,cvector_slice,sparse_cdot>(dot,x,y);
02582 }
02583 
02585 
02588 inline void accumulate(cdotprecision& dot, const cvector& x, const scvector& y) {
02589   fsp_vv_accu<cdotprecision,cvector,scvector,sparse_cdot>(dot,x,y);
02590 }
02591 
02593 
02596 inline void accumulate(cdotprecision& dot, const cvector& x, const srvector& y) {
02597   fsp_vv_accu<cdotprecision,cvector,srvector,sparse_cdot>(dot,x,y);
02598 }
02599 
02601 
02604 inline void accumulate(cdotprecision& dot, const rvector& x, const scvector& y) {
02605   fsp_vv_accu<cdotprecision,rvector,scvector,sparse_cdot>(dot,x,y);
02606 }
02607 
02609 
02612 inline void accumulate(cdotprecision& dot, const cvector_slice& x, const scvector& y) {
02613   fsp_vv_accu<cdotprecision,cvector_slice,scvector,sparse_cdot>(dot,x,y);
02614 }
02615 
02617 
02620 inline void accumulate(cdotprecision& dot, const cvector_slice& x, const srvector& y) {
02621   fsp_vv_accu<cdotprecision,cvector_slice,srvector,sparse_cdot>(dot,x,y);
02622 }
02623 
02625 
02628 inline void accumulate(cdotprecision& dot, const rvector_slice& x, const scvector& y) {
02629   fsp_vv_accu<cdotprecision,rvector_slice,scvector,sparse_cdot>(dot,x,y);
02630 }
02631 
02633 
02636 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const cvector& y) {
02637   slf_vv_accu<cdotprecision,scvector_slice,cvector,sparse_cdot>(dot,x,y);
02638 }
02639 
02641 
02644 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const rvector& y) {
02645   slf_vv_accu<cdotprecision,scvector_slice,rvector,sparse_cdot>(dot,x,y);
02646 }
02647 
02649 
02652 inline void accumulate(cdotprecision& dot, const srvector_slice& x, const cvector& y) {
02653   slf_vv_accu<cdotprecision,srvector_slice,cvector,sparse_cdot>(dot,x,y);
02654 }
02655 
02657 
02660 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const cvector_slice& y) {
02661   slf_vv_accu<cdotprecision,scvector_slice,cvector_slice,sparse_cdot>(dot,x,y);
02662 }
02663 
02665 
02668 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const rvector_slice& y) {
02669   slf_vv_accu<cdotprecision,scvector_slice,rvector_slice,sparse_cdot>(dot,x,y);
02670 }
02671 
02673 
02676 inline void accumulate(cdotprecision& dot, const srvector_slice& x, const cvector_slice& y) {
02677   slf_vv_accu<cdotprecision,srvector_slice,cvector_slice,sparse_cdot>(dot,x,y);
02678 }
02679 
02681 
02684 inline void accumulate(cdotprecision& dot, const cvector& x, const scvector_slice& y) {
02685   fsl_vv_accu<cdotprecision,cvector,scvector_slice,sparse_cdot>(dot,x,y);
02686 }
02687 
02689 
02692 inline void accumulate(cdotprecision& dot, const cvector& x, const srvector_slice& y) {
02693   fsl_vv_accu<cdotprecision,cvector,srvector_slice,sparse_cdot>(dot,x,y);
02694 }
02695 
02697 
02700 inline void accumulate(cdotprecision& dot, const rvector& x, const scvector_slice& y) {
02701   fsl_vv_accu<cdotprecision,rvector,scvector_slice,sparse_cdot>(dot,x,y);
02702 }
02703 
02705 
02708 inline void accumulate(cdotprecision& dot, const cvector_slice& x, const scvector_slice& y) {
02709   fsl_vv_accu<cdotprecision,cvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
02710 }
02711 
02713 
02716 inline void accumulate(cdotprecision& dot, const cvector_slice& x, const srvector_slice& y) {
02717   fsl_vv_accu<cdotprecision,cvector_slice,srvector_slice,sparse_cdot>(dot,x,y);
02718 }
02719 
02721 
02724 inline void accumulate(cdotprecision& dot, const rvector_slice& x, const scvector_slice& y) {
02725   fsl_vv_accu<cdotprecision,rvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
02726 }
02727 
02729 
02732 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const scvector_slice& y) {
02733   slsl_vv_accu<cdotprecision,scvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
02734 }
02735 
02737 
02740 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const srvector_slice& y) {
02741   slsl_vv_accu<cdotprecision,scvector_slice,srvector_slice,sparse_cdot>(dot,x,y);
02742 }
02743 
02745 
02748 inline void accumulate(cdotprecision& dot, const srvector_slice& x, const scvector_slice& y) {
02749   slsl_vv_accu<cdotprecision,srvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
02750 }
02751 
02753 
02756 inline void accumulate(cdotprecision& dot, const scvector& x, const scvector_slice& y) {
02757   spsl_vv_accu<cdotprecision,scvector,scvector_slice,sparse_cdot>(dot,x,y);
02758 }
02759 
02761 
02764 inline void accumulate(cdotprecision& dot, const scvector& x, const srvector_slice& y) {
02765   spsl_vv_accu<cdotprecision,scvector,srvector_slice,sparse_cdot>(dot,x,y);
02766 }
02767 
02769 
02772 inline void accumulate(cdotprecision& dot, const srvector& x, const scvector_slice& y) {
02773   spsl_vv_accu<cdotprecision,srvector,scvector_slice,sparse_cdot>(dot,x,y);
02774 }
02775 
02777 
02780 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const scvector& y) {
02781   slsp_vv_accu<cdotprecision,scvector_slice,scvector,sparse_cdot>(dot,x,y);
02782 }
02783 
02785 
02788 inline void accumulate(cdotprecision& dot, const scvector_slice& x, const srvector& y) {
02789   slsp_vv_accu<cdotprecision,scvector_slice,srvector,sparse_cdot>(dot,x,y);
02790 }
02791 
02793 
02796 inline void accumulate(cdotprecision& dot, const srvector_slice& x, const scvector& y) {
02797   slsp_vv_accu<cdotprecision,srvector_slice,scvector,sparse_cdot>(dot,x,y);
02798 }
02799 
02801 
02805 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const scvector& y) {
02806   spsp_vv_accuapprox<cdotprecision,scvector,scvector,sparse_cdot>(dot,x,y);
02807 }
02808 
02810 
02814 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const srvector& y) {
02815   spsp_vv_accuapprox<cdotprecision,scvector,srvector,sparse_cdot>(dot,x,y);
02816 }
02817 
02819 
02823 inline void accumulate_approx(cdotprecision& dot, const srvector& x, const scvector& y) {
02824   spsp_vv_accuapprox<cdotprecision,srvector,scvector,sparse_cdot>(dot,x,y);
02825 }
02826 
02828 
02832 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const cvector& y) {
02833   spf_vv_accuapprox<cdotprecision,scvector,cvector,sparse_cdot>(dot,x,y);
02834 }
02835 
02837 
02841 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const rvector& y) {
02842   spf_vv_accuapprox<cdotprecision,scvector,rvector,sparse_cdot>(dot,x,y);
02843 }
02844 
02846 
02850 inline void accumulate_approx(cdotprecision& dot, const srvector& x, const cvector& y) {
02851   spf_vv_accuapprox<cdotprecision,srvector,cvector,sparse_cdot>(dot,x,y);
02852 }
02853 
02855 
02859 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const cvector_slice& y) {
02860   spf_vv_accuapprox<cdotprecision,scvector,cvector_slice,sparse_cdot>(dot,x,y);
02861 }
02862 
02864 
02868 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const rvector_slice& y) {
02869   spf_vv_accuapprox<cdotprecision,scvector,rvector_slice,sparse_cdot>(dot,x,y);
02870 }
02871 
02873 
02877 inline void accumulate_approx(cdotprecision& dot, const srvector& x, const cvector_slice& y) {
02878   spf_vv_accuapprox<cdotprecision,srvector,cvector_slice,sparse_cdot>(dot,x,y);
02879 }
02880 
02882 
02886 inline void accumulate_approx(cdotprecision& dot, const cvector& x, const scvector& y) {
02887   fsp_vv_accuapprox<cdotprecision,cvector,scvector,sparse_cdot>(dot,x,y);
02888 }
02889 
02891 
02895 inline void accumulate_approx(cdotprecision& dot, const cvector& x, const srvector& y) {
02896   fsp_vv_accuapprox<cdotprecision,cvector,srvector,sparse_cdot>(dot,x,y);
02897 }
02898 
02900 
02904 inline void accumulate_approx(cdotprecision& dot, const rvector& x, const scvector& y) {
02905   fsp_vv_accuapprox<cdotprecision,rvector,scvector,sparse_cdot>(dot,x,y);
02906 }
02907 
02909 
02913 inline void accumulate_approx(cdotprecision& dot, const cvector_slice& x, const scvector& y) {
02914   fsp_vv_accuapprox<cdotprecision,cvector_slice,scvector,sparse_cdot>(dot,x,y);
02915 }
02916 
02918 
02922 inline void accumulate_approx(cdotprecision& dot, const cvector_slice& x, const srvector& y) {
02923   fsp_vv_accuapprox<cdotprecision,cvector_slice,srvector,sparse_cdot>(dot,x,y);
02924 }
02925 
02927 
02931 inline void accumulate_approx(cdotprecision& dot, const rvector_slice& x, const scvector& y) {
02932   fsp_vv_accuapprox<cdotprecision,rvector_slice,scvector,sparse_cdot>(dot,x,y);
02933 }
02934 
02936 
02940 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const cvector& y) {
02941   slf_vv_accuapprox<cdotprecision,scvector_slice,cvector,sparse_cdot>(dot,x,y);
02942 }
02943 
02945 
02949 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const rvector& y) {
02950   slf_vv_accuapprox<cdotprecision,scvector_slice,rvector,sparse_cdot>(dot,x,y);
02951 }
02952 
02954 
02958 inline void accumulate_approx(cdotprecision& dot, const srvector_slice& x, const cvector& y) {
02959   slf_vv_accuapprox<cdotprecision,srvector_slice,cvector,sparse_cdot>(dot,x,y);
02960 }
02961 
02963 
02967 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const cvector_slice& y) {
02968   slf_vv_accuapprox<cdotprecision,scvector_slice,cvector_slice,sparse_cdot>(dot,x,y);
02969 }
02970 
02972 
02976 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const rvector_slice& y) {
02977   slf_vv_accuapprox<cdotprecision,scvector_slice,rvector_slice,sparse_cdot>(dot,x,y);
02978 }
02979 
02981 
02985 inline void accumulate_approx(cdotprecision& dot, const srvector_slice& x, const cvector_slice& y) {
02986   slf_vv_accuapprox<cdotprecision,srvector_slice,cvector_slice,sparse_cdot>(dot,x,y);
02987 }
02988 
02989 inline void accumulate_approx(cdotprecision& dot, const cvector& x, const scvector_slice& y) {
02990   fsl_vv_accuapprox<cdotprecision,cvector,scvector_slice,sparse_cdot>(dot,x,y);
02991 }
02992 
02994 
02998 inline void accumulate_approx(cdotprecision& dot, const cvector& x, const srvector_slice& y) {
02999   fsl_vv_accuapprox<cdotprecision,cvector,srvector_slice,sparse_cdot>(dot,x,y);
03000 }
03001 
03003 
03007 inline void accumulate_approx(cdotprecision& dot, const rvector& x, const scvector_slice& y) {
03008   fsl_vv_accuapprox<cdotprecision,rvector,scvector_slice,sparse_cdot>(dot,x,y);
03009 }
03010 
03012 
03016 inline void accumulate_approx(cdotprecision& dot, const cvector_slice& x, const scvector_slice& y) {
03017   fsl_vv_accuapprox<cdotprecision,cvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
03018 }
03019 
03021 
03025 inline void accumulate_approx(cdotprecision& dot, const cvector_slice& x, const srvector_slice& y) {
03026   fsl_vv_accuapprox<cdotprecision,cvector_slice,srvector_slice,sparse_cdot>(dot,x,y);
03027 }
03028 
03030 
03034 inline void accumulate_approx(cdotprecision& dot, const rvector_slice& x, const scvector_slice& y) {
03035   fsl_vv_accuapprox<cdotprecision,rvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
03036 }
03037 
03039 
03043 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const scvector_slice& y) {
03044   slsl_vv_accuapprox<cdotprecision,scvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
03045 }
03046 
03048 
03052 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const srvector_slice& y) {
03053   slsl_vv_accuapprox<cdotprecision,scvector_slice,srvector_slice,sparse_cdot>(dot,x,y);
03054 }
03055 
03057 
03061 inline void accumulate_approx(cdotprecision& dot, const srvector_slice& x, const scvector_slice& y) {
03062   slsl_vv_accuapprox<cdotprecision,srvector_slice,scvector_slice,sparse_cdot>(dot,x,y);
03063 }
03064 
03066 
03070 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const scvector_slice& y) {
03071   spsl_vv_accuapprox<cdotprecision,scvector,scvector_slice,sparse_cdot>(dot,x,y);
03072 }
03073 
03075 
03079 inline void accumulate_approx(cdotprecision& dot, const scvector& x, const srvector_slice& y) {
03080   spsl_vv_accuapprox<cdotprecision,scvector,srvector_slice,sparse_cdot>(dot,x,y);
03081 }
03082 
03084 
03088 inline void accumulate_approx(cdotprecision& dot, const srvector& x, const scvector_slice& y) {
03089   spsl_vv_accuapprox<cdotprecision,srvector,scvector_slice,sparse_cdot>(dot,x,y);
03090 }
03091 
03093 
03097 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const scvector& y) {
03098   slsp_vv_accuapprox<cdotprecision,scvector_slice,scvector,sparse_cdot>(dot,x,y);
03099 }
03100 
03102 
03106 inline void accumulate_approx(cdotprecision& dot, const scvector_slice& x, const srvector& y) {
03107   slsp_vv_accuapprox<cdotprecision,scvector_slice,srvector,sparse_cdot>(dot,x,y);
03108 }
03109 
03111 
03115 inline void accumulate_approx(cdotprecision& dot, const srvector_slice& x, const scvector& y) {
03116   slsp_vv_accuapprox<cdotprecision,srvector_slice,scvector,sparse_cdot>(dot,x,y);
03117 }
03118 
03120 
03123 inline void accumulate(cidotprecision& dot, const scvector& x, const scvector& y) {
03124   cdotprecision tmp(0.0);
03125   tmp.set_k(dot.get_k());
03126   accumulate(tmp,x,y);
03127   dot += tmp;
03128 }
03129 
03131 
03134 inline void accumulate(cidotprecision& dot, const scvector& x, const srvector& y) {
03135   cdotprecision tmp(0.0);
03136   tmp.set_k(dot.get_k());
03137   accumulate(tmp,x,y);
03138   dot += tmp;
03139 }
03140 
03142 
03145 inline void accumulate(cidotprecision& dot, const srvector& x, const scvector& y) {
03146   cdotprecision tmp(0.0);
03147   tmp.set_k(dot.get_k());
03148   accumulate(tmp,x,y);
03149   dot += tmp;
03150 }
03151 
03153 
03156 inline void accumulate(cidotprecision& dot, const scvector& x, const cvector& y) {
03157   cdotprecision tmp(0.0);
03158   tmp.set_k(dot.get_k());
03159   accumulate(tmp,x,y);
03160   dot += tmp;
03161 }
03162 
03164 
03167 inline void accumulate(cidotprecision& dot, const scvector& x, const rvector& y) {
03168   cdotprecision tmp(0.0);
03169   tmp.set_k(dot.get_k());
03170   accumulate(tmp,x,y);
03171   dot += tmp;
03172 }
03173 
03175 
03178 inline void accumulate(cidotprecision& dot, const srvector& x, const cvector& y) {
03179   cdotprecision tmp(0.0);
03180   tmp.set_k(dot.get_k());
03181   accumulate(tmp,x,y);
03182   dot += tmp;
03183 }
03184 
03186 
03189 inline void accumulate(cidotprecision& dot, const scvector& x, const cvector_slice& y) {
03190   cdotprecision tmp(0.0);
03191   tmp.set_k(dot.get_k());
03192   accumulate(tmp,x,y);
03193   dot += tmp;
03194 }
03195 
03197 
03200 inline void accumulate(cidotprecision& dot, const scvector& x, const rvector_slice& y) {
03201   cdotprecision tmp(0.0);
03202   tmp.set_k(dot.get_k());
03203   accumulate(tmp,x,y);
03204   dot += tmp;
03205 }
03206 
03208 
03211 inline void accumulate(cidotprecision& dot, const srvector& x, const cvector_slice& y) {
03212   cdotprecision tmp(0.0);
03213   tmp.set_k(dot.get_k());
03214   accumulate(tmp,x,y);
03215   dot += tmp;
03216 }
03217 
03219 
03222 inline void accumulate(cidotprecision& dot, const cvector& x, const scvector& y) {
03223   cdotprecision tmp(0.0);
03224   tmp.set_k(dot.get_k());
03225   accumulate(tmp,x,y);
03226   dot += tmp;
03227 }
03228 
03230 
03233 inline void accumulate(cidotprecision& dot, const cvector& x, const srvector& y) {
03234   cdotprecision tmp(0.0);
03235   tmp.set_k(dot.get_k());
03236   accumulate(tmp,x,y);
03237   dot += tmp;
03238 }
03239 
03241 
03244 inline void accumulate(cidotprecision& dot, const rvector& x, const scvector& y) {
03245   cdotprecision tmp(0.0);
03246   tmp.set_k(dot.get_k());
03247   accumulate(tmp,x,y);
03248   dot += tmp;
03249 }
03250 
03252 
03255 inline void accumulate(cidotprecision& dot, const cvector_slice& x, const scvector& y) {
03256   cdotprecision tmp(0.0);
03257   tmp.set_k(dot.get_k());
03258   accumulate(tmp,x,y);
03259   dot += tmp;
03260 }
03261 
03263 
03266 inline void accumulate(cidotprecision& dot, const cvector_slice& x, const srvector& y) {
03267   cdotprecision tmp(0.0);
03268   tmp.set_k(dot.get_k());
03269   accumulate(tmp,x,y);
03270   dot += tmp;
03271 }
03272 
03274 
03277 inline void accumulate(cidotprecision& dot, const rvector_slice& x, const scvector& y) {
03278   cdotprecision tmp(0.0);
03279   tmp.set_k(dot.get_k());
03280   accumulate(tmp,x,y);
03281   dot += tmp;
03282 }
03283 
03285 
03288 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const cvector& y) {
03289   cdotprecision tmp(0.0);
03290   tmp.set_k(dot.get_k());
03291   accumulate(tmp,x,y);
03292   dot += tmp;
03293 }
03294 
03296 
03299 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const rvector& y) {
03300   cdotprecision tmp(0.0);
03301   tmp.set_k(dot.get_k());
03302   accumulate(tmp,x,y);
03303   dot += tmp;
03304 }
03305 
03307 
03310 inline void accumulate(cidotprecision& dot, const srvector_slice& x, const cvector& y) {
03311   cdotprecision tmp(0.0);
03312   tmp.set_k(dot.get_k());
03313   accumulate(tmp,x,y);
03314   dot += tmp;
03315 }
03316 
03318 
03321 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const cvector_slice& y) {
03322   cdotprecision tmp(0.0);
03323   tmp.set_k(dot.get_k());
03324   accumulate(tmp,x,y);
03325   dot += tmp;
03326 }
03327 
03329 
03332 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const rvector_slice& y) {
03333   cdotprecision tmp(0.0);
03334   tmp.set_k(dot.get_k());
03335   accumulate(tmp,x,y);
03336   dot += tmp;
03337 }
03338 
03340 
03343 inline void accumulate(cidotprecision& dot, const srvector_slice& x, const cvector_slice& y) {
03344   cdotprecision tmp(0.0);
03345   tmp.set_k(dot.get_k());
03346   accumulate(tmp,x,y);
03347   dot += tmp;
03348 }
03349 
03351 
03354 inline void accumulate(cidotprecision& dot, const cvector& x, const scvector_slice& y) {
03355   cdotprecision tmp(0.0);
03356   tmp.set_k(dot.get_k());
03357   accumulate(tmp,x,y);
03358   dot += tmp;
03359 }
03360 
03362 
03365 inline void accumulate(cidotprecision& dot, const cvector& x, const srvector_slice& y) {
03366   cdotprecision tmp(0.0);
03367   tmp.set_k(dot.get_k());
03368   accumulate(tmp,x,y);
03369   dot += tmp;
03370 }
03371 
03373 
03376 inline void accumulate(cidotprecision& dot, const rvector& x, const scvector_slice& y) {
03377   cdotprecision tmp(0.0);
03378   tmp.set_k(dot.get_k());
03379   accumulate(tmp,x,y);
03380   dot += tmp;
03381 }
03382 
03384 
03387 inline void accumulate(cidotprecision& dot, const cvector_slice& x, const scvector_slice& y) {
03388   cdotprecision tmp(0.0);
03389   tmp.set_k(dot.get_k());
03390   accumulate(tmp,x,y);
03391   dot += tmp;
03392 }
03393 
03395 
03398 inline void accumulate(cidotprecision& dot, const cvector_slice& x, const srvector_slice& y) {
03399   cdotprecision tmp(0.0);
03400   tmp.set_k(dot.get_k());
03401   accumulate(tmp,x,y);
03402   dot += tmp;
03403 }
03404 
03406 
03409 inline void accumulate(cidotprecision& dot, const rvector_slice& x, const scvector_slice& y) {
03410   cdotprecision tmp(0.0);
03411   tmp.set_k(dot.get_k());
03412   accumulate(tmp,x,y);
03413   dot += tmp;
03414 }
03415 
03417 
03420 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const scvector_slice& y) {
03421   cdotprecision tmp(0.0);
03422   tmp.set_k(dot.get_k());
03423   accumulate(tmp,x,y);
03424   dot += tmp;
03425 }
03426 
03428 
03431 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const srvector_slice& y) {
03432   cdotprecision tmp(0.0);
03433   tmp.set_k(dot.get_k());
03434   accumulate(tmp,x,y);
03435   dot += tmp;
03436 }
03437 
03439 
03442 inline void accumulate(cidotprecision& dot, const srvector_slice& x, const scvector_slice& y) {
03443   cdotprecision tmp(0.0);
03444   tmp.set_k(dot.get_k());
03445   accumulate(tmp,x,y);
03446   dot += tmp;
03447 }
03448 
03450 
03453 inline void accumulate(cidotprecision& dot, const scvector& x, const scvector_slice& y) {
03454   cdotprecision tmp(0.0);
03455   tmp.set_k(dot.get_k());
03456   accumulate(tmp,x,y);
03457   dot += tmp;
03458 }
03459 
03461 
03464 inline void accumulate(cidotprecision& dot, const scvector& x, const srvector_slice& y) {
03465   cdotprecision tmp(0.0);
03466   tmp.set_k(dot.get_k());
03467   accumulate(tmp,x,y);
03468   dot += tmp;
03469 }
03470 
03472 
03475 inline void accumulate(cidotprecision& dot, const srvector& x, const scvector_slice& y) {
03476   cdotprecision tmp(0.0);
03477   tmp.set_k(dot.get_k());
03478   accumulate(tmp,x,y);
03479   dot += tmp;
03480 }
03481 
03483 
03486 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const scvector& y) {
03487   cdotprecision tmp(0.0);
03488   tmp.set_k(dot.get_k());
03489   accumulate(tmp,x,y);
03490   dot += tmp;
03491 }
03492 
03494 
03497 inline void accumulate(cidotprecision& dot, const scvector_slice& x, const srvector& y) {
03498   cdotprecision tmp(0.0);
03499   tmp.set_k(dot.get_k());
03500   accumulate(tmp,x,y);
03501   dot += tmp;
03502 }
03503 
03505 
03508 inline void accumulate(cidotprecision& dot, const srvector_slice& x, const scvector& y) {
03509   cdotprecision tmp(0.0);
03510   tmp.set_k(dot.get_k());
03511   accumulate(tmp,x,y);
03512   dot += tmp;
03513 }
03514 
03515 } //namespace cxsc
03516 
03517 #include "sparsevector.inl"
03518 
03519 #endif