C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: cvector.cpp,v 1.25 2014/01/30 17:23:44 cxsc Exp $ */ 00025 00026 #define _CXSC_CPP 00027 00028 #include "cvector.hpp" 00029 #include "vector.inl" 00030 #include "cvector.inl" 00031 00032 #include "ivector.hpp" 00033 00034 #include "idotk.inl" 00035 #include "cdotk.inl" 00036 00037 namespace cxsc { 00038 00039 void accumulate(cdotprecision &dp, const cvector & rv1, const cvector &rv2) 00040 #if(CXSC_INDEX_CHECK) 00041 throw(OP_WITH_WRONG_DIM) 00042 #else 00043 throw() 00044 #endif 00045 { 00046 #if(CXSC_INDEX_CHECK) 00047 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector &, const cvector &)")); 00048 #endif 00049 addDot(dp,rv1,rv2); 00050 } 00051 00052 void accumulate_approx(cdotprecision &dp, const cvector & rv1, const cvector &rv2) 00053 { 00054 addDot_op(dp,rv1,rv2); 00055 } 00056 00057 00058 void accumulate(cdotprecision &dp, const cvector_slice & sl, const cvector &rv) 00059 #if(CXSC_INDEX_CHECK) 00060 throw(OP_WITH_WRONG_DIM) 00061 #else 00062 throw() 00063 #endif 00064 { 00065 #if(CXSC_INDEX_CHECK) 00066 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector_slice &, const cvector &)")); 00067 #endif 00068 addDot(dp,sl,rv); 00069 } 00070 00071 void accumulate_approx(cdotprecision &dp, const cvector_slice & sl, const cvector &rv) 00072 { 00073 addDot_op(dp,sl,rv); 00074 } 00075 00076 00077 void accumulate(cdotprecision &dp, const cvector &rv, const cvector_slice &sl) 00078 #if(CXSC_INDEX_CHECK) 00079 throw(OP_WITH_WRONG_DIM) 00080 #else 00081 throw() 00082 #endif 00083 { 00084 #if(CXSC_INDEX_CHECK) 00085 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector &, const cvector_slice &)")); 00086 #endif 00087 addDot(dp,rv,sl); 00088 } 00089 00090 void accumulate_approx(cdotprecision &dp, const cvector &rv, const cvector_slice &sl) 00091 { 00092 addDot_op(dp,rv,sl); 00093 } 00094 00095 00096 void accumulate(cdotprecision &dp, const cvector_slice & sl1, const cvector_slice &sl2) 00097 #if(CXSC_INDEX_CHECK) 00098 throw(OP_WITH_WRONG_DIM) 00099 #else 00100 throw() 00101 #endif 00102 { 00103 #if(CXSC_INDEX_CHECK) 00104 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector_slice &, const cvector_slice &)")); 00105 #endif 00106 addDot(dp,sl1,sl2); 00107 } 00108 00109 void accumulate_approx(cdotprecision &dp, const cvector_slice & sl1, const cvector_slice &sl2) 00110 { 00111 addDot_op(dp,sl1,sl2); 00112 } 00113 00114 void accumulate(cidotprecision &dp, const cvector & rv1, const cvector &rv2) 00115 #if(CXSC_INDEX_CHECK) 00116 throw(OP_WITH_WRONG_DIM) 00117 #else 00118 throw() 00119 #endif 00120 { 00121 #if(CXSC_INDEX_CHECK) 00122 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const cvector &)")); 00123 #endif 00124 cdotprecision tmp(0.0); 00125 tmp.set_k(dp.get_k()); 00126 addDot(tmp,rv1,rv2); 00127 dp += tmp; 00128 } 00129 00130 void accumulate(cidotprecision &dp, const cvector_slice & sl, const cvector &rv) 00131 #if(CXSC_INDEX_CHECK) 00132 throw(OP_WITH_WRONG_DIM) 00133 #else 00134 throw() 00135 #endif 00136 { 00137 #if(CXSC_INDEX_CHECK) 00138 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const cvector &)")); 00139 #endif 00140 cdotprecision tmp(0.0); 00141 tmp.set_k(dp.get_k()); 00142 addDot(tmp,sl,rv); 00143 dp += tmp; 00144 } 00145 00146 void accumulate(cidotprecision &dp, const cvector &rv, const cvector_slice &sl) 00147 #if(CXSC_INDEX_CHECK) 00148 throw(OP_WITH_WRONG_DIM) 00149 #else 00150 throw() 00151 #endif 00152 { 00153 #if(CXSC_INDEX_CHECK) 00154 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const cvector_slice &)")); 00155 #endif 00156 cdotprecision tmp(0.0); 00157 tmp.set_k(dp.get_k()); 00158 addDot(tmp,rv,sl); 00159 dp += tmp; 00160 } 00161 00162 void accumulate(cidotprecision &dp, const cvector_slice & sl1, const cvector_slice &sl2) 00163 #if(CXSC_INDEX_CHECK) 00164 throw(OP_WITH_WRONG_DIM) 00165 #else 00166 throw() 00167 #endif 00168 { 00169 #if(CXSC_INDEX_CHECK) 00170 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const cvector_slice &)")); 00171 #endif 00172 cdotprecision tmp(0.0); 00173 tmp.set_k(dp.get_k()); 00174 addDot(tmp,sl1,sl2); 00175 dp += tmp; 00176 } 00177 00178 void accumulate(cdotprecision &dp, const cvector & rv1, const rvector &rv2) 00179 #if(CXSC_INDEX_CHECK) 00180 throw(OP_WITH_WRONG_DIM) 00181 #else 00182 throw() 00183 #endif 00184 { 00185 #if(CXSC_INDEX_CHECK) 00186 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector &, const rvector &)")); 00187 #endif 00188 addDot(Re(dp), Re(rv1), rv2); 00189 addDot(Im(dp), Im(rv1), rv2); 00190 } 00191 00192 void accumulate_approx(cdotprecision &dp, const cvector & rv1, const rvector &rv2) 00193 { 00194 addDot_op(Re(dp), Re(rv1), rv2); 00195 addDot_op(Im(dp), Im(rv1), rv2); 00196 } 00197 00198 void accumulate(cdotprecision &dp, const rvector & rv1, const cvector &rv2) 00199 #if(CXSC_INDEX_CHECK) 00200 throw(OP_WITH_WRONG_DIM) 00201 #else 00202 throw() 00203 #endif 00204 { 00205 #if(CXSC_INDEX_CHECK) 00206 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rvector &, const cvector &)")); 00207 #endif 00208 addDot(Re(dp), rv1, Re(rv2)); 00209 addDot(Im(dp), rv1, Im(rv2)); 00210 } 00211 00212 void accumulate_approx(cdotprecision &dp, const rvector & rv1, const cvector &rv2) 00213 { 00214 addDot_op(Re(dp), rv1, Re(rv2)); 00215 addDot_op(Im(dp), rv1, Im(rv2)); 00216 } 00217 00218 void accumulate(cdotprecision &dp, const rvector_slice & sl, const cvector &rv) 00219 #if(CXSC_INDEX_CHECK) 00220 throw(OP_WITH_WRONG_DIM) 00221 #else 00222 throw() 00223 #endif 00224 { 00225 #if(CXSC_INDEX_CHECK) 00226 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rvector_slice &, const cvector &)")); 00227 #endif 00228 addDot(Re(dp), sl, Re(rv)); 00229 addDot(Im(dp), sl, Im(rv)); 00230 } 00231 00232 void accumulate_approx(cdotprecision &dp, const rvector_slice & sl, const cvector &rv) 00233 { 00234 addDot_op(Re(dp), sl, Re(rv)); 00235 addDot_op(Im(dp), sl, Im(rv)); 00236 } 00237 00238 void accumulate(cdotprecision &dp,const cvector_slice &sl,const rvector &rv) 00239 #if(CXSC_INDEX_CHECK) 00240 throw(OP_WITH_WRONG_DIM) 00241 #else 00242 throw() 00243 #endif 00244 { 00245 #if(CXSC_INDEX_CHECK) 00246 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector_slice &, const rvector &)")); 00247 #endif 00248 addDot(Re(dp), Re(sl), rv); 00249 addDot(Im(dp), Im(sl), rv); 00250 } 00251 00252 void accumulate_approx(cdotprecision &dp,const cvector_slice &sl,const rvector &rv) 00253 { 00254 addDot_op(Re(dp), Re(sl), rv); 00255 addDot_op(Im(dp), Im(sl), rv); 00256 } 00257 00258 void accumulate(cdotprecision &dp, const rvector &rv, const cvector_slice &sl) 00259 #if(CXSC_INDEX_CHECK) 00260 throw(OP_WITH_WRONG_DIM) 00261 #else 00262 throw() 00263 #endif 00264 { 00265 #if(CXSC_INDEX_CHECK) 00266 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rvector &, const cvector_slice &)")); 00267 #endif 00268 addDot(Re(dp), rv, Re(sl)); 00269 addDot(Im(dp), rv, Im(sl)); 00270 } 00271 00272 void accumulate_approx(cdotprecision &dp, const rvector &rv, const cvector_slice &sl) 00273 { 00274 addDot_op(Re(dp), rv, Re(sl)); 00275 addDot_op(Im(dp), rv, Im(sl)); 00276 } 00277 00278 void accumulate(cdotprecision &dp,const cvector &rv,const rvector_slice &sl) 00279 #if(CXSC_INDEX_CHECK) 00280 throw(OP_WITH_WRONG_DIM) 00281 #else 00282 throw() 00283 #endif 00284 { 00285 #if(CXSC_INDEX_CHECK) 00286 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector &, const rvector_slice &)")); 00287 #endif 00288 addDot(Re(dp), Re(rv), sl); 00289 addDot(Im(dp), Im(rv), sl); 00290 } 00291 00292 void accumulate_approx(cdotprecision &dp,const cvector &rv,const rvector_slice &sl) 00293 { 00294 addDot_op(Re(dp), Re(rv), sl); 00295 addDot_op(Im(dp), Im(rv), sl); 00296 } 00297 00298 void accumulate(cdotprecision &dp, const cvector_slice & sl1, const rvector_slice &sl2) 00299 #if(CXSC_INDEX_CHECK) 00300 throw(OP_WITH_WRONG_DIM) 00301 #else 00302 throw() 00303 #endif 00304 { 00305 #if(CXSC_INDEX_CHECK) 00306 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const cvector_slice &, const rvector_slice &)")); 00307 #endif 00308 addDot(Re(dp), Re(sl1), sl2); 00309 addDot(Im(dp), Im(sl1), sl2); 00310 } 00311 00312 void accumulate_approx(cdotprecision &dp, const cvector_slice & sl1, const rvector_slice &sl2) 00313 { 00314 addDot_op(Re(dp), Re(sl1), sl2); 00315 addDot_op(Im(dp), Im(sl1), sl2); 00316 } 00317 00318 void accumulate(cdotprecision &dp, const rvector_slice & sl1, const cvector_slice &sl2) 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(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cdotprecision&, const rvector_slice &, const cvector_slice &)")); 00327 #endif 00328 addDot(Re(dp), sl1, Re(sl2)); 00329 addDot(Im(dp), sl1, Im(sl2)); 00330 } 00331 00332 void accumulate_approx(cdotprecision &dp, const rvector_slice & sl1, const cvector_slice &sl2) 00333 { 00334 addDot_op(Re(dp), sl1, Re(sl2)); 00335 addDot_op(Im(dp), sl1, Im(sl2)); 00336 } 00337 00338 void accumulate(cidotprecision &dp, const cvector & rv1, const rvector &rv2) 00339 #if(CXSC_INDEX_CHECK) 00340 throw(OP_WITH_WRONG_DIM) 00341 #else 00342 throw() 00343 #endif 00344 { 00345 #if(CXSC_INDEX_CHECK) 00346 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const rvector &)")); 00347 #endif 00348 cdotprecision tmp(0.0); 00349 tmp.set_k(dp.get_k()); 00350 addDot(Re(tmp),Re(rv1),rv2); 00351 addDot(Im(tmp),Im(rv1),rv2); 00352 dp += tmp; 00353 } 00354 00355 void accumulate(cidotprecision &dp, const rvector & rv1, const cvector &rv2) 00356 #if(CXSC_INDEX_CHECK) 00357 throw(OP_WITH_WRONG_DIM) 00358 #else 00359 throw() 00360 #endif 00361 { 00362 #if(CXSC_INDEX_CHECK) 00363 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector &, const cvector &)")); 00364 #endif 00365 cdotprecision tmp(0.0); 00366 tmp.set_k(dp.get_k()); 00367 addDot(Re(tmp),rv1,Re(rv2)); 00368 addDot(Im(tmp),rv1,Im(rv2)); 00369 dp += tmp; 00370 } 00371 00372 void accumulate(cidotprecision &dp, const rvector_slice & sl, const cvector &rv) 00373 #if(CXSC_INDEX_CHECK) 00374 throw(OP_WITH_WRONG_DIM) 00375 #else 00376 throw() 00377 #endif 00378 { 00379 #if(CXSC_INDEX_CHECK) 00380 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector_slice &, const cvector &)")); 00381 #endif 00382 cdotprecision tmp(0.0); 00383 tmp.set_k(dp.get_k()); 00384 addDot(Re(tmp),sl,Re(rv)); 00385 addDot(Im(tmp),sl,Im(rv)); 00386 dp += tmp; 00387 } 00388 00389 void accumulate(cidotprecision &dp,const cvector_slice &sl,const rvector &rv) 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(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const rvector &)")); 00398 #endif 00399 cdotprecision tmp(0.0); 00400 tmp.set_k(dp.get_k()); 00401 addDot(Re(tmp),Re(sl),rv); 00402 addDot(Im(tmp),Im(sl),rv); 00403 dp += tmp; 00404 } 00405 00406 void accumulate(cidotprecision &dp, const rvector &rv, const cvector_slice &sl) 00407 #if(CXSC_INDEX_CHECK) 00408 throw(OP_WITH_WRONG_DIM) 00409 #else 00410 throw() 00411 #endif 00412 { 00413 #if(CXSC_INDEX_CHECK) 00414 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector &, const cvector_slice &)")); 00415 #endif 00416 cdotprecision tmp(0.0); 00417 tmp.set_k(dp.get_k()); 00418 addDot(Re(tmp),rv,Re(sl)); 00419 addDot(Im(tmp),rv,Im(sl)); 00420 dp += tmp; 00421 } 00422 00423 void accumulate(cidotprecision &dp,const cvector &rv,const rvector_slice &sl) 00424 #if(CXSC_INDEX_CHECK) 00425 throw(OP_WITH_WRONG_DIM) 00426 #else 00427 throw() 00428 #endif 00429 { 00430 #if(CXSC_INDEX_CHECK) 00431 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const rvector_slice &)")); 00432 #endif 00433 cdotprecision tmp(0.0); 00434 tmp.set_k(dp.get_k()); 00435 addDot(Re(tmp),Re(rv),sl); 00436 addDot(Im(tmp),Im(rv),sl); 00437 dp += tmp; 00438 } 00439 00440 void accumulate(cidotprecision &dp, const cvector_slice & sl1, const rvector_slice &sl2) 00441 #if(CXSC_INDEX_CHECK) 00442 throw(OP_WITH_WRONG_DIM) 00443 #else 00444 throw() 00445 #endif 00446 { 00447 #if(CXSC_INDEX_CHECK) 00448 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const rvector_slice &)")); 00449 #endif 00450 cdotprecision tmp(0.0); 00451 tmp.set_k(dp.get_k()); 00452 addDot(Re(tmp),Re(sl1),sl2); 00453 addDot(Im(tmp),Im(sl1),sl2); 00454 dp += tmp; 00455 } 00456 00457 void accumulate(cidotprecision &dp, const rvector_slice & sl1, const cvector_slice &sl2) 00458 #if(CXSC_INDEX_CHECK) 00459 throw(OP_WITH_WRONG_DIM) 00460 #else 00461 throw() 00462 #endif 00463 { 00464 #if(CXSC_INDEX_CHECK) 00465 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector_slice &, const cvector_slice &)")); 00466 #endif 00467 cdotprecision tmp(0.0); 00468 tmp.set_k(dp.get_k()); 00469 addDot(Re(tmp),sl1,Re(sl2)); 00470 addDot(Im(tmp),sl1,Im(sl2)); 00471 dp += tmp; 00472 } 00473 00475 void accumulate(cidotprecision &dp, const cvector_slice &sl, const ivector &rv) 00476 #if(CXSC_INDEX_CHECK) 00477 throw(OP_WITH_WRONG_DIM) 00478 #else 00479 throw() 00480 #endif 00481 { 00482 #if(CXSC_INDEX_CHECK) 00483 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const ivector &)")); 00484 #endif 00485 idotprecision tmp_re(0.0); 00486 idotprecision tmp_im(0.0); 00487 tmp_re.set_k(dp.get_k()); 00488 tmp_im.set_k(dp.get_k()); 00489 addDot(tmp_re,Re(sl),rv); 00490 addDot(tmp_im,Im(sl),rv); 00491 dp += cidotprecision(tmp_re,tmp_im); 00492 } 00493 00495 void accumulate(cidotprecision &dp, const ivector & rv, const cvector_slice &sl) 00496 #if(CXSC_INDEX_CHECK) 00497 throw(OP_WITH_WRONG_DIM) 00498 #else 00499 throw() 00500 #endif 00501 { 00502 #if(CXSC_INDEX_CHECK) 00503 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector &, const cvector_slice &)")); 00504 #endif 00505 idotprecision tmp_re(0.0); 00506 idotprecision tmp_im(0.0); 00507 tmp_re.set_k(dp.get_k()); 00508 tmp_im.set_k(dp.get_k()); 00509 addDot(tmp_re,rv,Re(sl)); 00510 addDot(tmp_im,rv,Im(sl)); 00511 dp += cidotprecision(tmp_re,tmp_im); 00512 } 00513 00515 void accumulate(cidotprecision &dp, const cvector &rv1, const ivector &rv2) 00516 #if(CXSC_INDEX_CHECK) 00517 throw(OP_WITH_WRONG_DIM) 00518 #else 00519 throw() 00520 #endif 00521 { 00522 #if(CXSC_INDEX_CHECK) 00523 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const ivector &)")); 00524 #endif 00525 idotprecision tmp_re(0.0); 00526 idotprecision tmp_im(0.0); 00527 tmp_re.set_k(dp.get_k()); 00528 tmp_im.set_k(dp.get_k()); 00529 addDot(tmp_re,Re(rv1),rv2); 00530 addDot(tmp_im,Im(rv1),rv2); 00531 dp += cidotprecision(tmp_re,tmp_im); 00532 } 00533 00535 void accumulate(cidotprecision &dp, const ivector &rv1, const cvector &rv2) 00536 #if(CXSC_INDEX_CHECK) 00537 throw(OP_WITH_WRONG_DIM) 00538 #else 00539 throw() 00540 #endif 00541 { 00542 #if(CXSC_INDEX_CHECK) 00543 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector &, const cvector &)")); 00544 #endif 00545 idotprecision tmp_re(0.0); 00546 idotprecision tmp_im(0.0); 00547 tmp_re.set_k(dp.get_k()); 00548 tmp_im.set_k(dp.get_k()); 00549 addDot(tmp_re,rv1,Re(rv2)); 00550 addDot(tmp_im,rv1,Im(rv2)); 00551 dp += cidotprecision(tmp_re,tmp_im); 00552 } 00553 00555 void accumulate(cidotprecision &dp, const ivector_slice &sl, const cvector &rv) 00556 #if(CXSC_INDEX_CHECK) 00557 throw(OP_WITH_WRONG_DIM) 00558 #else 00559 throw() 00560 #endif 00561 { 00562 #if(CXSC_INDEX_CHECK) 00563 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector_slice &, const cvector &)")); 00564 #endif 00565 idotprecision tmp_re(0.0); 00566 idotprecision tmp_im(0.0); 00567 tmp_re.set_k(dp.get_k()); 00568 tmp_im.set_k(dp.get_k()); 00569 addDot(tmp_re,sl,Re(rv)); 00570 addDot(tmp_im,sl,Im(rv)); 00571 dp += cidotprecision(tmp_re,tmp_im); 00572 } 00573 00575 void accumulate(cidotprecision &dp, const cvector &rv, const ivector_slice &sl) 00576 #if(CXSC_INDEX_CHECK) 00577 throw(OP_WITH_WRONG_DIM) 00578 #else 00579 throw() 00580 #endif 00581 { 00582 #if(CXSC_INDEX_CHECK) 00583 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const ivector_slice &)")); 00584 #endif 00585 idotprecision tmp_re(0.0); 00586 idotprecision tmp_im(0.0); 00587 tmp_re.set_k(dp.get_k()); 00588 tmp_im.set_k(dp.get_k()); 00589 addDot(tmp_re,Re(rv),sl); 00590 addDot(tmp_im,Im(rv),sl); 00591 dp += cidotprecision(tmp_re,tmp_im); 00592 } 00593 00595 void accumulate(cidotprecision &dp, const cvector_slice &sl1, const ivector_slice &sl2) 00596 #if(CXSC_INDEX_CHECK) 00597 throw(OP_WITH_WRONG_DIM) 00598 #else 00599 throw() 00600 #endif 00601 { 00602 #if(CXSC_INDEX_CHECK) 00603 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const ivector_slice &)")); 00604 #endif 00605 idotprecision tmp_re(0.0); 00606 idotprecision tmp_im(0.0); 00607 tmp_re.set_k(dp.get_k()); 00608 tmp_im.set_k(dp.get_k()); 00609 addDot(tmp_re,Re(sl1),sl2); 00610 addDot(tmp_im,Im(sl1),sl2); 00611 dp += cidotprecision(tmp_re,tmp_im); 00612 } 00613 00615 void accumulate(cidotprecision &dp, const ivector_slice &sl1, const cvector_slice &sl2) 00616 #if(CXSC_INDEX_CHECK) 00617 throw(OP_WITH_WRONG_DIM) 00618 #else 00619 throw() 00620 #endif 00621 { 00622 #if(CXSC_INDEX_CHECK) 00623 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector_slice &, const cvector_slice &)")); 00624 #endif 00625 idotprecision tmp_re(0.0); 00626 idotprecision tmp_im(0.0); 00627 tmp_re.set_k(dp.get_k()); 00628 tmp_im.set_k(dp.get_k()); 00629 addDot(tmp_re,sl1,Re(sl2)); 00630 addDot(tmp_im,sl1,Im(sl2)); 00631 dp += cidotprecision(tmp_re,tmp_im); 00632 } 00633 00634 //Summation accumulates 00635 void accumulate(cdotprecision &dp, const cvector& v) { 00636 addSum(Re(dp),Re(v)); 00637 addSum(Im(dp),Im(v)); 00638 } 00639 00640 void accumulate(cidotprecision &dp, const cvector& v) { 00641 idotprecision tmp_re(0.0); 00642 idotprecision tmp_im(0.0); 00643 tmp_re.set_k(dp.get_k()); 00644 tmp_im.set_k(dp.get_k()); 00645 accumulate(tmp_re,Re(v)); 00646 accumulate(tmp_im,Im(v)); 00647 dp += cidotprecision(tmp_re,tmp_im); 00648 } 00649 00650 00651 } // namespace cxsc 00652