Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Diff of /trunk/gadget/popinfo.h
[mareframe] / trunk / gadget / popinfo.h Repository:
ViewVC logotype

Diff of /trunk/gadget/popinfo.h

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

revision 1, Mon Feb 10 17:09:07 2014 UTC revision 2, Wed Apr 29 12:55:30 2015 UTC
# Line 2  Line 2 
2  #define popinfo_h  #define popinfo_h
3    
4  #include "gadget.h"  #include "gadget.h"
5    #include "mathfunc.h"
6    
7  /**  /**
8   * \class PopInfo   * \class PopInfo
# Line 48  Line 49 
49     * \brief This operator will add an existing PopInfo to the current PopInfo     * \brief This operator will add an existing PopInfo to the current PopInfo
50     * \param a is the PopInfo to add     * \param a is the PopInfo to add
51     */     */
52    PopInfo& operator += (const PopInfo& a);    PopInfo& operator += (const PopInfo& a){
53              if (isZero(N + a.N)) {
54                W = 0.0;
55                N = 0.0;
56              } else if (isZero(a.N)) {
57                //adding a zero popinfo, so don't do anything
58              } else if (isZero(N)) {
59                W = a.W;
60                N = a.N;
61              } else {
62                W = (N * W + a.N * a.W) / (N + a.N);
63                N = N + a.N;
64              }
65              return *this;
66            }
67    
68    
69                                                      ;
70    /**    /**
71     * \brief This operator will multiply the PopInfo by a constant     * \brief This operator will multiply the PopInfo by a constant
72     * \param a is the constant     * \param a is the constant

Legend:
Removed from v.1  
changed lines
  Added in v.2

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge