4#include "KVPartitionFunction.h"
70 for (
int k = 0; k <= klim; k++) {
101 if (A > 0 && Z >= 0 && M > 0 && B >= 0) {
119 if (A > 0 && Z >= 0 && M > 0) {
120 if (Z > A - Z) Z = A - Z;
141 if (M <= 0)
return 0;
142 if (A <= 0)
return 0;
145 if (B > A - Z)
return 0;
146 if (Z == 0 && B == 0)
return 0;
147 if ((M - 1) > (A - B))
return 0;
149 if (Z == A && B > 0)
return 0;
150 if (B != 1)
return 0;
161 if (A - M >= M && Z - M >= 0) {
170 if (A - B > 0 && M - 1 > 0 && B > 1) {
171 for (
int i = 1; i <= B - 1; i++) {
188 if (A <= 0)
return 0;
189 if (M <= 0)
return 0;
196 if (M == 1)
return 1;
197 if (M == A)
return 1;
264 if (A == A0)
return 1. /
PartSum(A0);
267 for (
int i = 1; i <= imax; i++) {
268 Int_t A1 = A0 - i * A;
315 if (A == A0)
return 1.;
319 if (!(A0 % 2) && A == A0 / 2)
return 2. /
PartFunc(A0, M);
320 else if (A >= 1 && A < A0)
return 1. /
PartFunc(A0, M);
324 if (A == 1)
return M;
330 for (
int i = 1; i <= imax; i++) {
331 Int_t A1 = A0 - i * A;
332 if (A1 > 0)NA +=
PartFunc(A1, M - i);
356 for (
int i = 1; i <= imax; i++) {
357 Int_t A1 = A0 - i * A;
358 Int_t Z1 = Z0 - i * Z;
359 if (A1 > 0) NAZ +=
PartSum(A1, Z1);
397 for (
Int_t A = Z; A <= (Z + A0 - Z0); A++) NZ +=
MeanNAZ(A0, Z0, A, Z);
414 for (
int i = 1; i <= A0; i++) {
416 mult += i * part_func;
417 part_sum += part_func;
435 for (
int i = 1; i <= A0; i++) {
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Calculates number of partitions of (A,Z,M)
Double_t get_value(Int_t A, Int_t Z, Int_t M, Int_t B=-1)
Double_t sneppen_Np(int A, int Z, int M)
Double_t PartFunc(int A, int M)
Double_t MeanNAZ(int A0, int Z0, int A, int Z)
Double_t MeanNA(int A0, int A)
Double_t calc_sneppen_Np(int A, int Z, int M)
calculates Eq. 4
Double_t calc_sneppen_Nclass(int A, int Z, int M, int B)
calculates Eqs. 5a-d
Double_t sneppen_Nclass(int A, int Z, int M, int B)
Double_t MeanNZ(int A0, int Z0, int Z)
void store_value(Double_t val, Int_t A, Int_t Z, Int_t M, Int_t B=-1)
virtual ~KVPartitionFunction()
Destructor.
Double_t MeanNA_M(int A0, int A, int M)
Double_t Min(Double_t a, Double_t b)
Double_t Max(Double_t a, Double_t b)