4 #include "KVPartitionFunction.h"
70 for (
int k = 0; k <= klim; k++) {
99 Double_t KVPartitionFunction::sneppen_Nclass(
int A,
int Z,
int M,
int B)
101 if (A > 0 && Z >= 0 && M > 0 && B >= 0) {
102 Double_t snc = get_value(A, Z, M, B);
104 snc = calc_sneppen_Nclass(A, Z, M, B);
105 store_value(snc, A, Z, M, B);
106 maxvalueNclass =
TMath::Max(snc, maxvalueNclass);
117 Double_t KVPartitionFunction::sneppen_Np(
int A,
int Z,
int M)
119 if (A > 0 && Z >= 0 && M > 0) {
120 if (Z > A - Z) Z = A - Z;
123 snc = calc_sneppen_Np(A, Z, M);
124 store_value(snc, A, Z, M);
137 Double_t KVPartitionFunction::calc_sneppen_Nclass(
int A,
int Z,
int M,
int B)
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;
154 Double_t sn1 = sneppen_Np(A - (B - 1) * M, 0, M);
155 Double_t sn2 = sneppen_Np(A - B * M, 0, M);
161 if (A - M >= M && Z - M >= 0) {
163 snp = sneppen_Np(A - M, Z - M, M);
164 snc = sneppen_Nclass(A - 1, Z - 1, M - 1, 0);
170 if (A - B > 0 && M - 1 > 0 && B > 1) {
171 for (
int i = 1; i <= B - 1; i++) {
172 ncl += sneppen_Nclass(A - B, Z, M - 1, i);
175 ncl = sneppen_Np(A - B, Z, M - 1) - ncl;
184 Double_t KVPartitionFunction::calc_sneppen_Np(
int A,
int Z,
int M)
188 if (A <= 0)
return 0;
189 if (M <= 0)
return 0;
196 if (M == 1)
return 1;
197 if (M == A)
return 1;
200 for (
int b = 0;
b <=
N;
b++) Np += sneppen_Nclass(A, Z, M, b);
237 for (
int m = 1;
m <= A;
m++)
p += sneppen_Np(A, Z,
m);
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 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 MeanNZ(int A0, int Z0, int Z)
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)