00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #define _CXSC_CPP
00027
00028 #include "civector.hpp"
00029 #include "vector.inl"
00030 #include "civector.inl"
00031 #include "rmatrix.hpp"
00032
00033 #include "iveccvec.inl"
00034
00035 #include "cidotk.inl"
00036
00037
00038 namespace cxsc {
00039
00040
00041 void accumulate(cidotprecision &dp, const civector & rv1, const civector &rv2)
00042 #if(CXSC_INDEX_CHECK)
00043 throw(OP_WITH_WRONG_DIM)
00044 #else
00045 throw()
00046 #endif
00047 {
00048 #if(CXSC_INDEX_CHECK)
00049 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const civector &)"));
00050 #endif
00051 addDot(dp,rv1,rv2);
00052 }
00053
00054 void accumulate(cidotprecision &dp, const civector_slice & sl, const civector &rv)
00055 #if(CXSC_INDEX_CHECK)
00056 throw(OP_WITH_WRONG_DIM)
00057 #else
00058 throw()
00059 #endif
00060 {
00061 #if(CXSC_INDEX_CHECK)
00062 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const civector &)"));
00063 #endif
00064 addDot(dp,sl,rv);
00065 }
00066
00067 void accumulate(cidotprecision &dp, const civector &rv, const civector_slice &sl)
00068 #if(CXSC_INDEX_CHECK)
00069 throw(OP_WITH_WRONG_DIM)
00070 #else
00071 throw()
00072 #endif
00073 {
00074 #if(CXSC_INDEX_CHECK)
00075 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const civector_slice &)"));
00076 #endif
00077 addDot(dp,rv,sl);
00078 }
00079
00080 void accumulate(cidotprecision &dp, const civector_slice & sl1, const civector_slice &sl2)
00081 #if(CXSC_INDEX_CHECK)
00082 throw(OP_WITH_WRONG_DIM)
00083 #else
00084 throw()
00085 #endif
00086 {
00087 #if(CXSC_INDEX_CHECK)
00088 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const civector_slice &)"));
00089 #endif
00090 addDot(dp,sl1,sl2);
00091 }
00092
00093 void accumulate(cidotprecision &dp, const rvector & rv1, const civector &rv2)
00094 #if(CXSC_INDEX_CHECK)
00095 throw(OP_WITH_WRONG_DIM)
00096 #else
00097 throw()
00098 #endif
00099 {
00100 #if(CXSC_INDEX_CHECK)
00101 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector &, const civector &)"));
00102 #endif
00103 idotprecision tmp_re(0.0);
00104 idotprecision tmp_im(0.0);
00105 tmp_re.set_k(dp.get_k());
00106 tmp_im.set_k(dp.get_k());
00107 addDot(tmp_re,rv1,Re(rv2));
00108 addDot(tmp_im,rv1,Im(rv2));
00109 dp += cidotprecision(tmp_re,tmp_im);
00110 }
00111
00112 void accumulate(cidotprecision &dp, const civector & rv1, const rvector &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(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const rvector &)"));
00121 #endif
00122 idotprecision tmp_re(0.0);
00123 idotprecision tmp_im(0.0);
00124 tmp_re.set_k(dp.get_k());
00125 tmp_im.set_k(dp.get_k());
00126 addDot(tmp_re,Re(rv1),rv2);
00127 addDot(tmp_im,Im(rv1),rv2);
00128 dp += cidotprecision(tmp_re,tmp_im);
00129 }
00130
00131 void accumulate(cidotprecision &dp, const rvector_slice & sl, const civector &rv)
00132 #if(CXSC_INDEX_CHECK)
00133 throw(OP_WITH_WRONG_DIM)
00134 #else
00135 throw()
00136 #endif
00137 {
00138 #if(CXSC_INDEX_CHECK)
00139 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector_slice &, const civector &)"));
00140 #endif
00141 idotprecision tmp_re(0.0);
00142 idotprecision tmp_im(0.0);
00143 tmp_re.set_k(dp.get_k());
00144 tmp_im.set_k(dp.get_k());
00145 addDot(tmp_re,sl,Re(rv));
00146 addDot(tmp_im,sl,Im(rv));
00147 dp += cidotprecision(tmp_re,tmp_im);
00148 }
00149
00150 void accumulate(cidotprecision &dp,const civector_slice &sl,const rvector &rv)
00151 #if(CXSC_INDEX_CHECK)
00152 throw(OP_WITH_WRONG_DIM)
00153 #else
00154 throw()
00155 #endif
00156 {
00157 #if(CXSC_INDEX_CHECK)
00158 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice&, const rvector &)"));
00159 #endif
00160 idotprecision tmp_re(0.0);
00161 idotprecision tmp_im(0.0);
00162 tmp_re.set_k(dp.get_k());
00163 tmp_im.set_k(dp.get_k());
00164 addDot(tmp_re,Re(sl),rv);
00165 addDot(tmp_im,Im(sl),rv);
00166 dp += cidotprecision(tmp_re,tmp_im);
00167 }
00168
00169 void accumulate(cidotprecision &dp, const rvector &rv, const civector_slice &sl)
00170 #if(CXSC_INDEX_CHECK)
00171 throw(OP_WITH_WRONG_DIM)
00172 #else
00173 throw()
00174 #endif
00175 {
00176 #if(CXSC_INDEX_CHECK)
00177 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector &, const civector_slice &)"));
00178 #endif
00179 idotprecision tmp_re(0.0);
00180 idotprecision tmp_im(0.0);
00181 tmp_re.set_k(dp.get_k());
00182 tmp_im.set_k(dp.get_k());
00183 addDot(tmp_re,rv,Re(sl));
00184 addDot(tmp_im,rv,Im(sl));
00185 dp += cidotprecision(tmp_re,tmp_im);
00186 }
00187
00188 void accumulate(cidotprecision &dp,const civector &rv,const rvector_slice &sl)
00189 #if(CXSC_INDEX_CHECK)
00190 throw(OP_WITH_WRONG_DIM)
00191 #else
00192 throw()
00193 #endif
00194 {
00195 #if(CXSC_INDEX_CHECK)
00196 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const rvector_slice &)"));
00197 #endif
00198 idotprecision tmp_re(0.0);
00199 idotprecision tmp_im(0.0);
00200 tmp_re.set_k(dp.get_k());
00201 tmp_im.set_k(dp.get_k());
00202 addDot(tmp_re,Re(rv),sl);
00203 addDot(tmp_im,Im(rv),sl);
00204 dp += cidotprecision(tmp_re,tmp_im);
00205 }
00206
00207 void accumulate(cidotprecision &dp, const civector_slice & sl1, const rvector_slice &sl2)
00208 #if(CXSC_INDEX_CHECK)
00209 throw(OP_WITH_WRONG_DIM)
00210 #else
00211 throw()
00212 #endif
00213 {
00214 #if(CXSC_INDEX_CHECK)
00215 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const rvector_slice &)"));
00216 #endif
00217 idotprecision tmp_re(0.0);
00218 idotprecision tmp_im(0.0);
00219 tmp_re.set_k(dp.get_k());
00220 tmp_im.set_k(dp.get_k());
00221 addDot(tmp_re,Re(sl1),sl2);
00222 addDot(tmp_im,Im(sl1),sl2);
00223 dp += cidotprecision(tmp_re,tmp_im);
00224 }
00225
00226 void accumulate(cidotprecision &dp, const rvector_slice & sl1, const civector_slice &sl2)
00227 #if(CXSC_INDEX_CHECK)
00228 throw(OP_WITH_WRONG_DIM)
00229 #else
00230 throw()
00231 #endif
00232 {
00233 #if(CXSC_INDEX_CHECK)
00234 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rvector_slice &, const civector_slice &)"));
00235 #endif
00236 idotprecision tmp_re(0.0);
00237 idotprecision tmp_im(0.0);
00238 tmp_re.set_k(dp.get_k());
00239 tmp_im.set_k(dp.get_k());
00240 addDot(tmp_re,sl1,Re(sl2));
00241 addDot(tmp_im,sl1,Im(sl2));
00242 dp += cidotprecision(tmp_re,tmp_im);
00243 }
00244
00245 void accumulate(cidotprecision &dp, const civector_slice & sl1, const rmatrix_subv &sl2)
00246 #if(CXSC_INDEX_CHECK)
00247 throw(OP_WITH_WRONG_DIM)
00248 #else
00249 throw()
00250 #endif
00251 {
00252 #if(CXSC_INDEX_CHECK)
00253 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const rmatrix_subv &)"));
00254 #endif
00255 idotprecision tmp_re(0.0);
00256 idotprecision tmp_im(0.0);
00257 tmp_re.set_k(dp.get_k());
00258 tmp_im.set_k(dp.get_k());
00259 addDot(tmp_re,Re(sl1),sl2);
00260 addDot(tmp_im,Im(sl1),sl2);
00261 dp += cidotprecision(tmp_re,tmp_im);
00262 }
00263
00264 void accumulate(cidotprecision &dp, const rmatrix_subv & sl1, const civector_slice &sl2)
00265 #if(CXSC_INDEX_CHECK)
00266 throw(OP_WITH_WRONG_DIM)
00267 #else
00268 throw()
00269 #endif
00270 {
00271 #if(CXSC_INDEX_CHECK)
00272 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const rmatrix_subv &, const civector_slice &)"));
00273 #endif
00274 idotprecision tmp_re(0.0);
00275 idotprecision tmp_im(0.0);
00276 tmp_re.set_k(dp.get_k());
00277 tmp_im.set_k(dp.get_k());
00278 addDot(tmp_re,sl1,Re(sl2));
00279 addDot(tmp_im,sl1,Im(sl2));
00280 dp += cidotprecision(tmp_re,tmp_im);
00281 }
00282
00283 void accumulate(cidotprecision &dp, const cvector & rv1, const civector &rv2)
00284 #if(CXSC_INDEX_CHECK)
00285 throw(OP_WITH_WRONG_DIM)
00286 #else
00287 throw()
00288 #endif
00289 {
00290 #if(CXSC_INDEX_CHECK)
00291 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const civector &)"));
00292 #endif
00293 addDot(dp,rv1,rv2);
00294 }
00295
00296 void accumulate(cidotprecision &dp, const civector & rv1, const cvector &rv2)
00297 #if(CXSC_INDEX_CHECK)
00298 throw(OP_WITH_WRONG_DIM)
00299 #else
00300 throw()
00301 #endif
00302 {
00303 #if(CXSC_INDEX_CHECK)
00304 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const cvector &)"));
00305 #endif
00306 addDot(dp,rv1,rv2);
00307 }
00308
00309 void accumulate(cidotprecision &dp, const cvector_slice & sl, const civector &rv)
00310 #if(CXSC_INDEX_CHECK)
00311 throw(OP_WITH_WRONG_DIM)
00312 #else
00313 throw()
00314 #endif
00315 {
00316 #if(CXSC_INDEX_CHECK)
00317 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const civector &)"));
00318 #endif
00319 addDot(dp,sl,rv);
00320 }
00321
00322 void accumulate(cidotprecision &dp,const civector_slice &sl,const cvector &rv)
00323 #if(CXSC_INDEX_CHECK)
00324 throw(OP_WITH_WRONG_DIM)
00325 #else
00326 throw()
00327 #endif
00328 {
00329 #if(CXSC_INDEX_CHECK)
00330 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const cvector &)"));
00331 #endif
00332 addDot(dp,sl,rv);
00333 }
00334
00335 void accumulate(cidotprecision &dp, const cvector &rv, const civector_slice &sl)
00336 #if(CXSC_INDEX_CHECK)
00337 throw(OP_WITH_WRONG_DIM)
00338 #else
00339 throw()
00340 #endif
00341 {
00342 #if(CXSC_INDEX_CHECK)
00343 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector &, const civector_slice &)"));
00344 #endif
00345 addDot(dp,rv,sl);
00346 }
00347
00348 void accumulate(cidotprecision &dp,const civector &rv,const cvector_slice &sl)
00349 #if(CXSC_INDEX_CHECK)
00350 throw(OP_WITH_WRONG_DIM)
00351 #else
00352 throw()
00353 #endif
00354 {
00355 #if(CXSC_INDEX_CHECK)
00356 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const cvector_slice &)"));
00357 #endif
00358 addDot(dp,rv,sl);
00359 }
00360
00361 void accumulate(cidotprecision &dp, const civector_slice & sl1, const cvector_slice &sl2)
00362 #if(CXSC_INDEX_CHECK)
00363 throw(OP_WITH_WRONG_DIM)
00364 #else
00365 throw()
00366 #endif
00367 {
00368 #if(CXSC_INDEX_CHECK)
00369 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const cvector_slice &)"));
00370 #endif
00371 addDot(dp,sl1,sl2);
00372 }
00373
00374 void accumulate(cidotprecision &dp, const cvector_slice & sl1, const civector_slice &sl2)
00375 #if(CXSC_INDEX_CHECK)
00376 throw(OP_WITH_WRONG_DIM)
00377 #else
00378 throw()
00379 #endif
00380 {
00381 #if(CXSC_INDEX_CHECK)
00382 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const cvector_slice &, const civector_slice &)"));
00383 #endif
00384 addDot(dp,sl1,sl2);
00385 }
00386
00387 void accumulate(cidotprecision &dp, const ivector & rv1, const civector &rv2)
00388 #if(CXSC_INDEX_CHECK)
00389 throw(OP_WITH_WRONG_DIM)
00390 #else
00391 throw()
00392 #endif
00393 {
00394 #if(CXSC_INDEX_CHECK)
00395 if(VecLen(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector &, const civector &)"));
00396 #endif
00397 idotprecision tmp_re(0.0);
00398 idotprecision tmp_im(0.0);
00399 tmp_re.set_k(dp.get_k());
00400 tmp_im.set_k(dp.get_k());
00401 addDot(tmp_re,rv1,Re(rv2));
00402 addDot(tmp_im,rv1,Im(rv2));
00403 dp += cidotprecision(tmp_re,tmp_im);
00404 }
00405
00406 void accumulate(cidotprecision &dp, const civector & rv1, const ivector &rv2)
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(rv1)!=VecLen(rv2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const ivector &)"));
00415 #endif
00416 idotprecision tmp_re(0.0);
00417 idotprecision tmp_im(0.0);
00418 tmp_re.set_k(dp.get_k());
00419 tmp_im.set_k(dp.get_k());
00420 addDot(tmp_re,Re(rv1),rv2);
00421 addDot(tmp_im,Im(rv1),rv2);
00422 dp += cidotprecision(tmp_re,tmp_im);
00423 }
00424
00425 void accumulate(cidotprecision &dp, const ivector_slice & sl, const civector &rv)
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(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector_slice &, const civector &)"));
00434 #endif
00435 idotprecision tmp_re(0.0);
00436 idotprecision tmp_im(0.0);
00437 tmp_re.set_k(dp.get_k());
00438 tmp_im.set_k(dp.get_k());
00439 addDot(tmp_re,sl,Re(rv));
00440 addDot(tmp_im,sl,Im(rv));
00441 dp += cidotprecision(tmp_re,tmp_im);
00442 }
00443
00444 void accumulate(cidotprecision &dp,const civector_slice &sl,const ivector &rv)
00445 #if(CXSC_INDEX_CHECK)
00446 throw(OP_WITH_WRONG_DIM)
00447 #else
00448 throw()
00449 #endif
00450 {
00451 #if(CXSC_INDEX_CHECK)
00452 if(VecLen(sl)!=VecLen(rv)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const ivector &)"));
00453 #endif
00454 idotprecision tmp_re(0.0);
00455 idotprecision tmp_im(0.0);
00456 tmp_re.set_k(dp.get_k());
00457 tmp_im.set_k(dp.get_k());
00458 addDot(tmp_re,Re(sl),rv);
00459 addDot(tmp_im,Im(sl),rv);
00460 dp += cidotprecision(tmp_re,tmp_im);
00461 }
00462
00463 void accumulate(cidotprecision &dp, const ivector &rv, const civector_slice &sl)
00464 #if(CXSC_INDEX_CHECK)
00465 throw(OP_WITH_WRONG_DIM)
00466 #else
00467 throw()
00468 #endif
00469 {
00470 #if(CXSC_INDEX_CHECK)
00471 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector &, const civector_slice &)"));
00472 #endif
00473 idotprecision tmp_re(0.0);
00474 idotprecision tmp_im(0.0);
00475 tmp_re.set_k(dp.get_k());
00476 tmp_im.set_k(dp.get_k());
00477 addDot(tmp_re,rv,Re(sl));
00478 addDot(tmp_im,rv,Im(sl));
00479 dp += cidotprecision(tmp_re,tmp_im);
00480 }
00481
00482 void accumulate(cidotprecision &dp,const civector &rv,const ivector_slice &sl)
00483 #if(CXSC_INDEX_CHECK)
00484 throw(OP_WITH_WRONG_DIM)
00485 #else
00486 throw()
00487 #endif
00488 {
00489 #if(CXSC_INDEX_CHECK)
00490 if(VecLen(rv)!=VecLen(sl)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector &, const ivector_slice &)"));
00491 #endif
00492 idotprecision tmp_re(0.0);
00493 idotprecision tmp_im(0.0);
00494 tmp_re.set_k(dp.get_k());
00495 tmp_im.set_k(dp.get_k());
00496 addDot(tmp_re,Re(rv),sl);
00497 addDot(tmp_im,Im(rv),sl);
00498 dp += cidotprecision(tmp_re,tmp_im);
00499 }
00500
00501 void accumulate(cidotprecision &dp, const civector_slice & sl1, const ivector_slice &sl2)
00502 #if(CXSC_INDEX_CHECK)
00503 throw(OP_WITH_WRONG_DIM)
00504 #else
00505 throw()
00506 #endif
00507 {
00508 #if(CXSC_INDEX_CHECK)
00509 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const civector_slice &, const ivector_slice &)"));
00510 #endif
00511 idotprecision tmp_re(0.0);
00512 idotprecision tmp_im(0.0);
00513 tmp_re.set_k(dp.get_k());
00514 tmp_im.set_k(dp.get_k());
00515 addDot(tmp_re,Re(sl1),sl2);
00516 addDot(tmp_im,Im(sl1),sl2);
00517 dp += cidotprecision(tmp_re,tmp_im);
00518 }
00519
00520 void accumulate(cidotprecision &dp, const ivector_slice & sl1, const civector_slice &sl2)
00521 #if(CXSC_INDEX_CHECK)
00522 throw(OP_WITH_WRONG_DIM)
00523 #else
00524 throw()
00525 #endif
00526 {
00527 #if(CXSC_INDEX_CHECK)
00528 if(VecLen(sl1)!=VecLen(sl2)) cxscthrow(OP_WITH_WRONG_DIM("void accumulate(cidotprecision&, const ivector_slice &, const civector_slice &)"));
00529 #endif
00530 idotprecision tmp_re(0.0);
00531 idotprecision tmp_im(0.0);
00532 tmp_re.set_k(dp.get_k());
00533 tmp_im.set_k(dp.get_k());
00534 addDot(tmp_re,sl1,Re(sl2));
00535 addDot(tmp_im,sl1,Im(sl2));
00536 dp += cidotprecision(tmp_re,tmp_im);
00537 }
00538
00539
00540 void accumulate(cidotprecision &dp, const civector& v) {
00541 addSum(InfRe(dp),InfRe(v));
00542 addSum(SupRe(dp),SupRe(v));
00543 addSum(InfIm(dp),InfIm(v));
00544 addSum(SupIm(dp),SupIm(v));
00545 }
00546 }
00547