00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _CFARRAYBOX_H_ 00012 #define _CFARRAYBOX_H_ 00013 00014 #include "Box.H" 00015 #include "BaseFab.H" 00016 00017 #include "CH_Complex.H" 00018 #include "NamespaceHeader.H" 00019 00020 /// 00021 /** 00022 Complex Fortran Array Boxes (generally called CFArrayBoxs) are objects constructed 00023 to interface with arrays in Fortran. Useful operations can be performed 00024 upon FABs in C++, and they provide a convenient interface to 00025 Fortran when it is necessary to retreat into that language for 00026 doing arithmetic operations when performance matters. 00027 00028 CFArrayBox is derived from BaseFab<Complex>. 00029 CFArrayBox adds additional useful capabilities which make sense 00030 for Complex types, such as I/O and L**p norms. 00031 00032 The C pre-processor macro `CH_SPACEDIM' must be defined to use 00033 this class. The internal precision of CFArrayBox objects is 00034 set by defining either `CH_USE_FLOAT' or `CH_USE_DOUBLE' 00035 00036 This class does NOT provide a copy constructor or assignment operator. 00037 */ 00038 class CFArrayBox: public BaseFab<Complex> 00039 { 00040 public: 00041 00042 /// 00043 /** 00044 Constructs an invalid CFArrayBox with no memory. 00045 */ 00046 CFArrayBox (); 00047 00048 /// 00049 /** 00050 Constructs an initial CFArrayBox with the data space allocated but not 00051 inititialized. a_ncomp is the number of components (variables) at each 00052 data point in the Box. 00053 */ 00054 CFArrayBox(const Box& a_box, 00055 int a_ncomp, 00056 Complex* a_alias = NULL); 00057 00058 /// 00059 /** 00060 Construct an aliaed CFArrayBox. See BaseFab class for details. 00061 */ 00062 CFArrayBox(const Interval& a_comps, 00063 CFArrayBox& a_original) 00064 : 00065 BaseFab<Complex>(a_comps, a_original) 00066 {} 00067 00068 virtual void define(const Box& a_box, int a_ncomp, Complex* a_alias=NULL) 00069 { 00070 BaseFab<Complex>::define(a_box, a_ncomp, a_alias); 00071 } 00072 /// 00073 /** 00074 Defines CFArrayBox with the data space allocated but not 00075 inititialized. a_ncomp is the number of components (variables) at each 00076 data point in the Box. 00077 */ 00078 // virtual void define(const Box& a_box, 00079 // int a_ncomp, 00080 // Complex* a_alias = NULL) 00081 // { 00082 // BaseFab<Complex>::resize(a_box, a_ncomp, a_alias); 00083 // } 00084 00085 /// 00086 /** 00087 The (virtual) destructor. 00088 */ 00089 virtual ~CFArrayBox (); 00090 00091 CFArrayBox(CFArrayBox&& a_in)=default; 00092 00093 CFArrayBox& operator=(CFArrayBox&& a_in)=default; 00094 /// 00095 /** 00096 Constructs an 'aliased' BaseFab of the requested interval of the 00097 argument BaseFab. This BaseFab does not allocate any memory, but 00098 sets its data pointer into the memory pointed to by the argument 00099 BaseFab. It is the users responsiblity to ensure this aliased 00100 BaseFab is not used after the original BaseFab has deleted its data ptr 00101 (resize, define(..) called, or destruction, etc.). 00102 00103 This aliased BaseFab will also generate side effects (modifying the values 00104 of data in one will modify the other's data). 00105 00106 This aliased BaseFab will have a_comps.size() components, starting at zero. 00107 */ 00108 virtual void define(const Interval& a_comps, 00109 CFArrayBox& a_original) 00110 { 00111 BaseFab<Complex>::define(a_comps, a_original); 00112 } 00113 00114 /// 00115 /** 00116 * This is here only to make the Intel compiler stop warning about 00117 * partial override. 00118 */ 00119 virtual void define(const Interval& a_comps, 00120 BaseFab<Complex>& a_original) 00121 { 00122 BaseFab<Complex>::define(a_comps, a_original); 00123 } 00124 00125 /// 00126 /** 00127 Constructs CFArrayBox by reading it from istream. 00128 */ 00129 explicit CFArrayBox(std::istream& a_is); 00130 00131 /// 00132 /** 00133 Returns the Lp-norm of this FAB using components 00134 (a_comp : a_comp+a_numcomp-1) and within the a_subbox. 00135 a_p < 0 -> ERROR 00136 a_p = 0 -> infinity norm (max absolute value) 00137 a_p = 1 -> sum of ABS(FAB) 00138 a_p > 1 -> Lp-norm 00139 */ 00140 virtual Real norm(const Box& a_subbox, 00141 int a_p = 2, 00142 int a_comp = 0, 00143 int a_numcomp = 1) const; 00144 00145 /// 00146 /** 00147 Returns the Lp-norm of this FAB using components 00148 (a_comp : a_comp+a_numcomp-1). 00149 a_p < 0 -> ERROR 00150 a_p = 0 -> infinity norm (max absolute value) 00151 a_p = 1 -> sum of ABS(FAB) 00152 a_p > 1 -> Lp-norm 00153 */ 00154 virtual Real norm(int a_p = 2, 00155 int a_comp = 0, 00156 int a_numcomp = 1) const; 00157 00158 /// 00159 /** 00160 Returns sum of pow(fab[i,c],p): i in a_subbox, a_comp <= c < 00161 a_comp+a_numcomp, a_p >= 2 only 00162 */ 00163 virtual Complex sumPow(const Box& a_subbox, 00164 int a_p = 2, 00165 int a_comp = 0, 00166 int a_numcomp = 1) const; 00167 00168 /// Return the dot product of this CFArrayBox with another 00169 /** 00170 Return the dot product of this CFArrayBox and "a_fab2" over their common 00171 box and all components. 00172 */ 00173 Complex dotProduct(const CFArrayBox& a_fab2) const; 00174 00175 /// Return the dot product of this CFArrayBox with another 00176 /** 00177 Return the dot product of this CFArrayBox and "a_fab2" over the 00178 a_box box and all components. 00179 */ 00180 Complex dotProduct(const CFArrayBox& a_fab2, const Box& a_box) const; 00181 00182 00183 /// 00184 /** 00185 Modifies this CFArrayBox by replacing each value with its absolute value. 00186 */ 00187 void abs(); 00188 00189 /// 00190 /** 00191 Modifies this CFArrayBox by replacing each value with its absolute value, 00192 for components (a_comp : a_comp+a_numcomp-1). 00193 */ 00194 void abs(int a_comp, 00195 int a_numcomp = 1); 00196 00197 /// 00198 /** 00199 Modifies this CFArrayBox by replacing eahc value with its absolute value, 00200 for components (a_comp : a_comp+a_numcomp-1) and within the a_subbox. 00201 */ 00202 void abs (const Box& a_subbox, 00203 int a_comp = 0, 00204 int a_numcomp = 1); 00205 00206 /// 00207 /** 00208 Returns sum of given component of CFArrayBox. 00209 */ 00210 Complex sum(int a_comp, 00211 int a_numcomp = 1) const; 00212 00213 /// 00214 /** 00215 Returns sum of component of this CFArrayBox in given a_subbox. 00216 */ 00217 Complex sum(const Box& a_subbox, 00218 int a_comp, 00219 int a_numcomp = 1) const; 00220 00221 /// 00222 /** 00223 Modifies this CFArrayBox by replacing each value x with a_r/x. 00224 */ 00225 CFArrayBox& invert(Complex a_r); 00226 00227 /// 00228 /** 00229 Modifies this CFArrayBox by replacing each value x with a_r/x. For 00230 given range of components. 00231 */ 00232 CFArrayBox& invert(Complex a_r, 00233 int a_comp, 00234 int a_numcomp = 1); 00235 00236 /// 00237 /** 00238 Modifies this CFArrayBox by replacing each value x with a_r/x. For 00239 given range of components and within given a_subbox. 00240 */ 00241 CFArrayBox& invert(Complex a_r, 00242 const Box& a_subbox, 00243 int a_comp = 0, 00244 int a_numcomp = 1); 00245 00246 /// 00247 /** 00248 Modifies this CFArrayBox by replacing each value with its additive 00249 inverse. For given range of components and within given a_subbox. 00250 */ 00251 CFArrayBox& negate(const Box& a_subbox, 00252 int a_comp = 0, 00253 int a_numcomp = 1); 00254 00255 /// 00256 /** 00257 Modifies this CFArrayBox by replacing each value with its additive 00258 inverse. For given range of components. 00259 */ 00260 CFArrayBox& negate(int a_comp, 00261 int a_numcomp = 1); 00262 00263 /// 00264 /** 00265 Modifies this CFArrayBox by replacing each value with its additive 00266 inverse. 00267 */ 00268 CFArrayBox& negate(); 00269 00270 /// 00271 /** 00272 Modifies this CFArrayBox by adding the scalar Complex a_r to all values. For 00273 given range of components and within given a_subbox. 00274 */ 00275 CFArrayBox& plus(Complex a_r, 00276 const Box& a_subbox, 00277 int a_comp = 0, 00278 int a_numcomp = 1); 00279 00280 /// 00281 /** 00282 Modifies this CFArrayBox by adding the scalar Complex a_r to all values. For 00283 given range of components. 00284 */ 00285 CFArrayBox& plus(Complex a_r, 00286 int a_comp, 00287 int a_numcomp = 1); 00288 00289 /// 00290 /** 00291 Modifies this CFArrayBox by adding the scalar Complex a_r to all values. 00292 */ 00293 CFArrayBox& operator += (Complex a_r); 00294 00295 /// 00296 /** 00297 Modifies this CFArrayBox by pointwise addition of the values of the 00298 argument CFArrayBox. You might come to grief if the domains of the 00299 CFArrayBoxes don't match. 00300 */ 00301 CFArrayBox& operator += (const CFArrayBox& a_x); 00302 00303 /// 00304 /** 00305 Modifies this CFArrayBox by adding the scalar Complex a_r to all values. 00306 */ 00307 CFArrayBox& plus(Complex a_r); 00308 00309 00310 /// 00311 /** 00312 Modifies this CFArrayBox by pointwise addition of the values of the 00313 argument CFArrayBox. You might come to grief if the domains of the 00314 CFArrayBoxes don't match. The same as += operator. 00315 00316 */ 00317 CFArrayBox& plus(const CFArrayBox& a_x); 00318 00319 /// 00320 /** 00321 Modifies this CFArrayBox by pointwise scaled addition of the 00322 argument CFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain 00323 of the intersection of these two CFArrayBoxes. 00324 */ 00325 CFArrayBox& plus(const CFArrayBox& a_src, 00326 const Complex& a_scale); 00327 00328 /// 00329 /** 00330 Modifies this CFArrayBox by pointwise scaled addition of the 00331 argument CFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain 00332 of the intersection of these two CFArrayBoxes. 00333 */ 00334 CFArrayBox& plus(const CFArrayBox& a_src, 00335 const Complex& a_scale, 00336 int a_srccomp, 00337 int a_destcomp, 00338 int a_numcomp = 1); 00339 00340 /// 00341 /** 00342 Modifies this CFArrayBox by pointwise addition of values in the argument 00343 CFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) 00344 to this CFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) 00345 where the domains of the two CFArrayBoxes intersect. 00346 */ 00347 CFArrayBox& plus(const CFArrayBox& a_src, 00348 int a_srccomp, 00349 int a_destcomp, 00350 int a_numcomp = 1); 00351 00352 /// 00353 /** 00354 Modifies this CFArrayBox by pointwise addition of values in the argument 00355 CFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) 00356 to this CFArrayBox's components (a_destcomp : a_destcomp+numcomp-1) 00357 where the domain of this CFArrayBox intersects the a_subbox. NOTE: 00358 a_subbox must be contained in this FAB. 00359 */ 00360 CFArrayBox& plus(const CFArrayBox& a_src, 00361 const Box& a_subbox, 00362 int a_srccomp, 00363 int a_destcomp, 00364 int a_numcomp = 1); 00365 00366 /// 00367 /** 00368 Modifies this CFArrayBox by pointwise addition of values in the argument 00369 CFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) 00370 in the Box a_srcbox to this CFArrayBox's components (a_destcomp : 00371 a_destcomp+a_numcomp-1) in the Box a_destbox. Corresponding locations 00372 within the two CFArrayBoxes are indexed relative to a_srcbox and a_destbox, 00373 and will in general not be the same. The a_srcbox and a_destbox must be 00374 same size. The results are UNDEFINED if the a_src and dest CFArrayBoxes 00375 are the same and the a_srcbox and a_destbox overlap. 00376 00377 */ 00378 CFArrayBox& plus(const CFArrayBox& a_src, 00379 const Box& a_srcbox, 00380 const Box& a_destbox, 00381 int a_srccomp, 00382 int a_destcomp, 00383 int a_numcomp = 1); 00384 00385 /// 00386 CFArrayBox& plus(const CFArrayBox& a_src, 00387 const Box& a_srcbox, 00388 const Box& a_destbox, 00389 const Complex& a_scale, 00390 int a_srccomp, 00391 int a_destcomp, 00392 int a_numcomp = 1); 00393 00394 /// 00395 /** 00396 Modifies this CFArrayBox by subtracting the scalar Complex a_r to all values. 00397 Note: use plus(-a_r) for more general operations. 00398 */ 00399 CFArrayBox& operator -= (Complex a_r); 00400 00401 /// 00402 /** 00403 Modifies this CFArrayBox by pointwise subtraction of the values of the 00404 argument CFArrayBox. You might come to grief if the domains of the 00405 CFArrayBoxes don't match. 00406 */ 00407 CFArrayBox& operator -= (const CFArrayBox& a_x); 00408 00409 /// 00410 /** 00411 Modifies this CFArrayBox by pointwise subtraction of the values of the 00412 argument CFArrayBox. You might come to grief if the domains of the 00413 CFArrayBoxes don't match. The same as -= operator. 00414 */ 00415 CFArrayBox& minus(const CFArrayBox& a_x); 00416 00417 /** 00418 Modifies this CFArrayBox by pointwise subtraction of values in the 00419 argument CFArrayBox. Subtracts a_src's components (a_srccomp : 00420 a_srccomp+a_numcomp-1) from this CFArrayBox's components (a_destcomp : 00421 a_destcomp+a_numcomp-1) where the domains of the two CFArrayBoxes 00422 intersect. 00423 */ 00424 CFArrayBox& minus(const CFArrayBox& a_src, 00425 int a_srccomp, 00426 int a_destcomp, 00427 int a_numcomp = 1); 00428 00429 /** 00430 Modifies this CFArrayBox by pointwise subtraction of values in the 00431 argument CFArrayBox. Subtracts a_src's components (a_srccomp : 00432 a_srccomp+a_numcomp-1) from this CFArrayBox's components (a_destcomp : 00433 a_destcomp+a_numcomp-1) where the domain of this CFArrayBox intersects 00434 the a_subbox. NOTE: a_subbox must be contained in this FAB. 00435 */ 00436 CFArrayBox& minus(const CFArrayBox& a_src, 00437 const Box& a_subbox, 00438 int a_srccomp, 00439 int a_destcomp, 00440 int a_numcomp = 1); 00441 00442 /// 00443 /** 00444 Modifies this CFArrayBox by pointwise subtraction of values in the 00445 argument CFArrayBox. Subtracts a_src's components (a_srccomp : 00446 a_srccomp+a_numcomp-1) in the Box a_srcbox from this CFArrayBox's 00447 components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox. 00448 Corresponding locations within the two CFArrayBoxes are indexed relative 00449 to a_srcbox and a_destbox, and will in general not be the same. The 00450 a_srcbox and a_destbox must be same size. The results are UNDEFINED 00451 if the a_src and dest CFArrayBoxes are the same and the a_srcbox and 00452 a_destbox overlap. 00453 */ 00454 CFArrayBox& minus(const CFArrayBox& a_src, 00455 const Box& a_srcbox, 00456 const Box& a_destbox, 00457 int a_srccomp, 00458 int a_destcomp, 00459 int a_numcomp = 1); 00460 00461 /// 00462 /** 00463 Modifies this CFArrayBox by multiplying all values by the scalar Complex a_r. 00464 */ 00465 CFArrayBox& operator *= (Complex a_r); 00466 00467 /// 00468 /** 00469 Modifies this CFArrayBox by multiplying all values by the scalar Complex a_r. 00470 */ 00471 CFArrayBox& mult(Complex a_r); 00472 00473 /// 00474 /** 00475 Modifies this CFArrayBox by multiplying all values by the scalar 00476 Complex a_r. For given range of components. 00477 */ 00478 CFArrayBox& mult(Complex a_r, 00479 int a_comp, 00480 int a_numcomp = 1); 00481 00482 /// 00483 /** 00484 Modifies this CFArrayBox by multiplying all values by the scalar 00485 Complex a_r. For given range of components and within given a_subbox. 00486 */ 00487 CFArrayBox& mult(Complex a_r, 00488 const Box& a_subbox, 00489 int a_comp = 0, 00490 int a_numcomp = 1); 00491 00492 /// 00493 /** 00494 Modifies this CFArrayBox by pointwise multiplication of the values by the 00495 argument CFArrayBox. You might come to grief if the domains of the 00496 CFArrayBoxes don't match. 00497 */ 00498 CFArrayBox& operator *= (const CFArrayBox& a_x); 00499 00500 /// 00501 /** 00502 Modifies this CFArrayBox by pointwise multiplication by the values in the 00503 argument CFArrayBox. You might come to grief if the domains of the 00504 CFArrayBoxes don't match. The same as the *= operator. 00505 */ 00506 CFArrayBox& mult(const CFArrayBox& a_x); 00507 00508 /// 00509 /** 00510 Modifies this CFArrayBox by pointwise multiplication by values in the 00511 argument CFArrayBox. Multiplies a_src's components (a_srccomp : 00512 a_srccomp+a_numcomp-1) by this CFArrayBox's components (a_destcomp : 00513 a_destcomp+a_numcomp-1) where the domains of the two CFArrayBoxes 00514 intersect. 00515 */ 00516 CFArrayBox& mult(const CFArrayBox& a_src, 00517 int a_srccomp, 00518 int a_destcomp, 00519 int a_numcomp = 1); 00520 00521 /// 00522 /** 00523 Modifies this CFArrayBox by pointwise multiplication by values in the 00524 argument CFArrayBox. Multiplies a_src's components (a_srccomp : 00525 a_srccomp+a_numcomp-1) by this CFArrayBox's components (a_destcomp : 00526 a_destcomp+a_numcomp-1) where the domain of this CFArrayBox intersects 00527 the a_subbox. NOTE: a_subbox must be contained in this FAB. 00528 */ 00529 CFArrayBox& mult(const CFArrayBox& a_src, 00530 const Box& a_subbox, 00531 int a_srccomp, 00532 int a_destcomp, 00533 int a_numcomp = 1); 00534 00535 /// 00536 /** 00537 Modifies this CFArrayBox by pointwise multiplication by values in the 00538 argument CFArrayBox. Multiplies a_src's components (a_srccomp : 00539 a_srccomp+a_numcomp-1) in the Box a_srcbox by this CFArrayBox's 00540 components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox. 00541 Corresponding locations within the two CFArrayBoxes are indexed relative 00542 to a_srcbox and a_destbox, and will in general not be the same. The 00543 a_srcbox and a_destbox must be same size. The results are UNDEFINED if 00544 the a_src and dest CFArrayBoxes are the same and the a_srcbox and a_destbox 00545 overlap. 00546 */ 00547 CFArrayBox& mult(const CFArrayBox& a_src, 00548 const Box& a_srcbox, 00549 const Box& a_destbox, 00550 int a_srccomp, 00551 int a_destcomp, 00552 int a_numcomp = 1); 00553 00554 /// 00555 /** 00556 Modify this CFArrayBox by multiplying each element by the Real value in a_r 00557 */ 00558 CFArrayBox& mult(const BaseFab<Real>& a_r); 00559 00560 /// 00561 /** 00562 Modify this CFArrayBox by multiplying each element by the Real value in a_r 00563 in the region defined by a_box 00564 */ 00565 CFArrayBox& mult(const BaseFab<Real>& a_r, 00566 const Box& a_box); 00567 00568 /// 00569 /** 00570 Modifies this CFArrayBox by dividing all values by the scalar Complex a_r. 00571 */ 00572 CFArrayBox& operator /= (Complex a_r); 00573 00574 /// 00575 /** 00576 Modifies this CFArrayBox by dividing all values by the scalar Complex a_r. 00577 */ 00578 CFArrayBox& divide(Complex a_r); 00579 00580 /// 00581 /** 00582 Modifies this CFArrayBox by dividing all values by the scalar Complex a_r. 00583 For given range of components. 00584 */ 00585 CFArrayBox& divide(Complex a_r, 00586 int a_comp, 00587 int a_numcomp = 1); 00588 00589 /// 00590 /** 00591 Modifies this CFArrayBox by dividing all values by the scalar Complex 00592 a_r. For given range of components and within given a_subbox. 00593 */ 00594 CFArrayBox& divide(Complex a_r, 00595 const Box& a_subbox, 00596 int a_comp = 0, 00597 int a_numcomp = 1); 00598 00599 /// 00600 /** 00601 Modifies this CFArrayBox by pointwise division of the values by the 00602 argument CFArrayBox. You might come to grief if the domains of the 00603 CFArrayBoxes don't match. 00604 */ 00605 CFArrayBox& operator /= (const CFArrayBox& a_x); 00606 00607 /// 00608 /** 00609 Modifies this CFArrayBox by pointwise division by the values in the 00610 argument CFArrayBox. You might come to grief if the domains of the 00611 CFArrayBoxes don't match. The same as the /= operator. 00612 */ 00613 CFArrayBox& divide(const CFArrayBox& a_x); 00614 00615 /// 00616 /** 00617 Modifies this CFArrayBox by pointwise division by values in the argument 00618 CFArrayBox. Divides this CFArrayBox's components (a_destcomp : 00619 a_destcomp+a_numcomp-1) by a_src's components (a_srccomp : 00620 a_srccomp+a_numcomp-1) where the domains of the two CFArrayBoxes intersect. 00621 */ 00622 CFArrayBox& divide(const CFArrayBox& a_src, 00623 int a_srccomp, 00624 int a_destcomp, 00625 int a_numcomp = 1); 00626 00627 /// 00628 /** 00629 Modifies this CFArrayBox by pointwise division by values in the argument 00630 CFArrayBox. Divides this CFArrayBox's components (a_destcomp : 00631 a_destcomp+a_numcomp-1) by a_src's components (a_srccomp : 00632 a_srccomp+a_numcomp-1) where the domain of this CFArrayBox intersects 00633 the a_subbox. NOTE: a_subbox must be contained in this FAB. 00634 */ 00635 CFArrayBox& divide(const CFArrayBox& a_src, 00636 const Box& a_subbox, 00637 int a_srccomp, 00638 int a_destcomp, 00639 int a_numcomp = 1); 00640 00641 /// 00642 /** 00643 Modifies this CFArrayBox by pointwise division by values in the argument 00644 CFArrayBox. Divides this CFArrayBox's components (a_destcomp : 00645 a_destcomp+a_numcomp-1) in the Box a_destbox by a_src's components 00646 (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox. Corresponding 00647 locations within the two CFArrayBoxes are indexed relative to a_srcbox and 00648 a_destbox, and will in general not be the same. The a_srcbox and 00649 a_destbox must be same size. The results are UNDEFINED if the a_src and 00650 dest CFArrayBoxes are the same and the a_srcbox and a_destbox overlap. 00651 */ 00652 CFArrayBox& divide(const CFArrayBox& a_src, 00653 const Box& a_srcbox, 00654 const Box& a_destbox, 00655 int a_srccomp, 00656 int a_destcomp, 00657 int a_numcomp = 1); 00658 00659 /// 00660 Complex get(const IntVect& a_iv, 00661 int a_comp) const 00662 { 00663 return this->operator()(a_iv, a_comp); 00664 } 00665 00666 /// 00667 void set(const IntVect& a_iv, 00668 int a_comp, 00669 Complex a_val) 00670 { 00671 this->operator()(a_iv, a_comp) = a_val; 00672 } 00673 00674 //! Computes a_A * a_X + a_B * a_Y, placing the result in this CFArrayBox. 00675 CFArrayBox& axby(const CFArrayBox& a_X, const CFArrayBox& a_Y, 00676 Complex a_A, Complex a_B); 00677 00678 //! Computes a_A * a_X + a_B * a_Y, placing the result in this CFArrayBox. 00679 //! This version performs this operation only for the given component 00680 //! in each CFArrayBox. 00681 CFArrayBox& axby(const CFArrayBox& a_X, const CFArrayBox& a_Y, 00682 Complex a_A, Complex a_B, 00683 int a_destComp, int a_xComp, int a_yComp); 00684 00685 protected: 00686 virtual void performCopy(const BaseFab<Complex>& a_src, 00687 const Box& a_srcbox, 00688 int a_srccomp, 00689 const Box& a_destbox, 00690 int a_destcomp, 00691 int a_numcomp); 00692 00693 00694 private: 00695 // 00696 // These are disallowed. 00697 // 00698 CFArrayBox (const CFArrayBox&); 00699 CFArrayBox& operator = (const CFArrayBox&); 00700 }; 00701 00702 #include "NamespaceFooter.H" 00703 #endif