Deleted Added
sdiff udiff text old ( 7462:0c61c3cf7639 ) new ( 7504:ad631c296c9b )
full compact
1/*
2 * Copyright (c) 2003-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;

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

396
397 info->y_subnames.resize(self.y);
398 for (off_type i = 0; i < self.y; ++i)
399 info->y_subnames[i] = names[i];
400 return self;
401 }
402
403 Derived &
404 ysubname(off_type index, const std::string subname)
405 {
406 Derived &self = this->self();
407 Info *info = this->info();
408
409 assert(index < self.y);
410 info->y_subnames.resize(self.y);
411 info->y_subnames[index] = subname.c_str();
412 return self;
413 }
414};
415
416//////////////////////////////////////////////////////////////////////
417//
418// Simple Statistics
419//
420//////////////////////////////////////////////////////////////////////
421

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

1192 for (off_type i = 0; i < _size; ++i)
1193 new (&storage[i]) Storage(info);
1194
1195 this->setInit();
1196
1197 return self;
1198 }
1199
1200 std::string ysubname(off_type i) const { return (*this->y_subnames)[i]; }
1201
1202 Proxy
1203 operator[](off_type index)
1204 {
1205 off_type offset = index * y;
1206 assert (index >= 0 && offset + index < size());
1207 return Proxy(this->self(), offset, y);
1208 }
1209

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

1708 size() const
1709 {
1710 return _size;
1711 }
1712
1713 bool
1714 zero() const
1715 {
1716 return false;
1717#if 0
1718 for (off_type i = 0; i < size(); ++i)
1719 if (!data(i)->zero())
1720 return false;
1721 return true;
1722#endif
1723 }
1724
1725 void
1726 prepare()
1727 {
1728 Info *info = this->info();
1729 size_type size = this->size();
1730 info->data.resize(size);

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

1787 return data()->zero();
1788 }
1789
1790 /**
1791 * Proxy has no state. Nothing to reset.
1792 */
1793 void reset() { }
1794};
1795/*
1796template <class Derived, class Stor>
1797inline typename VectorDistBase<Derived, Stor>::Proxy
1798VectorDistBase<Derived, Stor>::operator[](off_type index)
1799{
1800 assert (index >= 0 && index < size());
1801 typedef typename VectorDistBase<Derived, Stor>::Proxy Proxy;
1802 return Proxy(this->self(), index);
1803}
1804*/
1805
1806#if 0
1807template <class Storage>
1808Result
1809VectorDistBase<Storage>::total(off_type index) const
1810{
1811 Result total = 0.0;
1812 for (off_type i = 0; i < x_size(); ++i)
1813 total += data(i)->result();
1814}
1815#endif
1816
1817//////////////////////////////////////////////////////////////////////
1818//
1819// Formula Details
1820//
1821//////////////////////////////////////////////////////////////////////
1822
1823/**
1824 * Base class for formula statistic node. These nodes are used to build a tree

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

2286class StandardDeviation : public DistBase<StandardDeviation, SampleStor>
2287{
2288 public:
2289 /**
2290 * Construct and initialize this distribution.
2291 */
2292 StandardDeviation()
2293 {
2294 this->doInit();
2295 }
2296};
2297
2298/**
2299 * Calculates the per tick mean and variance of the samples.
2300 * @sa DistBase, AvgSampleStor
2301 */
2302class AverageDeviation : public DistBase<AverageDeviation, AvgSampleStor>
2303{
2304 public:
2305 /**
2306 * Construct and initialize this distribution.
2307 */
2308 AverageDeviation()
2309 {
2310 this->doInit();
2311 }
2312};
2313
2314/**
2315 * A vector of distributions.
2316 * @sa VectorDistBase, DistStor
2317 */
2318class VectorDistribution : public VectorDistBase<VectorDistribution, DistStor>

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

2351 /**
2352 * Initialize storage for this distribution.
2353 * @param size The size of the vector.
2354 * @return A reference to this distribution.
2355 */
2356 VectorStandardDeviation &
2357 init(size_type size)
2358 {
2359 this->doInit(size);
2360 return this->self();
2361 }
2362};
2363
2364/**
2365 * This is a vector of AverageDeviation stats.
2366 * @sa VectorDistBase, AvgSampleStor
2367 */

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

2372 /**
2373 * Initialize storage for this distribution.
2374 * @param size The size of the vector.
2375 * @return A reference to this distribution.
2376 */
2377 VectorAverageDeviation &
2378 init(size_type size)
2379 {
2380 this->doInit(size);
2381 return this->self();
2382 }
2383};
2384
2385template <class Stat>
2386class FormulaInfoProxy : public InfoProxy<Stat, FormulaInfo>
2387{
2388 protected:

--- 378 unchanged lines hidden ---