cmatrix.cpp

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: cmatrix.cpp,v 1.22 2011/06/07 15:17:38 cxsc Exp $ */
00025 
00026 #define _CXSC_CPP
00027 
00028 #include "cmatrix.hpp"
00029 #include "matrix.inl"
00030 #include "cmatrix.inl"
00031 #include "cvecrmat.inl"
00032 
00033 #include "cdotk.inl"
00034 
00035 #include "idotk.inl"
00036 #include "imatrix.hpp"
00037 #include "ivector.hpp"
00038 
00039 namespace cxsc {
00040 
00041 cmatrix Id ( cmatrix& A )                          // Complex identity matrix
00042 {                                                  //-------------------------
00043   int i,j;
00044   int lbi = Lb(A,1), ubi = Ub(A,1);
00045   int lbj = Lb(A,2), ubj = Ub(A,2);
00046   cmatrix B(lbi,ubi,lbj,ubj);
00047 
00048   for (i = lbi; i <= ubi; i++)
00049     for (j = lbj; j <= ubj; j++)
00050       B[i][j] = complex( (i==j) ? 1.0 : 0.0 );
00051   return B;
00052 }
00053 
00054 cmatrix transp ( const cmatrix& A )                       // Transposed matrix
00055 {                                                         //------------------
00056   int      n;
00057   cmatrix  res(Lb(A,2),Ub(A,2),Lb(A,1),Ub(A,1));
00058       
00059   for (n = Lb(A,1); n <= Ub(A,1); n++) Col(res,n) = Row(A,n);
00060   return res;
00061 }
00062 
00063 void DoubleSize ( cmatrix& A )
00064 {
00065   int n = Lb(A,1);
00066   Resize(A,n,2*Ub(A,1)-n+1,Lb(A,2),Ub(A,2));
00067 }
00068 
00069         void accumulate(cdotprecision &dp, const cmatrix_subv & rv1, const cmatrix_subv &rv2)
00070 #if(CXSC_INDEX_CHECK)
00071         throw(OP_WITH_WRONG_DIM)
00072 #else
00073         throw()
00074 #endif
00075         { 
00076 #if(CXSC_INDEX_CHECK)
00077                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cmatrix_subv &, const cmatrix_subv &)"));
00078 #endif
00079                 addDot_op(dp,rv1,rv2);
00080         }
00081 
00082         void accumulate_approx(cdotprecision &dp, const cmatrix_subv & rv1, const cmatrix_subv &rv2)
00083         { 
00084                 addDot_op(dp,rv1,rv2);
00085         }
00086 
00087 
00088         void accumulate(cdotprecision &dp, const cvector & rv1, const cmatrix_subv &rv2)
00089 #if(CXSC_INDEX_CHECK)
00090         throw(OP_WITH_WRONG_DIM)
00091 #else
00092         throw()
00093 #endif
00094         { 
00095 #if(CXSC_INDEX_CHECK)
00096                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector &, const cmatrix_subv &)"));
00097 #endif
00098                 addDot(dp,rv1,rv2);
00099         }
00100 
00101         void accumulate_approx(cdotprecision &dp, const cvector & rv1, const cmatrix_subv &rv2)
00102         { 
00103                 addDot_op(dp,rv1,rv2);
00104         }
00105 
00106 
00107         void accumulate(cdotprecision &dp, const cmatrix_subv & rv1, const cvector &rv2)
00108 #if(CXSC_INDEX_CHECK)
00109         throw(OP_WITH_WRONG_DIM)
00110 #else
00111         throw()
00112 #endif
00113         { 
00114 #if(CXSC_INDEX_CHECK)
00115                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cmatrix_subv &, const cvector &)"));
00116 #endif
00117                 addDot(dp,rv1,rv2);
00118         }
00119 
00120         void accumulate_approx(cdotprecision &dp, const cmatrix_subv & rv1, const cvector &rv2)
00121         { 
00122                 addDot_op(dp,rv1,rv2);
00123         }
00124 
00125 
00126         void accumulate(cdotprecision &dp, const cvector_slice & sl1, const cmatrix_subv &rv2)
00127 #if(CXSC_INDEX_CHECK)
00128         throw(OP_WITH_WRONG_DIM)
00129 #else
00130         throw()
00131 #endif
00132         { 
00133 #if(CXSC_INDEX_CHECK)
00134                 if(VecLen(sl1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector_slice &, const cmatrix_subv &)"));
00135 #endif
00136                 addDot(dp,sl1,rv2);
00137         }
00138 
00139         void accumulate_approx(cdotprecision &dp, const cvector_slice & sl1, const cmatrix_subv &rv2)
00140         { 
00141                 addDot_op(dp,sl1,rv2);
00142         }
00143 
00144 
00145         void accumulate(cdotprecision &dp, const cmatrix_subv & rv1, const cvector_slice &sl2)
00146 #if(CXSC_INDEX_CHECK)
00147         throw(OP_WITH_WRONG_DIM)
00148 #else
00149         throw()
00150 #endif
00151         { 
00152 #if(CXSC_INDEX_CHECK)
00153                 if(VecLen(rv1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cmatrix_subv &, const cvector_slice &)"));
00154 #endif
00155                 addDot(dp,rv1,sl2);
00156         }
00157 
00158         void accumulate_approx(cdotprecision &dp, const cmatrix_subv & rv1, const cvector_slice &sl2)
00159         { 
00160                 addDot_op(dp,rv1,sl2);
00161         }
00162 
00163          void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const cmatrix_subv &rv2)
00164 #if(CXSC_INDEX_CHECK)
00165         throw(OP_WITH_WRONG_DIM)
00166 #else
00167         throw()
00168 #endif
00169         { 
00170 #if(CXSC_INDEX_CHECK)
00171                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const cmatrix_subv &)"));
00172 #endif
00173                 cdotprecision tmp(0.0);
00174                 tmp.set_k(dp.get_k());
00175                 addDot(tmp,rv1,rv2);
00176                 dp += tmp;
00177         }
00178 
00179          void accumulate(cidotprecision &dp, const cvector & rv1, const cmatrix_subv &rv2)
00180 #if(CXSC_INDEX_CHECK)
00181         throw(OP_WITH_WRONG_DIM)
00182 #else
00183         throw()
00184 #endif
00185         { 
00186 #if(CXSC_INDEX_CHECK)
00187                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const cmatrix_subv &)"));
00188 #endif
00189                 cdotprecision tmp(0.0);
00190                 tmp.set_k(dp.get_k());
00191                 addDot(tmp,rv1,rv2);
00192                 dp += tmp;
00193         }
00194 
00195          void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const cvector &rv2)
00196 #if(CXSC_INDEX_CHECK)
00197         throw(OP_WITH_WRONG_DIM)
00198 #else
00199         throw()
00200 #endif
00201         { 
00202 #if(CXSC_INDEX_CHECK)
00203                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const cvector &)"));
00204 #endif
00205                 cdotprecision tmp(0.0);
00206                 tmp.set_k(dp.get_k());
00207                 addDot(tmp,rv1,rv2);
00208                 dp += tmp;
00209         }
00210 
00211          void accumulate(cidotprecision &dp, const cvector_slice & sl1, const cmatrix_subv &rv2)
00212 #if(CXSC_INDEX_CHECK)
00213         throw(OP_WITH_WRONG_DIM)
00214 #else
00215         throw()
00216 #endif
00217         { 
00218 #if(CXSC_INDEX_CHECK)
00219                 if(VecLen(sl1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const cmatrix_subv &)"));
00220 #endif
00221                 cdotprecision tmp(0.0);
00222                 tmp.set_k(dp.get_k());
00223                 addDot(tmp,sl1,rv2);
00224                 dp += tmp;
00225         }
00226 
00227          void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const cvector_slice &sl2)
00228 #if(CXSC_INDEX_CHECK)
00229         throw(OP_WITH_WRONG_DIM)
00230 #else
00231         throw()
00232 #endif
00233         { 
00234 #if(CXSC_INDEX_CHECK)
00235                 if(VecLen(rv1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const cvector_slice &)"));
00236 #endif
00237                 cdotprecision tmp(0.0);
00238                 tmp.set_k(dp.get_k());
00239                 addDot(tmp,rv1,sl2);
00240                 dp += tmp;
00241         }
00242 
00243          void accumulate(cdotprecision &dp, const rmatrix_subv & rv1, const cmatrix_subv &rv2)
00244 #if(CXSC_INDEX_CHECK)
00245         throw(OP_WITH_WRONG_DIM)
00246 #else
00247         throw()
00248 #endif
00249         { 
00250 #if(CXSC_INDEX_CHECK)
00251                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rmatrix_subv &, const cmatrix_subv &)"));
00252 #endif
00253                 addDot(Re(dp),rv1,Re(rv2));
00254                 addDot(Im(dp),rv1,Im(rv2));
00255         }
00256 
00257         void accumulate_approx(cdotprecision &dp, const rmatrix_subv & rv1, const cmatrix_subv &rv2)
00258         { 
00259                 addDot_op(Re(dp),rv1,Re(rv2));
00260                 addDot_op(Im(dp),rv1,Im(rv2));
00261         }
00262 
00263          void accumulate(cdotprecision &dp, const rmatrix_subv & rv1, const cvector_slice &rv2)
00264 #if(CXSC_INDEX_CHECK)
00265         throw(OP_WITH_WRONG_DIM)
00266 #else
00267         throw()
00268 #endif
00269         { 
00270 #if(CXSC_INDEX_CHECK)
00271                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rmatrix_subv &, const cvector_slice &)"));
00272 #endif
00273                 addDot(Re(dp),rv1,Re(rv2));
00274                 addDot(Im(dp),rv1,Im(rv2));
00275         }
00276 
00277         void accumulate_approx(cdotprecision &dp, const rmatrix_subv & rv1, const cvector_slice &rv2)
00278         { 
00279                 addDot_op(Re(dp),rv1,Re(rv2));
00280                 addDot_op(Im(dp),rv1,Im(rv2));
00281         }
00282 
00283 
00284          void accumulate(cdotprecision &dp, const rmatrix_subv & rv1, const cvector &rv2)
00285 #if(CXSC_INDEX_CHECK)
00286         throw(OP_WITH_WRONG_DIM)
00287 #else
00288         throw()
00289 #endif
00290         { 
00291 #if(CXSC_INDEX_CHECK)
00292                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rmatrix_subv &, const cvector &)"));
00293 #endif
00294                 addDot(Re(dp),rv1,Re(rv2));
00295                 addDot(Im(dp),rv1,Im(rv2));
00296         }
00297 
00298         void accumulate_approx(cdotprecision &dp, const rmatrix_subv & rv1, const cvector &rv2)
00299         { 
00300                 addDot_op(Re(dp),rv1,Re(rv2));
00301                 addDot_op(Im(dp),rv1,Im(rv2));
00302         }
00303 
00304 
00305         void accumulate(cdotprecision &dp, const cmatrix_subv & rv1, const rmatrix_subv &rv2)
00306 #if(CXSC_INDEX_CHECK)
00307         throw(OP_WITH_WRONG_DIM)
00308 #else
00309         throw()
00310 #endif
00311         { 
00312 #if(CXSC_INDEX_CHECK)
00313                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cmatrix_subv &, const rmatrix_subv &)"));
00314 #endif
00315                 addDot(Re(dp),Re(rv1),rv2);
00316                 addDot(Im(dp),Im(rv1),rv2);
00317         }
00318 
00319         void accumulate_approx(cdotprecision &dp, const cmatrix_subv & rv1, const rmatrix_subv &rv2)
00320         { 
00321                 addDot_op(Re(dp),Re(rv1),rv2);
00322                 addDot_op(Im(dp),Im(rv1),rv2);
00323         }
00324 
00325         void accumulate(cdotprecision &dp, const cvector & rv1, const rmatrix_subv &rv2)
00326 #if(CXSC_INDEX_CHECK)
00327         throw(OP_WITH_WRONG_DIM)
00328 #else
00329         throw()
00330 #endif
00331         { 
00332 #if(CXSC_INDEX_CHECK)
00333                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector &, const rmatrix_subv &)"));
00334 #endif
00335                 addDot(Re(dp),Re(rv1),rv2);
00336                 addDot(Im(dp),Im(rv1),rv2);
00337         }
00338 
00339         void accumulate_approx(cdotprecision &dp, const cvector & rv1, const rmatrix_subv &rv2)
00340         { 
00341                 addDot_op(Re(dp),Re(rv1),rv2);
00342                 addDot_op(Im(dp),Im(rv1),rv2);
00343         }
00344 
00345         void accumulate(cdotprecision &dp, const cvector_slice & rv1, const rmatrix_subv &rv2)
00346 #if(CXSC_INDEX_CHECK)
00347         throw(OP_WITH_WRONG_DIM)
00348 #else
00349         throw()
00350 #endif
00351         { 
00352 #if(CXSC_INDEX_CHECK)
00353                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector_slice &, const rmatrix_subv &)"));
00354 #endif
00355                 addDot(Re(dp),Re(rv1),rv2);
00356                 addDot(Im(dp),Im(rv1),rv2);
00357         }
00358 
00359         void accumulate_approx(cdotprecision &dp, const cvector_slice & rv1, const rmatrix_subv &rv2)
00360         { 
00361                 addDot_op(Re(dp),Re(rv1),rv2);
00362                 addDot_op(Im(dp),Im(rv1),rv2);
00363         }
00364 
00365          void accumulate(cdotprecision &dp, const rvector & rv1, const cmatrix_subv &rv2)
00366 #if(CXSC_INDEX_CHECK)
00367         throw(OP_WITH_WRONG_DIM)
00368 #else
00369         throw()
00370 #endif
00371         { 
00372 #if(CXSC_INDEX_CHECK)
00373                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rvector &, const cmatrix_subv &)"));
00374 #endif
00375                 addDot(Re(dp),rv1,Re(rv2));
00376                 addDot(Im(dp),rv1,Im(rv2));
00377         }
00378 
00379         void accumulate_approx(cdotprecision &dp, const rvector & rv1, const cmatrix_subv &rv2)
00380         { 
00381                 addDot_op(Re(dp),rv1,Re(rv2));
00382                 addDot_op(Im(dp),rv1,Im(rv2));
00383         }
00384 
00385         void accumulate(cdotprecision &dp, const cmatrix_subv & rv1, const rvector &rv2)
00386 #if(CXSC_INDEX_CHECK)
00387         throw(OP_WITH_WRONG_DIM)
00388 #else
00389         throw()
00390 #endif
00391         { 
00392 #if(CXSC_INDEX_CHECK)
00393                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cmatrix_subv &, const rvector &)"));
00394 #endif
00395                 addDot(Re(dp),Re(rv1),rv2);
00396                 addDot(Im(dp),Im(rv1),rv2);
00397         }
00398 
00399         void accumulate_approx(cdotprecision &dp, const cmatrix_subv & rv1, const rvector &rv2)
00400         { 
00401                 addDot_op(Re(dp),Re(rv1),rv2);
00402                 addDot_op(Im(dp),Im(rv1),rv2);
00403         }
00404 
00405         void accumulate(cdotprecision &dp, const rvector_slice & sl1, const cmatrix_subv &rv2)
00406 #if(CXSC_INDEX_CHECK)
00407         throw(OP_WITH_WRONG_DIM)
00408 #else
00409         throw()
00410 #endif
00411         { 
00412 #if(CXSC_INDEX_CHECK)
00413                 if(VecLen(sl1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rvector_slice &, const cmatrix_subv &)"));
00414 #endif
00415                 addDot(Re(dp),sl1,Re(rv2));
00416                 addDot(Im(dp),sl1,Im(rv2));
00417         }
00418 
00419         void accumulate_approx(cdotprecision &dp, const rvector_slice & sl1, const cmatrix_subv &rv2)
00420         { 
00421                 addDot_op(Re(dp),sl1,Re(rv2));
00422                 addDot_op(Im(dp),sl1,Im(rv2));
00423         }
00424 
00425         void accumulate(cdotprecision &dp, const cmatrix_subv & rv1, const rvector_slice &sl2)
00426 #if(CXSC_INDEX_CHECK)
00427         throw(OP_WITH_WRONG_DIM)
00428 #else
00429         throw()
00430 #endif
00431         { 
00432 #if(CXSC_INDEX_CHECK)
00433                 if(VecLen(rv1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cmatrix_subv &, const rvector_slice &)"));
00434 #endif
00435                 addDot(Re(dp),Re(rv1),sl2);
00436                 addDot(Im(dp),Im(rv1),sl2);
00437         }
00438 
00439         void accumulate_approx(cdotprecision &dp, const cmatrix_subv & rv1, const rvector_slice &sl2)
00440         { 
00441                 addDot_op(Re(dp),Re(rv1),sl2);
00442                 addDot_op(Im(dp),Im(rv1),sl2);
00443         }
00444 
00445          void accumulate(cidotprecision &dp, const rmatrix_subv & rv1, const cmatrix_subv &rv2)
00446 #if(CXSC_INDEX_CHECK)
00447         throw(OP_WITH_WRONG_DIM)
00448 #else
00449         throw()
00450 #endif
00451         { 
00452 #if(CXSC_INDEX_CHECK)
00453                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rmatrix_subv &, const cmatrix_subv &)"));
00454 #endif
00455                 cdotprecision tmp(0.0);
00456                 tmp.set_k(dp.get_k());
00457                 addDot(Re(tmp),rv1,Re(rv2));
00458                 addDot(Im(tmp),rv1,Im(rv2));
00459                 dp += tmp;
00460         }
00461 
00462          void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const rmatrix_subv &rv2)
00463 #if(CXSC_INDEX_CHECK)
00464         throw(OP_WITH_WRONG_DIM)
00465 #else
00466         throw()
00467 #endif
00468         { 
00469 #if(CXSC_INDEX_CHECK)
00470                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const rmatrix_subv &)"));
00471 #endif
00472                 cdotprecision tmp(0.0);
00473                 tmp.set_k(dp.get_k());
00474                 addDot(Re(tmp),Re(rv1),rv2);
00475                 addDot(Im(tmp),Im(rv1),rv2);
00476                 dp += tmp;
00477         }
00478 
00479          void accumulate(cidotprecision &dp, const rvector & rv1, const cmatrix_subv &rv2)
00480 #if(CXSC_INDEX_CHECK)
00481         throw(OP_WITH_WRONG_DIM)
00482 #else
00483         throw()
00484 #endif
00485         { 
00486 #if(CXSC_INDEX_CHECK)
00487                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector &, const cmatrix_subv &)"));
00488 #endif
00489                 cdotprecision tmp(0.0);
00490                 tmp.set_k(dp.get_k());
00491                 addDot(Re(tmp),rv1,Re(rv2));
00492                 addDot(Im(tmp),rv1,Im(rv2));
00493                 dp += tmp;
00494         }
00495 
00496          void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const rvector &rv2)
00497 #if(CXSC_INDEX_CHECK)
00498         throw(OP_WITH_WRONG_DIM)
00499 #else
00500         throw()
00501 #endif
00502         { 
00503 #if(CXSC_INDEX_CHECK)
00504                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const rvector &)"));
00505 #endif
00506                 cdotprecision tmp(0.0);
00507                 tmp.set_k(dp.get_k());
00508                 addDot(Re(tmp),Re(rv1),rv2);
00509                 addDot(Im(tmp),Im(rv1),rv2);
00510                 dp += tmp;
00511         }
00512 
00513          void accumulate(cidotprecision &dp, const rvector_slice & sl1, const cmatrix_subv &rv2)
00514 #if(CXSC_INDEX_CHECK)
00515         throw(OP_WITH_WRONG_DIM)
00516 #else
00517         throw()
00518 #endif
00519         { 
00520 #if(CXSC_INDEX_CHECK)
00521                 if(VecLen(sl1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector_slice &, const cmatrix_subv &)"));
00522 #endif
00523                 cdotprecision tmp(0.0);
00524                 tmp.set_k(dp.get_k());
00525                 addDot(Re(tmp),sl1,Re(rv2));
00526                 addDot(Im(tmp),sl1,Im(rv2));
00527                 dp += tmp;
00528         }
00529 
00530          void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const rvector_slice &sl2)
00531 #if(CXSC_INDEX_CHECK)
00532         throw(OP_WITH_WRONG_DIM)
00533 #else
00534         throw()
00535 #endif
00536         { 
00537 #if(CXSC_INDEX_CHECK)
00538                 if(VecLen(rv1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const rvector_slice &)"));
00539 #endif
00540                 cdotprecision tmp(0.0);
00541                 tmp.set_k(dp.get_k());
00542                 addDot(Re(tmp),Re(rv1),sl2);
00543                 addDot(Im(tmp),Im(rv1),sl2);
00544                 dp += tmp;
00545         }
00546 
00547         void accumulate(cidotprecision &dp, const imatrix_subv & rv1, const cvector &rv2)
00548 #if(CXSC_INDEX_CHECK)
00549         throw(OP_WITH_WRONG_DIM)
00550 #else
00551         throw()
00552 #endif
00553         { 
00554 #if(CXSC_INDEX_CHECK)
00555                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const imatrix_subv &, const cvector &)"));
00556 #endif
00557                 idotprecision tmp_re(0.0);
00558                 idotprecision tmp_im(0.0);
00559                 tmp_re.set_k(dp.get_k());
00560                 tmp_im.set_k(dp.get_k());
00561                 addDot(tmp_re,rv1,Re(rv2));
00562                 addDot(tmp_im,rv1,Im(rv2));
00563                 dp += cidotprecision(tmp_re,tmp_im);
00564         }
00565 
00566         void accumulate(cidotprecision &dp, const cvector & rv1, const imatrix_subv &rv2)
00567 #if(CXSC_INDEX_CHECK)
00568         throw(OP_WITH_WRONG_DIM)
00569 #else
00570         throw()
00571 #endif
00572         { 
00573 #if(CXSC_INDEX_CHECK)
00574                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const imatrix_subv &)"));
00575 #endif
00576                 idotprecision tmp_re(0.0);
00577                 idotprecision tmp_im(0.0);
00578                 tmp_re.set_k(dp.get_k());
00579                 tmp_im.set_k(dp.get_k());
00580                 addDot(tmp_re,Re(rv1),rv2);
00581                 addDot(tmp_im,Im(rv1),rv2);
00582                 dp += cidotprecision(tmp_re,tmp_im);    }
00583 
00584         void accumulate(cidotprecision &dp, const imatrix_subv & rv1, const cvector_slice &rv2)
00585 #if(CXSC_INDEX_CHECK)
00586         throw(OP_WITH_WRONG_DIM)
00587 #else
00588         throw()
00589 #endif
00590         { 
00591 #if(CXSC_INDEX_CHECK)
00592                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const imatrix_subv &, const cvector_slice &)"));
00593 #endif
00594                 idotprecision tmp_re(0.0);
00595                 idotprecision tmp_im(0.0);
00596                 tmp_re.set_k(dp.get_k());
00597                 tmp_im.set_k(dp.get_k());
00598                 addDot(tmp_re,rv1,Re(rv2));
00599                 addDot(tmp_im,rv1,Im(rv2));
00600                 dp += cidotprecision(tmp_re,tmp_im);
00601         }
00602 
00603         void accumulate(cidotprecision &dp, const cvector_slice & rv1, const imatrix_subv &rv2)
00604 #if(CXSC_INDEX_CHECK)
00605         throw(OP_WITH_WRONG_DIM)
00606 #else
00607         throw()
00608 #endif
00609         { 
00610 #if(CXSC_INDEX_CHECK)
00611                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const imatrix_subv &)"));
00612 #endif
00613                 idotprecision tmp_re(0.0);
00614                 idotprecision tmp_im(0.0);
00615                 tmp_re.set_k(dp.get_k());
00616                 tmp_im.set_k(dp.get_k());
00617                 addDot(tmp_re,Re(rv1),rv2);
00618                 addDot(tmp_im,Im(rv1),rv2);
00619                 dp += cidotprecision(tmp_re,tmp_im);
00620         }
00621 
00622         void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const ivector &rv2)
00623 #if(CXSC_INDEX_CHECK)
00624         throw(OP_WITH_WRONG_DIM)
00625 #else
00626         throw()
00627 #endif
00628         { 
00629 #if(CXSC_INDEX_CHECK)
00630                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const ivector &)"));
00631 #endif
00632                 idotprecision tmp_re(0.0);
00633                 idotprecision tmp_im(0.0);
00634                 tmp_re.set_k(dp.get_k());
00635                 tmp_im.set_k(dp.get_k());
00636                 addDot(tmp_re,Re(rv1),rv2);
00637                 addDot(tmp_im,Im(rv1),rv2);
00638                 dp += cidotprecision(tmp_re,tmp_im);
00639         }
00640 
00641         void accumulate(cidotprecision &dp, const ivector & rv1, const cmatrix_subv &rv2)
00642 #if(CXSC_INDEX_CHECK)
00643         throw(OP_WITH_WRONG_DIM)
00644 #else
00645         throw()
00646 #endif
00647         { 
00648 #if(CXSC_INDEX_CHECK)
00649                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector &, const cmatrix_subv &)"));
00650 #endif
00651                 idotprecision tmp_re(0.0);
00652                 idotprecision tmp_im(0.0);
00653                 tmp_re.set_k(dp.get_k());
00654                 tmp_im.set_k(dp.get_k());
00655                 addDot(tmp_re,rv1,Re(rv2));
00656                 addDot(tmp_im,rv1,Im(rv2));
00657                 dp += cidotprecision(tmp_re,tmp_im);
00658         }
00659 
00660         void accumulate(cidotprecision &dp, const cmatrix_subv & rv1, const ivector_slice &rv2)
00661 #if(CXSC_INDEX_CHECK)
00662         throw(OP_WITH_WRONG_DIM)
00663 #else
00664         throw()
00665 #endif
00666         { 
00667 #if(CXSC_INDEX_CHECK)
00668                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cmatrix_subv &, const ivector_slice &)"));
00669 #endif
00670                 idotprecision tmp_re(0.0);
00671                 idotprecision tmp_im(0.0);
00672                 tmp_re.set_k(dp.get_k());
00673                 tmp_im.set_k(dp.get_k());
00674                 addDot(tmp_re,Re(rv1),rv2);
00675                 addDot(tmp_im,Im(rv1),rv2);
00676                 dp += cidotprecision(tmp_re,tmp_im);
00677         }
00678 
00679         void accumulate(cidotprecision &dp, const ivector_slice & rv1, const cmatrix_subv &rv2)
00680 #if(CXSC_INDEX_CHECK)
00681         throw(OP_WITH_WRONG_DIM)
00682 #else
00683         throw()
00684 #endif
00685         { 
00686 #if(CXSC_INDEX_CHECK)
00687                 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector_slice &, const cmatrix_subv &)"));
00688 #endif
00689                 idotprecision tmp_re(0.0);
00690                 idotprecision tmp_im(0.0);
00691                 tmp_re.set_k(dp.get_k());
00692                 tmp_im.set_k(dp.get_k());
00693                 addDot(tmp_re,rv1,Re(rv2));
00694                 addDot(tmp_im,rv1,Im(rv2));
00695                 dp += cidotprecision(tmp_re,tmp_im);
00696         }
00697 
00698 } // namespace cxsc
00699 

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