Go to the documentation of this file.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
00027
00028
00029 template<typename T1>
00030 arma_inline
00031 const Op<T1, op_sum>
00032 sum(const Base<typename T1::elem_type,T1>& X, const u32 dim = 0)
00033 {
00034 arma_extra_debug_sigprint();
00035
00036 return Op<T1, op_sum>(X.get_ref(), dim, 0);
00037 }
00038
00039
00040
00041
00042 template<typename eT>
00043 arma_inline
00044 arma_warn_unused
00045 eT
00046 sum(const Row<eT>& X)
00047 {
00048 arma_extra_debug_sigprint();
00049
00050 return accu(X);
00051 }
00052
00053
00054
00055
00056
00057 template<typename eT>
00058 arma_inline
00059 arma_warn_unused
00060 eT
00061 sum(const Col<eT>& X)
00062 {
00063 arma_extra_debug_sigprint();
00064
00065 return accu(X);
00066 }
00067
00068
00069
00070
00071
00072
00073
00074 template<typename T1>
00075 arma_inline
00076 arma_warn_unused
00077 typename T1::elem_type
00078 sum(const Op<T1, op_sum>& in)
00079 {
00080 arma_extra_debug_sigprint();
00081 arma_extra_debug_print("sum(): two consecutive sum() calls detected");
00082
00083 return accu(in.m);
00084 }
00085
00086
00087
00088 template<typename T1>
00089 arma_inline
00090 const Op<Op<T1, op_sum>, op_sum>
00091 sum(const Op<T1, op_sum>& in, const u32 dim)
00092 {
00093 arma_extra_debug_sigprint();
00094
00095 return Op<Op<T1, op_sum>, op_sum>(in, dim, 0);
00096 }
00097
00098
00099
00100
00101 template<typename eT>
00102 arma_inline
00103 arma_warn_unused
00104 eT
00105 sum(const subview_row<eT>& X)
00106 {
00107 arma_extra_debug_sigprint();
00108
00109 return accu(X);
00110 }
00111
00112
00113
00114
00115 template<typename eT>
00116 arma_inline
00117 arma_warn_unused
00118 eT
00119 sum(const subview_col<eT>& X)
00120 {
00121 arma_extra_debug_sigprint();
00122
00123 return accu(X);
00124 }
00125
00126
00127
00128
00129 template<typename eT>
00130 arma_inline
00131 arma_warn_unused
00132 eT
00133 sum(const diagview<eT>& X)
00134 {
00135 arma_extra_debug_sigprint();
00136
00137 return accu(X);
00138 }
00139
00140
00141
00142