text.cc (4209:57ff8c2ae0cf) | text.cc (5570:13592d41f290) |
---|---|
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; --- 177 unchanged lines hidden (view full) --- 186 Result cdf; 187 188 void operator()(ostream &stream) const; 189}; 190 191void 192ScalarPrint::operator()(ostream &stream) const 193{ | 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; --- 177 unchanged lines hidden (view full) --- 186 Result cdf; 187 188 void operator()(ostream &stream) const; 189}; 190 191void 192ScalarPrint::operator()(ostream &stream) const 193{ |
194 if (flags & nozero && value == 0.0 || 195 flags & nonan && isnan(value)) | 194 if ((flags & nozero && value == 0.0) || 195 (flags & nonan && isnan(value))) |
196 return; 197 198 stringstream pdfstr, cdfstr; 199 200 if (!isnan(pdf)) 201 ccprintf(pdfstr, "%.2f%%", pdf * 100.0); 202 203 if (!isnan(cdf)) --- 265 unchanged lines hidden (view full) --- 469 } else { 470 Counter _min; 471 Result _pdf; 472 Result _cdf = 0.0; 473 474 print.flags = flags | __substat; 475 476 for (int i = 0; i < size; ++i) { | 196 return; 197 198 stringstream pdfstr, cdfstr; 199 200 if (!isnan(pdf)) 201 ccprintf(pdfstr, "%.2f%%", pdf * 100.0); 202 203 if (!isnan(cdf)) --- 265 unchanged lines hidden (view full) --- 469 } else { 470 Counter _min; 471 Result _pdf; 472 Result _cdf = 0.0; 473 474 print.flags = flags | __substat; 475 476 for (int i = 0; i < size; ++i) { |
477 if (flags & nozero && vec[i] == 0.0 || 478 flags & nonan && isnan(vec[i])) | 477 if ((flags & nozero && vec[i] == 0.0) || 478 (flags & nonan && isnan(vec[i]))) |
479 continue; 480 481 _min = i * bucket_size + min; 482 _pdf = vec[i] / total * 100.0; 483 _cdf += _pdf; 484 485 486 print.name = ValueToString(_min, 0, compat); --- 264 unchanged lines hidden --- | 479 continue; 480 481 _min = i * bucket_size + min; 482 _pdf = vec[i] / total * 100.0; 483 _cdf += _pdf; 484 485 486 print.name = ValueToString(_min, 0, compat); --- 264 unchanged lines hidden --- |