text.cc (11359:b0b976a1ceda) text.cc (11565:9b9116df5e88)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 574 unchanged lines hidden (view full) ---

583
584 if (!info.subnames.empty()) {
585 for (off_type i = 0; i < info.x; ++i)
586 if (!info.subnames[i].empty())
587 havesub = true;
588 }
589
590 VResult tot_vec(info.y);
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 574 unchanged lines hidden (view full) ---

583
584 if (!info.subnames.empty()) {
585 for (off_type i = 0; i < info.x; ++i)
586 if (!info.subnames[i].empty())
587 havesub = true;
588 }
589
590 VResult tot_vec(info.y);
591 VResult super_total(1, 0.0);
592 for (off_type i = 0; i < info.x; ++i) {
593 if (havesub && (i >= info.subnames.size() || info.subnames[i].empty()))
594 continue;
595
596 off_type iy = i * info.y;
597 VResult yvec(info.y);
598
599 Result total = 0.0;
600 for (off_type j = 0; j < info.y; ++j) {
601 yvec[j] = info.cvec[iy + j];
602 tot_vec[j] += yvec[j];
603 total += yvec[j];
591 for (off_type i = 0; i < info.x; ++i) {
592 if (havesub && (i >= info.subnames.size() || info.subnames[i].empty()))
593 continue;
594
595 off_type iy = i * info.y;
596 VResult yvec(info.y);
597
598 Result total = 0.0;
599 for (off_type j = 0; j < info.y; ++j) {
600 yvec[j] = info.cvec[iy + j];
601 tot_vec[j] += yvec[j];
602 total += yvec[j];
604 super_total[0] += yvec[j];
605 }
606
607 print.name = info.name + "_" +
608 (havesub ? info.subnames[i] : std::to_string(i));
609 print.desc = info.desc;
610 print.vec = yvec;
611 print.total = total;
612 print(*stream);
613 }
614
615 // Create a subname for printing the total
616 vector<string> total_subname;
617 total_subname.push_back("total");
618
619 if (info.flags.isSet(::Stats::total) && (info.x > 1)) {
620 print.name = info.name;
621 print.subnames = total_subname;
622 print.desc = info.desc;
603 }
604
605 print.name = info.name + "_" +
606 (havesub ? info.subnames[i] : std::to_string(i));
607 print.desc = info.desc;
608 print.vec = yvec;
609 print.total = total;
610 print(*stream);
611 }
612
613 // Create a subname for printing the total
614 vector<string> total_subname;
615 total_subname.push_back("total");
616
617 if (info.flags.isSet(::Stats::total) && (info.x > 1)) {
618 print.name = info.name;
619 print.subnames = total_subname;
620 print.desc = info.desc;
623 print.vec = super_total;
621 print.vec = VResult(1, info.total());
624 print.flags = print.flags & ~total;
625 print(*stream);
626 }
627}
628
629void
630Text::visit(const DistInfo &info)
631{

--- 120 unchanged lines hidden ---
622 print.flags = print.flags & ~total;
623 print(*stream);
624 }
625}
626
627void
628Text::visit(const DistInfo &info)
629{

--- 120 unchanged lines hidden ---