/[pspp]/pspp/src/aggregate.c
ViewVC logotype

Diff of /pspp/src/aggregate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by blp, Sun Mar 13 07:31:53 2005 UTC revision 1.28 by blp, Mon Mar 14 06:54:40 2005 UTC
# Line 817  accumulate_aggregate_info (struct agr_pr Line 817  accumulate_aggregate_info (struct agr_pr
817              switch (iter->function)              switch (iter->function)
818                {                {
819                case NMISS:                case NMISS:
820                  case NMISS | FSTRING:
821                  iter->dbl[0] += weight;                  iter->dbl[0] += weight;
822                  break;                  break;
823                case NUMISS:                case NUMISS:
824                  case NUMISS | FSTRING:
825                  iter->int1++;                  iter->int1++;
826                  break;                  break;
827                }                }
# Line 904  accumulate_aggregate_info (struct agr_pr Line 906  accumulate_aggregate_info (struct agr_pr
906            case FOUT | FSTRING:            case FOUT | FSTRING:
907            case POUT | FSTRING:            case POUT | FSTRING:
908              if (memcmp (iter->arg[0].c, v->s, iter->src->width) > 0              if (memcmp (iter->arg[0].c, v->s, iter->src->width) > 0
909                  && memcmp (iter->arg[1].c, v->s, iter->src->width) < 0)                  || memcmp (iter->arg[1].c, v->s, iter->src->width) < 0)
910                iter->dbl[0] += weight;                iter->dbl[0] += weight;
911              iter->dbl[1] += weight;              iter->dbl[1] += weight;
912              break;              break;
# Line 1033  dump_aggregate_info (struct agr_proc *ag Line 1035  dump_aggregate_info (struct agr_proc *ag
1035              else              else
1036                memset (v->s, ' ', i->dest->width);                memset (v->s, ' ', i->dest->width);
1037              break;              break;
           case FGT | FSTRING:  
           case FLT | FSTRING:  
           case FIN | FSTRING:  
           case FOUT | FSTRING:  
             v->f = i->int2 ? (double) i->int1 / (double) i->int2 : SYSMIS;  
             break;  
1038            case FGT:            case FGT:
1039              case FGT | FSTRING:
1040            case FLT:            case FLT:
1041              case FLT | FSTRING:
1042            case FIN:            case FIN:
1043              case FIN | FSTRING:
1044            case FOUT:            case FOUT:
1045              case FOUT | FSTRING:
1046              v->f = i->dbl[1] ? i->dbl[0] / i->dbl[1] : SYSMIS;              v->f = i->dbl[1] ? i->dbl[0] / i->dbl[1] : SYSMIS;
1047              break;              break;
1048            case PGT:            case PGT:
# Line 1104  initialize_aggregate_info (struct agr_pr Line 1104  initialize_aggregate_info (struct agr_pr
1104    for (iter = agr->agr_vars; iter; iter = iter->next)    for (iter = agr->agr_vars; iter; iter = iter->next)
1105      {      {
1106        iter->missing = 0;        iter->missing = 0;
1107          iter->dbl[0] = iter->dbl[1] = iter->dbl[2] = 0.0;
1108          iter->int1 = iter->int2 = 0;
1109        switch (iter->function)        switch (iter->function)
1110          {          {
1111          case MIN:          case MIN:
1112            iter->dbl[0] = DBL_MAX;            iter->dbl[0] = DBL_MAX;
           iter->int1 = 0;  
1113            break;            break;
1114          case MIN | FSTRING:          case MIN | FSTRING:
1115            memset (iter->string, 255, iter->src->width);            memset (iter->string, 255, iter->src->width);
1116            break;            break;
1117          case MAX:          case MAX:
1118            iter->dbl[0] = -DBL_MAX;            iter->dbl[0] = -DBL_MAX;
           iter->int1 = 0;  
1119            break;            break;
1120          case MAX | FSTRING:          case MAX | FSTRING:
1121            memset (iter->string, 0, iter->src->width);            memset (iter->string, 0, iter->src->width);
# Line 1126  initialize_aggregate_info (struct agr_pr Line 1126  initialize_aggregate_info (struct agr_pr
1126            else            else
1127              moments1_clear (iter->moments);              moments1_clear (iter->moments);
1128            break;            break;
1129          default:          default:
1130            iter->dbl[0] = iter->dbl[1] = iter->dbl[2] = 0.0;            break;
           iter->int1 = iter->int2 = 0;  
           break;  
1131          }          }
1132      }      }
1133  }  }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26