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

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