28 #ifndef _util_group_messaget_h
29 #define _util_group_messaget_h
32 #pragma implementation
35 #include <util/group/message.h>
41 GrpSumReduce<T>::reduce(T*target, T*data,
int nelement)
43 for (
int i=0; i<nelement; i++) {
50 GrpMinReduce<T>::reduce(T*target, T*data,
int nelement)
52 for (
int i=0; i<nelement; i++) {
53 if (target[i] > data[i]) target[i] = data[i];
59 GrpMaxReduce<T>::reduce(T*target, T*data,
int nelement)
61 for (
int i=0; i<nelement; i++) {
62 if (target[i] < data[i]) target[i] = data[i];
68 GrpArithmeticAndReduce<T>::reduce(T*target, T*data,
int nelement)
70 for (
int i=0; i<nelement; i++) {
71 target[i] = target[i] & data[i];
77 GrpArithmeticOrReduce<T>::reduce(T*target, T*data,
int nelement)
79 for (
int i=0; i<nelement; i++) {
80 target[i] = target[i] | data[i];
86 GrpArithmeticXOrReduce<T>::reduce(T*target, T*data,
int nelement)
88 for (
int i=0; i<nelement; i++) {
89 target[i] = target[i] ^ data[i];
95 GrpProductReduce<T>::reduce(T*target, T*data,
int nelement)
97 for (
int i=0; i<nelement; i++) {
104 GrpFunctionReduce<T>::reduce(T*target, T*data,
int nelement)
106 (*func_)(target,data,nelement);