00001 // Copyright (C) 2009 NICTA 00002 // 00003 // Authors: 00004 // - Conrad Sanderson (conradsand at ieee dot org) 00005 // 00006 // This file is part of the Armadillo C++ library. 00007 // It is provided without any warranty of fitness 00008 // for any purpose. You can redistribute this file 00009 // and/or modify it under the terms of the GNU 00010 // Lesser General Public License (LGPL) as published 00011 // by the Free Software Foundation, either version 3 00012 // of the License or (at your option) any later version. 00013 // (see http://www.opensource.org/licenses for more info) 00014 00015 00016 //! \addtogroup operator_plus 00017 //! @{ 00018 00019 00020 00021 //! unary plus operation (does nothing, but is required for completeness) 00022 template<typename T1> 00023 arma_inline 00024 const Base<typename T1::elem_type,T1>& 00025 operator+ 00026 (const Base<typename T1::elem_type,T1>& X) 00027 { 00028 arma_extra_debug_sigprint(); 00029 00030 return X; 00031 } 00032 00033 00034 00035 //! Base + scalar 00036 template<typename T1> 00037 arma_inline 00038 const Op<T1, op_scalar_plus> 00039 operator+ 00040 (const Base<typename T1::elem_type,T1>& X, const typename T1::elem_type k) 00041 { 00042 arma_extra_debug_sigprint(); 00043 00044 return Op<T1, op_scalar_plus>(X.get_ref(), k); 00045 } 00046 00047 00048 00049 //! op + scalar, level 2 00050 template<typename T1> 00051 arma_inline 00052 const Op<T1,op_scalar_plus> 00053 operator+ 00054 (const Op<T1,op_scalar_plus>& X, const typename T1::elem_type k) 00055 { 00056 arma_extra_debug_sigprint(); 00057 00058 return Op<T1, op_scalar_plus>(X.m, X.aux + k); 00059 } 00060 00061 00062 00063 //! scalar + Base 00064 template<typename T1> 00065 arma_inline 00066 const Op<T1, op_scalar_plus> 00067 operator+ 00068 (const typename T1::elem_type k, const Base<typename T1::elem_type,T1>& X) 00069 { 00070 arma_extra_debug_sigprint(); 00071 00072 return Op<T1, op_scalar_plus>(X.get_ref(), k); // NOTE: order is swapped 00073 } 00074 00075 00076 00077 //! Base + diagmat 00078 template<typename T1, typename T2> 00079 arma_inline 00080 const Glue<T1, Op<T2,op_diagmat>, glue_plus_diag> 00081 operator+ 00082 (const Base<typename T2::elem_type, T1>& X, const Op<T2,op_diagmat>& Y) 00083 { 00084 arma_extra_debug_sigprint(); 00085 00086 return Glue<T1, Op<T2,op_diagmat>, glue_plus_diag>(X.get_ref(), Y); 00087 } 00088 00089 00090 00091 //! diagmat + Base 00092 template<typename T1, typename T2> 00093 arma_inline 00094 const Glue<T1, Op<T2,op_diagmat>, glue_plus_diag> 00095 operator+ 00096 (const Op<T2,op_diagmat>& Y, const Base<typename T1::elem_type, T1>& X) 00097 { 00098 arma_extra_debug_sigprint(); 00099 00100 return Glue<T1, Op<T2,op_diagmat>, glue_plus_diag>(X.get_ref(), Y); // NOTE: order is swapped 00101 } 00102 00103 00104 00105 // 00106 // addition of Base objects with different element types 00107 // 00108 00109 00110 00111 //! Base + Base 00112 template<typename eT1, typename T1, typename eT2, typename T2> 00113 arma_inline 00114 Mat<typename promote_type<eT1,eT2>::result> 00115 operator+ 00116 (const Base<eT1,T1>& X, const Base<eT2,T2>& Y) 00117 { 00118 arma_extra_debug_sigprint(); 00119 00120 promote_type<eT1,eT2>::check(); 00121 00122 const unwrap<T1> tmp1(X.get_ref()); 00123 const unwrap<T2> tmp2(Y.get_ref()); 00124 00125 const Mat<eT1>& A = tmp1.M; 00126 const Mat<eT2>& B = tmp2.M; 00127 00128 Mat< typename promote_type<eT1,eT2>::result > out; 00129 glue_plus::apply_mixed(out, A, B); 00130 00131 return out; 00132 } 00133 00134 00135 00136 // 00137 // addition of Base objects with same element types 00138 // 00139 00140 00141 00142 template<typename T1, typename T2> 00143 arma_inline 00144 const Glue<T1, T2, glue_plus> 00145 operator+ 00146 (const Base<std::complex<double>,T1>& X, const Base<std::complex<double>,T2>& Y) 00147 { 00148 arma_extra_debug_sigprint(); 00149 00150 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00151 } 00152 00153 00154 00155 template<typename T1, typename T2> 00156 arma_inline 00157 const Glue<T1, T2, glue_plus> 00158 operator+ 00159 (const Base<std::complex<float>,T1>& X, const Base<std::complex<float>,T2>& Y) 00160 { 00161 arma_extra_debug_sigprint(); 00162 00163 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00164 } 00165 00166 00167 00168 template<typename T1, typename T2> 00169 arma_inline 00170 const Glue<T1, T2, glue_plus> 00171 operator+ 00172 (const Base<double,T1>& X, const Base<double,T2>& Y) 00173 { 00174 arma_extra_debug_sigprint(); 00175 00176 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00177 } 00178 00179 00180 00181 template<typename T1, typename T2> 00182 arma_inline 00183 const Glue<T1, T2, glue_plus> 00184 operator+ 00185 (const Base<float,T1>& X, const Base<float,T2>& Y) 00186 { 00187 arma_extra_debug_sigprint(); 00188 00189 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00190 } 00191 00192 00193 00194 template<typename T1, typename T2> 00195 arma_inline 00196 const Glue<T1, T2, glue_plus> 00197 operator+ 00198 (const Base<s32,T1>& X, const Base<s32,T2>& Y) 00199 { 00200 arma_extra_debug_sigprint(); 00201 00202 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00203 } 00204 00205 00206 00207 template<typename T1, typename T2> 00208 arma_inline 00209 const Glue<T1, T2, glue_plus> 00210 operator+ 00211 (const Base<u32,T1>& X, const Base<u32,T2>& Y) 00212 { 00213 arma_extra_debug_sigprint(); 00214 00215 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00216 } 00217 00218 00219 00220 template<typename T1, typename T2> 00221 arma_inline 00222 const Glue<T1, T2, glue_plus> 00223 operator+ 00224 (const Base<s16,T1>& X, const Base<s16,T2>& Y) 00225 { 00226 arma_extra_debug_sigprint(); 00227 00228 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00229 } 00230 00231 00232 00233 template<typename T1, typename T2> 00234 arma_inline 00235 const Glue<T1, T2, glue_plus> 00236 operator+ 00237 (const Base<u16,T1>& X, const Base<u16,T2>& Y) 00238 { 00239 arma_extra_debug_sigprint(); 00240 00241 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00242 } 00243 00244 00245 00246 template<typename T1, typename T2> 00247 arma_inline 00248 const Glue<T1, T2, glue_plus> 00249 operator+ 00250 (const Base<s8,T1>& X, const Base<s8,T2>& Y) 00251 { 00252 arma_extra_debug_sigprint(); 00253 00254 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00255 } 00256 00257 00258 00259 template<typename T1, typename T2> 00260 arma_inline 00261 const Glue<T1, T2, glue_plus> 00262 operator+ 00263 (const Base<u8,T1>& X, const Base<u8,T2>& Y) 00264 { 00265 arma_extra_debug_sigprint(); 00266 00267 return Glue<T1, T2, glue_plus>(X.get_ref(), Y.get_ref()); 00268 } 00269 00270 00271 00272 // 00273 // old operators 00274 // 00275 00276 // //! unary plus operation (does nothing, but is required for completeness) 00277 // template<typename mT> 00278 // arma_inline 00279 // const Mat<mT>& 00280 // operator+ 00281 // (const Mat<mT>& X) 00282 // { 00283 // arma_extra_debug_sigprint(); 00284 // 00285 // return X; 00286 // } 00287 // 00288 // 00289 // 00290 // //! unary plus operation (does nothing, but is required for completeness) 00291 // template<typename T1, typename op_type> 00292 // arma_inline 00293 // const Op<T1, op_type>& 00294 // operator+ 00295 // (const Op<T1, op_type>& X) 00296 // { 00297 // arma_extra_debug_sigprint(); 00298 // 00299 // return X; 00300 // } 00301 // 00302 // //! unary plus operation (does nothing, but is required for completeness) 00303 // template<typename T1, typename T2, typename glue_type> 00304 // arma_inline 00305 // const Glue<T1, T2, glue_type>& 00306 // operator+ 00307 // (const Glue<T1, T2, glue_type>& X) 00308 // { 00309 // arma_extra_debug_sigprint(); 00310 // 00311 // return X; 00312 // } 00313 // 00314 // 00315 // 00316 // //! mat + scalar 00317 // template<typename mT> 00318 // arma_inline 00319 // const Op<Mat<mT>, op_scalar_plus> 00320 // operator+ 00321 // (const Mat<mT>& X, const mT k) 00322 // { 00323 // arma_extra_debug_sigprint(); 00324 // 00325 // return Op<Mat<mT>, op_scalar_plus>(X,k); 00326 // } 00327 // 00328 // 00329 // 00330 // //! op + scalar 00331 // template<typename T1, typename op_type> 00332 // arma_inline 00333 // const Op<Op<T1,op_type>, op_scalar_plus> 00334 // operator+ 00335 // (const Op<T1,op_type>& X, const typename T1::elem_type k) 00336 // { 00337 // arma_extra_debug_sigprint(); 00338 // 00339 // return Op<Op<T1,op_type>, op_scalar_plus>(X,k); 00340 // } 00341 // 00342 // 00343 // 00344 // //! op + scalar, level 2 00345 // template<typename T1> 00346 // arma_inline 00347 // const Op<T1,op_scalar_plus> 00348 // operator+ 00349 // (const Op<T1,op_scalar_plus>& X, const typename T1::elem_type k) 00350 // { 00351 // arma_extra_debug_sigprint(); 00352 // 00353 // return Op<T1, op_scalar_plus>(X.m, X.aux + k); 00354 // } 00355 // 00356 // 00357 // //! glue + scalar 00358 // template<typename T1, typename T2, typename glue_type> 00359 // arma_inline 00360 // const Op<Glue<T1,T2,glue_type>, op_scalar_plus> 00361 // operator+ 00362 // (const Glue<T1,T2,glue_type>& X, const typename T1::elem_type k) 00363 // { 00364 // arma_extra_debug_sigprint(); 00365 // 00366 // return Op<Glue<T1,T2,glue_type>, op_scalar_plus>(X,k); 00367 // } 00368 // 00369 // 00370 // //! scalar + mat 00371 // template<typename mT> 00372 // arma_inline 00373 // const Op<Mat<mT>, op_scalar_plus> 00374 // operator+ 00375 // (const mT k, const Mat<mT>& X) 00376 // { 00377 // arma_extra_debug_sigprint(); 00378 // 00379 // return Op<Mat<mT>, op_scalar_plus>(X,k); // NOTE: order is swapped 00380 // } 00381 // 00382 // 00383 // 00384 // //! scalar + op 00385 // template<typename T1, typename op_type> 00386 // arma_inline 00387 // const Op<Op<T1,op_type>, op_scalar_plus> 00388 // operator+ 00389 // (const typename T1::elem_type k, const Op<T1,op_type>& X) 00390 // { 00391 // arma_extra_debug_sigprint(); 00392 // 00393 // return Op<Op<T1,op_type>, op_scalar_plus>(X,k); // NOTE: order is swapped 00394 // } 00395 // 00396 // 00397 // 00398 // //! scalar + glue 00399 // template<typename T1, typename T2, typename glue_type> 00400 // arma_inline 00401 // const Op<Glue<T1,T2,glue_type>, op_scalar_plus> 00402 // operator+ 00403 // (const typename T1::elem_type k, const Glue<T1,T2,glue_type>& X) 00404 // { 00405 // arma_extra_debug_sigprint(); 00406 // 00407 // return Op<Glue<T1,T2,glue_type>, op_scalar_plus>(X,k); // NOTE: order is swapped 00408 // } 00409 // 00410 // 00411 // //! mat + mat 00412 // template<typename mT> 00413 // arma_inline 00414 // const Glue<Mat<mT>, Mat<mT>, glue_plus> 00415 // operator+ 00416 // (const Mat<mT>& X, const Mat<mT>& Y) 00417 // { 00418 // arma_extra_debug_sigprint(); 00419 // 00420 // return Glue<Mat<mT>, Mat<mT>, glue_plus>(X,Y); 00421 // } 00422 // 00423 // 00424 // 00425 // //! mat + diagmat(T1) 00426 // template<typename T1> 00427 // arma_inline 00428 // const Glue<Mat<typename T1::elem_type>, Op<T1,op_diagmat>, glue_plus_diag> 00429 // operator+ 00430 // (const Mat<typename T1::elem_type>& X, const Op<T1,op_diagmat>& Y) 00431 // { 00432 // arma_extra_debug_sigprint(); 00433 // 00434 // return Glue<Mat<typename T1::elem_type>, Op<T1,op_diagmat>, glue_plus_diag>(X,Y); 00435 // } 00436 // 00437 // 00438 // 00439 // //! diagmat(T1) + mat 00440 // template<typename T1> 00441 // arma_inline 00442 // const Glue<Op<T1,op_diagmat>, Mat<typename T1::elem_type>, glue_plus_diag> 00443 // operator+ 00444 // (const Op<T1,op_diagmat>& X, const Mat<typename T1::elem_type>& Y) 00445 // { 00446 // arma_extra_debug_sigprint(); 00447 // 00448 // return Glue<Op<T1,op_diagmat>, Mat<typename T1::elem_type>, glue_plus_diag>(X,Y); 00449 // } 00450 // 00451 // 00452 // 00453 // //! diagmat(T1) + diagmat(T2) 00454 // template<typename T1, typename T2> 00455 // arma_inline 00456 // const Glue< Op<T1,op_diagmat>, Op<T2,op_diagmat>, glue_plus_diag> 00457 // operator+ 00458 // (const Op<T1,op_diagmat>& X, const Op<T2,op_diagmat>& Y) 00459 // { 00460 // arma_extra_debug_sigprint(); 00461 // 00462 // return Glue< Op<T1,op_diagmat>, Op<T2,op_diagmat>, glue_plus_diag>(X,Y); 00463 // } 00464 // 00465 // 00466 // 00467 // //! mat + op 00468 // template<typename T1, typename op_type> 00469 // arma_inline 00470 // const Glue<Mat<typename T1::elem_type>, Op<T1,op_type>, glue_plus> 00471 // operator+ 00472 // (const Mat<typename T1::elem_type>& X, const Op<T1,op_type>& Y) 00473 // { 00474 // arma_extra_debug_sigprint(); 00475 // 00476 // return Glue<Mat<typename T1::elem_type>, Op<T1,op_type>, glue_plus>(X,Y); 00477 // } 00478 // 00479 // 00480 // 00481 // //! diagmat(T1) + op 00482 // template<typename T1, typename T2, typename op_type> 00483 // arma_inline 00484 // const Glue< Op<T1,op_diagmat>, Op<T2,op_type>, glue_plus_diag> 00485 // operator+ 00486 // (const Op<T1,op_diagmat>& X, const Op<T2,op_type>& Y) 00487 // { 00488 // arma_extra_debug_sigprint(); 00489 // 00490 // return Glue< Op<T1,op_diagmat>, Op<T2,op_type>, glue_plus_diag>(X,Y); 00491 // } 00492 // 00493 // 00494 // //! op + mat 00495 // template<typename T1, typename op_type> 00496 // arma_inline 00497 // const Glue<Op<T1,op_type>, Mat<typename T1::elem_type>, glue_plus> 00498 // operator+ 00499 // (const Op<T1,op_type>& X, const Mat<typename T1::elem_type>& Y) 00500 // { 00501 // arma_extra_debug_sigprint(); 00502 // 00503 // return Glue<Op<T1,op_type>, Mat<typename T1::elem_type>, glue_plus>(X,Y); 00504 // } 00505 // 00506 // 00507 // 00508 // //! op + diagmat(T2) 00509 // template<typename T1, typename op_type, typename T2> 00510 // arma_inline 00511 // const Glue<Op<T1,op_type>, Op<T2,op_diagmat>, glue_plus_diag> 00512 // operator+ 00513 // (const Op<T1,op_type>& X, const Op<T2,op_diagmat>& Y) 00514 // { 00515 // arma_extra_debug_sigprint(); 00516 // 00517 // return Glue<Op<T1,op_type>, Op<T2,op_diagmat>, glue_plus_diag>(X,Y); 00518 // } 00519 // 00520 // 00521 // 00522 // //! op + glue 00523 // template<typename T1, typename op_type, typename T2, typename T3, typename glue_type> 00524 // arma_inline 00525 // const Glue<Op<T1,op_type>, Glue<T2, T3, glue_type>, glue_plus> 00526 // operator+ 00527 // (const Op<T1,op_type>& X, const Glue<T2, T3, glue_type>& Y) 00528 // { 00529 // arma_extra_debug_sigprint(); 00530 // 00531 // return Glue<Op<T1,op_type>, Glue<T2, T3, glue_type>, glue_plus>(X,Y); 00532 // } 00533 // 00534 // 00535 // 00536 // //! glue + op 00537 // template<typename T1, typename op_type, typename T2, typename T3, typename glue_type> 00538 // arma_inline 00539 // const Glue<Glue<T2, T3, glue_type>, Op<T1,op_type>, glue_plus> 00540 // operator+ 00541 // (const Glue<T2, T3, glue_type>& X, const Op<T1,op_type>& Y) 00542 // { 00543 // arma_extra_debug_sigprint(); 00544 // 00545 // return Glue<Glue<T2, T3, glue_type>, Op<T1,op_type>, glue_plus>(X,Y); 00546 // } 00547 // 00548 // 00549 // 00550 // //! mat + glue 00551 // template<typename T1, typename T2, typename glue_type> 00552 // arma_inline 00553 // const Glue<Mat<typename T1::elem_type>, Glue<T1, T2,glue_type>, glue_plus> 00554 // operator+ 00555 // (const Mat<typename T1::elem_type>& X, const Glue<T1, T2,glue_type>& Y) 00556 // { 00557 // arma_extra_debug_sigprint(); 00558 // 00559 // return Glue<Mat<typename T1::elem_type>, Glue<T1, T2,glue_type>, glue_plus>(X,Y); 00560 // } 00561 // 00562 // 00563 // 00564 // //! diagmat(T1) + glue 00565 // template<typename T1, typename T2, typename T3, typename glue_type> 00566 // arma_inline 00567 // const Glue< Op<T1,op_diagmat>, Glue<T2,T3,glue_type>, glue_plus_diag> 00568 // operator+ 00569 // (const Op<T1,op_diagmat>& X, const Glue<T2,T3,glue_type>& Y) 00570 // { 00571 // arma_extra_debug_sigprint(); 00572 // 00573 // return Glue< Op<T1,op_diagmat>, Glue<T2,T3,glue_type>, glue_plus_diag>(X,Y); 00574 // } 00575 // 00576 // 00577 // 00578 // //! glue + mat 00579 // template<typename T1, typename T2, typename glue_type> 00580 // arma_inline 00581 // const Glue<Glue<T1, T2,glue_type>, Mat<typename T1::elem_type>, glue_plus> 00582 // operator+ 00583 // (const Glue<T1, T2,glue_type>& X, const Mat<typename T1::elem_type>& Y) 00584 // { 00585 // arma_extra_debug_sigprint(); 00586 // 00587 // return Glue<Glue<T1, T2,glue_type>, Mat<typename T1::elem_type>, glue_plus>(X,Y); 00588 // } 00589 // 00590 // 00591 // 00592 // //! glue + diagmat(T3) 00593 // template<typename T1, typename T2, typename glue_type, typename T3> 00594 // arma_inline 00595 // const Glue< Glue<T1,T2,glue_type>, Op<T3,op_diagmat>, glue_plus_diag> 00596 // operator+ 00597 // (const Glue<T1, T2,glue_type>& X, const Op<T3,op_diagmat>& Y) 00598 // { 00599 // arma_extra_debug_sigprint(); 00600 // 00601 // return Glue< Glue<T1,T2,glue_type>, Op<T3,op_diagmat>, glue_plus_diag>(X,Y); 00602 // } 00603 // 00604 // 00605 // 00606 // //! op + op 00607 // template<typename T1, typename op_type1, typename T2, typename op_type2> 00608 // arma_inline 00609 // const Glue<Op<T1,op_type1>, Op<T2,op_type2>, glue_plus> 00610 // operator+ 00611 // (const Op<T1,op_type1>& X, const Op<T2,op_type2>& Y) 00612 // { 00613 // arma_extra_debug_sigprint(); 00614 // 00615 // return Glue<Op<T1,op_type1>, Op<T2,op_type2>, glue_plus>(X,Y); 00616 // } 00617 // 00618 // 00619 // 00620 // //! glue + glue 00621 // template<typename T1, typename T2, typename glue_type1, typename T3, typename T4, typename glue_type2> 00622 // arma_inline 00623 // const Glue<Glue<T1,T2,glue_type1>, Glue<T3,T4,glue_type2>, glue_plus> 00624 // operator+ 00625 // (const Glue<T1,T2,glue_type1>& X, const Glue<T3,T4,glue_type2>& Y) 00626 // { 00627 // arma_extra_debug_sigprint(); 00628 // 00629 // return Glue<Glue<T1,T2,glue_type1>, Glue<T3,T4,glue_type2>, glue_plus>(X,Y); 00630 // } 00631 // 00632 // 00633 // 00634 // //! Base + subview 00635 // template<typename T1> 00636 // arma_inline 00637 // const Glue<T1, subview<typename T1::elem_type>, glue_plus> 00638 // operator+ 00639 // (const Base<T1>& X, const subview<typename T1::elem_type>& Y) 00640 // { 00641 // arma_extra_debug_sigprint(); 00642 // 00643 // return Glue<T1, subview<typename T1::elem_type>, glue_plus>(X.get_ref(),Y); 00644 // } 00645 // 00646 // 00647 // 00648 // //! subview + Base 00649 // template<typename T1> 00650 // arma_inline 00651 // const Glue<subview<typename T1::elem_type>, T1, glue_plus> 00652 // operator+ 00653 // (const subview<typename T1::elem_type>& X, const Base<T1>& Y) 00654 // { 00655 // arma_extra_debug_sigprint(); 00656 // 00657 // return Glue<subview<typename T1::elem_type>, T1, glue_plus>(X,Y.get_ref()); 00658 // } 00659 // 00660 // 00661 // 00662 // //! Base + diagview 00663 // template<typename T1> 00664 // arma_inline 00665 // const Glue<T1, diagview<typename T1::elem_type>, glue_plus> 00666 // operator+ 00667 // (const Base<T1>& X, const diagview<typename T1::elem_type>& Y) 00668 // { 00669 // arma_extra_debug_sigprint(); 00670 // 00671 // return Glue<T1, diagview<typename T1::elem_type>, glue_plus>(X.get_ref(),Y); 00672 // } 00673 // 00674 // 00675 // 00676 // //! diagview + Base 00677 // template<typename T1> 00678 // arma_inline 00679 // const Glue<diagview<typename T1::elem_type>, T1, glue_plus> 00680 // operator+ 00681 // (const diagview<typename T1::elem_type>& X, const T1& Y) 00682 // { 00683 // arma_extra_debug_sigprint(); 00684 // 00685 // return Glue<diagview<typename T1::elem_type>, T1, glue_plus>(X,Y.get_ref()); 00686 // } 00687 // 00688 // 00689 // 00690 // //! scalar + subview 00691 // template<typename mT> 00692 // arma_inline 00693 // const Op<subview<mT>, op_scalar_plus> 00694 // operator+ 00695 // (const mT k, const subview<mT>& X) 00696 // { 00697 // arma_extra_debug_sigprint(); 00698 // 00699 // return Op<subview<mT>, op_scalar_plus>(X,k); 00700 // } 00701 // 00702 // 00703 // 00704 // //! scalar + diagview 00705 // template<typename mT> 00706 // arma_inline 00707 // const Op<diagview<mT>, op_scalar_plus> 00708 // operator+ 00709 // (const mT k, const diagview<mT>& X) 00710 // { 00711 // arma_extra_debug_sigprint(); 00712 // 00713 // return Op<diagview<mT>, op_scalar_plus>(X,k); 00714 // } 00715 // 00716 // 00717 // 00718 // //! subview + scalar 00719 // template<typename mT> 00720 // arma_inline 00721 // const Op<subview<mT>, op_scalar_plus> 00722 // operator+ 00723 // (const subview<mT>& X, const mT k) 00724 // { 00725 // arma_extra_debug_sigprint(); 00726 // 00727 // return Op<subview<mT>, op_scalar_plus>(X,k); 00728 // } 00729 // 00730 // 00731 // 00732 // //! diagview + scalar 00733 // template<typename mT> 00734 // arma_inline 00735 // const Op<diagview<mT>, op_scalar_plus> 00736 // operator+ 00737 // (const diagview<mT>& X, const mT k) 00738 // { 00739 // arma_extra_debug_sigprint(); 00740 // 00741 // return Op<diagview<mT>, op_scalar_plus>(X,k); 00742 // } 00743 00744 00745 00746 //! @}