-
Notifications
You must be signed in to change notification settings - Fork 0
/
HadamardNoise.java
2066 lines (1925 loc) · 100 KB
/
HadamardNoise.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package TaguchHadamardNoise;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.MyFuncDiff;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.MyFuncExpress;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.MyFuncSimple;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.parse;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.parseDiff;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.parseIntegr;
import static TaguchHadamardNoise.MathsContxtLAv0_1_Prod.parseSimple;
import static TaguchHadamardNoise.Usage.FormEquation;
import static TaguchHadamardNoise.UsageDOE.mainRegresssionDOE;
import static TaguchHadamardNoise.UsageDOEDPFine.FailingTestHarnessDiff;
import static TaguchHadamardNoise.UsageDOEDPFine.mainRegresssionDOEDP;
import java.io.FileInputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import org.apache.log4j.Logger;
/**
*
* @author Administrator
*/
public class HadamardNoise {
public static Logger log = Logger.getLogger(HadamardNoise.class.getName());
// Global Variables
public static double SYSTEM_BIGNUMBER = 1.0e50;
public static double SYSTEM_Delta = 1.0e-28;
public static double SYSTEM_BIGNUMBERnPr = 1.0e6;
public static String Path = "data\\";
public static String ConfigFileName = "DOEHadamardDefault";
public static String GPConfigFileName = "DOEDPFine\\DOEDPNoiseDefault";
public static int STATSMOREDATAFACTOR = 3;
public static long ROWSDOE = 1;
public static long ROWSDOEComputed = 0;
public static long ROWSDOERecommended = 0;
public static long LengthRecommended = 0;
// Number of Levels of each Factor (Signal Columns) in Ortho Matrix
public static int LEVELS = 5;
public static long Length = 1000;// Length (Number of Signal Columns of Orthogonal Matrix)
// HyperDOE Data Elements
// High Level Variables for Signal Noise Nature
public static boolean HasNoise = true;
public static boolean UseLevelsFromFile = false;
public static boolean UseLevelsFromArray = false;
// Generation of DOE Boolean Control
public static boolean ClassicTaguchiAlg = false;
public static boolean UseFullFactorial = true;
public static boolean PrintStackTraceFlag = false;
//Signal Data Elements
private static long OverallDupCount = 0;
private static long OverallUniqueCount = 0;
private static LinkedList<String> DupsList;
//Variable for Levels Control
private static int levelCntrl = 1;
//Variable for Levels Control
private static int levelCntrlBack = 1;
// Number of positions to interchange when we get a Duplicate
public static int FixDepth = 20;
// Number of times Dups have been detected
public static int DupCount = 0;
// Number of times Dups have been detected
public static int ZeroCount = 0;
public static long DupCheckColStart;
public static long DupCheckColEnd;
public static long DupCheckRowStart;
// Boolean Type of Columns
public static boolean HasNormal = true;
//Data Array
private static ByteBuffer DataArray;
public static String[] MeanColModeTracker;//Length :Number of Datum
public static int[] ColMode;//Length :Number of Datum:The Frequency of each Value
public static int[] ColModeValue;//Value :Individual Different Datum
public static String[] MeanInputModeTracker;//SigLength :Number of Datum
public static long[] Mode;//SigLength :Number of Datum:The Frequency of each Value
public static long[] ModeValue;//Value :Individual Different Datum
public static long[] ModeIndex;//Value :Individual Different Datum
public static int[][] StrengthMode;
public static int[] DataCountSum = null;
//LCG Variables
private static long LCG_TempValue = 1;
private static long LCG_Value = 1;
private static long LCG_levelCntrl = 1;
private static long LCG_FactValue = 1;
private static long LCG_NPRFactValue = 1;
private static long SimpleModuloLevelXn = 1;
private static long SimpleModuloLevelXnRow = 1;
private static ByteBuffer LevelCntrlArray;
//Storage Tweak
public static int SIZEOFCELL = 8;
public static double[][] LevelValueStore;
public static int[] LevelValueInit;//-1=LevelValuePair Not Initialized
public static String[] Name;//Name of the Column(Display)
//InitLevels is used only for holding Control Level Bits.
// Noise Levels are = LEVELS
// Rows of InitLevels= Noise Column Length
private static int[][] InitLevels = {
{0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, //Column, LevelMinIndex, LevelMaxIndex, LevelCtrlIndex, LastIssuedLevel, LastIssuedValue, FactorialRow1Lev, FactSpreadRow1Lev, FactRowRow1Lev, FactRowSpreadRow1Lev, FactorialRow3Lev, FactSpreadRow3Lev, FactRowRow3Lev, FactRowSpreadRow3Lev, FactorialNMinusLev, FactSpreadNMinusLev, FactRowNMinusLev, FactRowSpreadNMinusLev,
{1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{5, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{6, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{7, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{8, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},};
public static int LevelMinIndex = 0;
public static int LevelMaxIndex = 1;
public static int LevelCtrlIndex = 2;
public static int LastIssuedLevel = 3;
public static int LastIssuedValue = 4;
public static int FactorialRow1Lev = 5;
public static int FactSpreadRow1Lev = 6;
public static int FactRowRow1Lev = 7;
public static int FactorialRow3Lev = 8;
public static int FactSpreadRow3Lev = 9;
public static int FactRowRow3Lev = 10;
public static int FactorialNMinusLev = 11;
public static int FactSpreadNMinusLev = 12;
public static int FactRowNMinusLev = 13;
//Statistical Data Variables (Super Variables)
private static long rowdimension;
private static long coldimension;
public double[][] MeanTracker;
public double[][] VarianceTracker;
public double[][] MeanOutputTracker;
public double[][] VarianceOutputTracker;
public String[] MeanOutputModeTracker;//Length :Number of Datum
public static Long DOEBestBitsStr = 0L;
public static double DOEBestOutput = 0;
private double SmallBetter = 0.0;
private double NominalBest = 0.0;
private double LargerBetter = 0.0;
private double DataMinInp = 0.0;
private double DataMaxInp = 0.0;
private double ErrorDiffInp = 0.0;
private double DataDiffInp = 0.0;
private double DataDiff = 0.0;
private int sizeyi = 0;
private int Outputsizeyi = 0;
private double DataMinOut = 0.0;
private double DataMaxOut = 0.0;
private double DataDiffOut = 0.0;
private double ErrorDiffOut = 0.0;
public double MeanWithinGroupsInput;
public double MeanWithinGroupsOutput;
//Value Tracker Data Structs
private IntBuffer ValueTrkIndex;
private IntBuffer RowValueTrkIndex;
// Column Equation Details for each Input Column
public static ColConfigration[] EqnDetails;
public static int[] EqnParsed;
// Random Generator Values & Variables
private static Map<String, Double> variables = new HashMap<>();
private static Map<String, String> variablesDiff = new HashMap<>();
// GP Parameters
public static int Seed = 0;
public static int LCG_ValueInit = 0;
public static int LCG_ValueOrder = 0;
public static String EqnLCG_Value = "";
public static int LCG_levelCntrlInit = 0;
public static int LCG_levelCntrlOrder = 0;
public static String EqnLCG_levelCntrl = "";
public static int LCG_FactValueInit = 0;
public static int LCG_FactValueOrder = 0;
public static String EqnLCG_FactValue = "";
public static int LCG_NPRFactValueInit = 0;
public static int LCG_NPRFactValueOrder = 0;
public static String EqnLCG_NPRFactValue = "";
public static int LCG_FactorialInit = 0;
public static int LCG_FactorialOrder = 0;
public static String EqnLCG_Factorial = "";
public static boolean UseSoftwareNoise = true;
public static boolean UseHardwareNoise = true;
public static boolean UseIntegration = true;
public static boolean AvoidStackOverflow = true;
public static void GenerateDOEHammard(int planeNum, long rows, long col) {
try {
long MyStartROWSDOE = ROWSDOE;
long MyStartCOLMDOE = Length;
long Levels = LEVELS;
long LastZ = MyStartCOLMDOE - 1;
DupCheckColStart = 0;
DupCheckColEnd = MyStartCOLMDOE;
long StartRowOrg = 0;
long StartColOrg = DupCheckColStart;
long DupCheckColStartOrg = DupCheckColStart;//DupCheckColStart;
long DupCheckColEndOrg = DupCheckColEnd;//DupCheckColEnd;
if ((UseFullFactorial == false)) {
log.error("GenerateDOEHammard:Signal Dimensions Being Processed:");
if (HasNoise == true) {
GenerateArray(planeNum);
}
} else if ((UseFullFactorial == true)) {
if (HasNoise == true) {
GenerateArrayFF(planeNum);
}
}
long i = 0;
DupCheckColStart = 2;
DupCheckColEnd = MyStartCOLMDOE;
log.fatal("Starting Duplicate Check:OverallDupCount=" + OverallDupCount + " DupCheckColStart=" + DupCheckColStart + " DupCheckColEnd=" + DupCheckColEnd);
DupCount = 0;
long OverallDupCountOrg = OverallDupCount;
if ((HasNoise == true) && (HasNormal == true)) {
log.fatal("GenerateDOEHammard:Started Signal DupCheckMatrixMode");
DupCheckMatrixMode(planeNum);
}
System.out.print(System.lineSeparator());
long OverallDupCountDiff = OverallDupCount - OverallDupCountOrg;
System.out.println("Overall Duplicate Count=" + OverallDupCountDiff + " OverallUniqueCount=" + OverallUniqueCount);
AlgoParamLogger("Main", StartRowOrg, StartColOrg, DupCheckColStart, DupCheckColEnd, OverallDupCountOrg, MyStartROWSDOE, MyStartCOLMDOE, OverallDupCount);
} catch (Exception HyperE) {
log.info("Exception: GenerateDOEHammard");
System.out.println("Exception: GenerateDOEHammard");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
}
/* ******************** ************ */
/* ******************** ************ */
/* ************************DOEMatrixArray Core Cell Generating Functions Start Here* */
/* ******************** ************ */
/* ******************** ************ */
private static void AlgoParamLogger(String AlgoName, long StartRowOrg, long StartColOrg, long DupCheckColStartOrg, long DupCheckColEndOrg, long OverallDupCountOrg, long StartRowEnd, long StartColEnd, long OverallDupCountEnd) {
log.error("AlgoParamLogger:Logging Parameters for AlgoName=" + AlgoName);
log.error("AlgoName=" + AlgoName + " StartRowOrg=" + StartRowOrg);
log.error("AlgoName=" + AlgoName + " StartRowEnd=" + StartRowEnd);
log.error("AlgoName=" + AlgoName + " StartColOrg=" + StartColOrg);
log.error("AlgoName=" + AlgoName + " StartColEnd=" + StartColEnd);
log.error("AlgoName=" + AlgoName + " DupCheckColStartOrg=" + DupCheckColStartOrg);
log.error("AlgoName=" + AlgoName + " DupCheckColEndOrg=" + DupCheckColEndOrg);
log.error("AlgoName=" + AlgoName + " OverallDupCountOrg=" + OverallDupCountOrg);
log.error("AlgoName=" + AlgoName + " OverallDupCountEnd=" + OverallDupCountEnd);
log.error("AlgoName=" + AlgoName + " Dup Diff Count=" + (OverallDupCountEnd - OverallDupCountOrg));
log.error("AlgoName=" + AlgoName + " Row Count=" + (StartRowEnd - StartRowOrg));
if (StartColEnd > StartColOrg) {
log.error("AlgoName=" + AlgoName + " Col Count=" + (StartColEnd - StartColOrg));
} else {
log.error("AlgoName=" + AlgoName + " Col Count=" + (StartColOrg - StartColEnd));
}
}
/* ******************** ************ */
/* ******************** ************ */
/* ************************Signal Core Cell Generating Functions Start Here* */
/* ******************** ************ */
/* ******************** ************ */
public static void GenerateArray(int planeNum) {
try {
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long Levels = LEVELS;
double levelCntrl = 1;
if (HasNormal == true) {
setArrayLevelCntrlArray(planeNum);
setArrayDataArray(planeNum);
if (Checker(planeNum, false, HasNormal, (int) Length) == true)
;// Do nothing
else {
log.error("GenerateArray:Signal:NormalChecker Failed:Should get an Exception");
}
levelCntrl = LevelCntrlArrayGet(planeNum, 0, LevelMinIndex);
RowLevel2Levels(planeNum, 0, 0);
log.error("GenerateArray:Signal: RowLevel2Levels Completed ");
//printDataOutput(0);
if (ClassicTaguchiAlg == true) {
ClassicTaguchiRowLevel3Levels(planeNum);
} else {
if (((NumROWSDOE >= 3) && (NumROWSDOE >= 10 * Levels))) {
RowLevel3Levels(planeNum, 0, 0, 0);;
} else if ((NumROWSDOE >= 3) && (NumROWSDOE <= 10 * Levels) && (NumROWSDOE > Levels)) {
RowLevel3Levels(planeNum, 0, 0, 0);;
} else {
log.error("GenerateArray:Signal: Skipping RowLevel3Levels");
}
log.error("GenerateArray:Signal: RowLevel3Levels Completed ");
//printDataOutput(0);
if (((NumROWSDOE >= 3) && (NumROWSDOE >= 10 * Levels))) {
levelCntrl = LevelCntrlArrayGet(planeNum, NumCOLMDOE - 2, LevelMinIndex);
ColumnNMinus2Levels(planeNum, (long) Levels, (long) (NumCOLMDOE - 2), ((int) LevelCntrlArrayGet(planeNum, NumCOLMDOE - 2, LevelMaxIndex)), 0);
log.error("GenerateArray:Signal: ColumnNMinus2Levels Completed ");
levelCntrl = LevelCntrlArrayGet(planeNum, NumCOLMDOE - 1, LevelMinIndex);
ColumnN(planeNum, Levels, NumCOLMDOE - 1, Levels);
log.error("GenerateArray:Signal: ColumnN Completed ");
} else if ((NumROWSDOE >= 3) && ((NumCOLMDOE - 2) > LEVELS)) {
levelCntrl = LevelCntrlArrayGet(planeNum, NumCOLMDOE - 2, LevelMinIndex);
ColumnNMinus2Levels(planeNum, (long) Levels, (long) (NumCOLMDOE - 2), ((int) LevelCntrlArrayGet(planeNum, NumCOLMDOE - 2, LevelMaxIndex)), 0);
log.error("GenerateArray:Signal: ColumnNMinus2Levels Completed ");
levelCntrl = LevelCntrlArrayGet(planeNum, NumCOLMDOE - 1, LevelMinIndex);
ColumnN(planeNum, Levels, NumCOLMDOE - 1, Levels);
log.error("GenerateArray:Signal: ColumnN Completed ");
} else {
log.error("GenerateArray:Signal: Skipping ColumnNMinus2Levels & ColumnN ");
}
}
}
log.info(System.lineSeparator());
} catch (Exception HyperE) {
log.info("Exception: GenerateArray:Signal:");
System.out.println("Exception: GenerateArray:Signal:");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
}
public static void GenerateArrayFF(int planeNum) {
try {
log.error("GenerateArrayFF:Signal:Entered");
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long Levels = LEVELS;
double levelCntrl = 1;
if (HasNormal == true) {
setArrayLevelCntrlArray(planeNum);
setArrayDataArray(planeNum);
if (Checker(planeNum, false, HasNormal, (int) Length) == true)
;// Do nothing
else {
log.error("GenerateArrayFF:Signal:NormalChecker Failed:Should get an Exception");
}
log.fatal("GenerateArrayFF:Signal: RowLevelupto1Levels Completed ");
ColumnFullFactorial(planeNum, 0, NumCOLMDOE, Levels);
//printDataOutput(0);
}
log.fatal("GenerateArrayFF:Exited");
} catch (Exception HyperE) {
log.info("Exception: GenerateArrayFF:Signal:");
System.out.println("Exception: GenerateArrayFF:Signal:");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
}
/* ******************** ************ */
/* ******************** ************ */
/* ************************Signal Cell Generating Functions Start Here ***** */
/* ******************** ************ */
/* ******************** ************ */
/* ******************** ************ */
public static void RowLevel2Levels(int planeNum, long Levels, long col) {
log.error("Processing RowLevel2Levels ");
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long row = 0;
long StartRowOrg = Levels;
long StartColOrg = col;
long OverallDupCountOrg = OverallDupCount;
long DupCheckColStartOrg = col;//DupCheckColStart;
long DupCheckColEndOrg = NumCOLMDOE - Levels + 1;//DupCheckColEnd;
long LastZ = NumCOLMDOE;
long RowNum = NumROWSDOE;
long ColNum = NumCOLMDOE - Levels + 1;
long TempValue = 0;
if (NumROWSDOE > (10 * Levels)) {
RowNum = (10 * Levels);
} else if ((NumROWSDOE < (10 * Levels)) && (NumROWSDOE > Levels)) {
RowNum = 2 * Levels;
} else {
RowNum = NumROWSDOE;
}
ComputeFactorial(planeNum, "RowLevel2Levels",
col,
LEVELS,
(NumCOLMDOE),
RowNum,
ColNum,
FactorialRow1Lev,
FactSpreadRow1Lev,
FactRowRow1Lev
);
for (; (row < RowNum); row++) {
for (int j = (int) col; (j < NumCOLMDOE); j++) {
log.info("RowLevel2Levels row=" + row + " col=" + j
+ " FactorialRow1Lev Value=" + LevelCntrlArrayGet(planeNum, j, FactorialRow1Lev)
+ " FactSpreadRow1Lev Value=" + LevelCntrlArrayGet(planeNum, j, FactSpreadRow1Lev)
+ " FactRowRow1Lev Value=" + LevelCntrlArrayGet(planeNum, j, FactRowRow1Lev));
TempValue = ComplexCommonRCMain(planeNum, "RowLevel1Levels",
/* row*/ (long) row,
/* col*/ (long) j,
/* Levels*/ (long) LevelCntrlArrayGet(planeNum, j, LevelMaxIndex),
/*Value*/ (long) LevelCntrlArrayGet(planeNum, j, LastIssuedValue),
/* RowSub*/ 1,
/*ColSub*/ (long) 1,
/*AlgoRowFactIndex*/ FactorialRow1Lev,
/* AlgoRowSpreadIndex*/ FactSpreadRow1Lev,
/*AlgoFactRowFactIndex*/ FactRowRow1Lev);
LevelCntrlArrayPut(planeNum, j, LastIssuedValue, TempValue);
}
for (int x = (int) col; (x < NumCOLMDOE - Levels + 1); x++) {
long TempValue1 = LevelCntrlArrayGet(planeNum, x, FactRowRow1Lev);
LevelCntrlArrayPut(planeNum, x,
FactRowRow1Lev,
(TempValue1 - 1));
}
if (row < RowNum) {
//FindnFixDuplicate(planeNum, "RowLevel1Levels", row, DupCheckColStartOrg, DupCheckColEndOrg, NumCOLMDOE, LastZ);
//DupCheckColMode( planeNum);
}
}
AlgoParamLogger("RowLevel2Levels", StartRowOrg, StartColOrg, DupCheckColStartOrg, DupCheckColEndOrg, OverallDupCountOrg, row, (NumCOLMDOE - Levels + 1), OverallDupCount);
log.error("Completed RowLevel2Levels ");
}
public static void RowLevel3Levels(int planeNum, long row, long col, long Value) {
log.error("Processing RowLevel3Levels ");
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long Levels = LEVELS;
long LastZ = NumCOLMDOE;
long StartRowOrg = row;
long StartColOrg = col;
long OverallDupCountOrg = OverallDupCount;
long DupCheckColStartOrg = col;//DupCheckColStart;
long DupCheckColEndOrg = NumCOLMDOE - Levels + 1;//DupCheckColEnd;
long RowNum = row;
long ColNum = 0;
if (NumROWSDOE > (10 * Levels)) {
RowNum = NumROWSDOE;//(10 * Levels);
} else if ((NumROWSDOE < (10 * Levels)) && (NumROWSDOE > Levels)) {
RowNum = NumROWSDOE;
} else {
RowNum = NumROWSDOE;
}
ComputeFactorial(planeNum, "RowLevel3Levels", col, Levels, (NumCOLMDOE - Levels + 1), RowNum, ColNum,
FactorialRow3Lev,
FactSpreadRow3Lev,
FactRowRow3Lev);
for (; row < RowNum; row++) {
for (int j = (int) col; j < NumCOLMDOE; j++) {
// log.error("RowLevel3Levels row=" + row + " col=" + j
// + " FactorialRow1Lev Value=" + LevelCntrlArrayGet(planeNum, j, FactorialRow3Lev)
// + " FactSpreadRow1Lev Value=" + LevelCntrlArrayGet(planeNum, j, FactSpreadRow3Lev)
// + " FactRowRow1Lev Value=" + LevelCntrlArrayGet(planeNum, j, FactRowRow3Lev) );
long TempValue = ComplexCommonRCMain(planeNum, "RowLevel3Levels",
/* row*/ (long) row,
/* col*/ (long) j,
/* Levels*/ (long) LevelCntrlArrayGet(planeNum, j, LevelMaxIndex),
/*Value*/ (long) LevelCntrlArrayGet(planeNum, j, LastIssuedValue),
/* RowSub*/ 1,
/*ColSub*/ (long) 1,
/*AlgoRowFactIndex*/ (long) FactorialRow3Lev,
/* AlgoRowSpreadIndex*/ (long) FactSpreadRow3Lev,
/*AlgoFactRowFactIndex*/ (long) FactRowRow3Lev
);
log.info("RowLevel3Levels:First For Loop: row=" + row + " col=" + j + " TempValue=" + TempValue);
LevelCntrlArrayPut(planeNum, j, LastIssuedValue, TempValue);
if (row < RowNum) {
//FindnFixDuplicate(planeNum, "RowLevel3Levels", row, DupCheckColStartOrg, DupCheckColEndOrg, NumCOLMDOE, LastZ);
//DupCheckColMode( planeNum);
}
}
}
AlgoParamLogger("RowLevel3Levels", StartRowOrg, StartColOrg, DupCheckColStartOrg, DupCheckColEndOrg, OverallDupCountOrg, row, (NumCOLMDOE - Levels + 1), OverallDupCount);
log.error("Completed RowLevel3Levels ");
}
public static void ColumnNMinus2Levels(int planeNum, long row, long col, long Levels1, long Value) {
log.info("Processing ColumnNMinus2Levels ");
try {
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long Levels = LEVELS;
long LevelSpread = NumCOLMDOE / Levels;
long LastZ = col;
long j = col;
long StartRowOrg = row;
long StartColOrg = col;
long OverallDupCountOrg = OverallDupCount;
long DupCheckColStartOrg = col - Levels;//DupCheckColStart;
long DupCheckColEndOrg = col;//DupCheckColEnd;
long RowNum = NumROWSDOE - (10 * Levels);
long ColNum = Levels;
ComputeFactorial(planeNum, "ColumnNMinus2Levels", col, Levels, (Levels), RowNum, ColNum,
FactorialNMinusLev,
FactSpreadNMinusLev,
FactRowNMinusLev
);
for (; (row < NumROWSDOE); row++) {
for (j = col; (j > (col - Levels + 1)); j--) {
log.error("ColumnNMinus2Levels col=" + j + " row=" + row + " ColumnNMinus2Levels Value=" + Value);
LevelCntrlArrayPut(planeNum, j,
LastIssuedValue, (ComplexCommonRCMain(planeNum, "ColumnNMinus2Levels", row, j, Levels,
LevelCntrlArrayGet(planeNum, j,
LastIssuedValue), 8, Levels,
FactorialNMinusLev,
FactSpreadNMinusLev,
FactRowNMinusLev
)));
}
for (int x = (int) col; (x < col - Levels + 1); x++) {
LevelCntrlArrayPut(planeNum, x,
FactRowNMinusLev, ((LevelCntrlArrayGet(planeNum, x,
FactRowNMinusLev) - 1)));
}
if (row < ROWSDOE) {
//FindnFixDuplicate(planeNum, "ColumnNMinus2Levels", row, DupCheckColStartOrg, DupCheckColEndOrg, col, LastZ);
//DupCheckColMode( planeNum);
}
}
AlgoParamLogger("ColumnNMinus2Levels", StartRowOrg, StartColOrg, DupCheckColStartOrg, DupCheckColEndOrg, OverallDupCountOrg, row, (col - Levels - 1), OverallDupCount);
} catch (Exception HyperE) {
log.info("Exception: ColumnNMinus2Levels");
System.out.println("Exception: ColumnNMinus2Levels");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
log.info("Completed ColumnNMinus2Levels ");
}
public static void ColumnN(int planeNum, long row, long col, long Levels) {
log.info("Processing ColumnN ");
try {
long NumROWSDOE = ROWSDOE;
int NumCOLMDOE = (int) Length;
long LevelSpread = NumROWSDOE / Levels;
for (;
((row < NumROWSDOE)
&& (col < NumCOLMDOE));
row++) {
log.error("ColumnN col=" + col + " row=" + row);
ColumnOneMain(planeNum, row, col,
LevelCntrlArrayGet(planeNum, col,
LevelMaxIndex));
}
} catch (Exception HyperE) {
log.info("Exception: ColumnN");
System.out.println("Exception: ColumnN");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
log.info("Completed ColumnN ");
}
public static void ColumnFullFactorial(int planeNum, long row, long col, long Levels) {
log.error("Processing ColumnFullFactorial ");
try {
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long LevelSpread = 0;
if (Levels > 0) {
LevelSpread = NumROWSDOE / Levels;
}
long FullFactorialROWS = 1;
for (int j = 0; (j < NumCOLMDOE); j++) {
if (UsageDOEDPFine.TestCase < 10) {
FailingTestHarnessDiff("ColumnFullFactorial", UsageDOEDPFine.TestCase);
UsageDOEDPFine.TestCase++;
if (UsageDOEDPFine.TestCase == 10) {
UsageDOEDPFine.TestCase = 0;
}
}
for (int i = (int) 0; (i < NumROWSDOE); i++) {
FileInputStream fpinput = null;
String msg = "";
if ((fpinput = new FileInputStream(Path + GPConfigFileName)) == null) {
msg = "Input: can't open " + Path + GPConfigFileName;
System.out.println(msg);
log.error(msg);
}
//log.error("Opened File Name: Infile=" + Path + ConfigFileName);
//System.out.println("Opened File Name: Infile=" + Path + ConfigFileName);
NoiseDOEDefineDP.Myfscanf(fpinput);
//NoiseDOEDefineGP.Myprintf();
if (j < (NumCOLMDOE - 1)) {
ColumnFullFactorialRecursiveMain(planeNum, i, j,
LevelCntrlArrayGet(planeNum, j,
LevelMaxIndex), NumCOLMDOE, LevelSpread);
}
//Dup Prevention Strategy AND
// Noise Reduction to Zero on RIGHT SIDE of Hadamard OA
// Noise moves from Left to Right Column
// i.e No information Set Column
// i.e No Variability && Fully Controlled.
else if (j == (NumCOLMDOE - 1)) {
ColumnZero(planeNum, 0, j, Levels);
}
}
}
} catch (Exception HyperE) {
log.info("Exception: ColumnFullFactorial UsageDOEDPFine.TestCase=" + UsageDOEDPFine.TestCase + " UsageDOE.TestCase=" + UsageDOE.TestCase);
System.out.println("Exception: ColumnFullFactorial UsageDOEDPFine.TestCase=" + UsageDOEDPFine.TestCase + " UsageDOE.TestCase=" + UsageDOE.TestCase);
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
log.error("Completed ColumnFullFactorial ");
}
public static void ColumnZero(int planeNum, long row, long col, long Levels) {
log.error("Processing ColumnZero ");
try {
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long LevelSpread = 0;
if (Levels > 0) {
LevelSpread = NumROWSDOE / Levels;
}
for (;
(((getArrayDataArray().limit() != 0))
&& (row < NumROWSDOE));
row++) {
//Coarse Control
//Block Level Dups Reduced
//ColZeroMain(planeNum, row, col, Levels, LevelSpread);
//Fine Control
//LSB Level Dups Reduced
ColumnOneMain(planeNum, row, col, LevelCntrlArrayGet(planeNum, col, LevelMaxIndex));
}
} catch (Exception HyperE) {
log.info("Exception: ColumnZero");
System.out.println("Exception: ColumnZero");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
log.error("Completed ColumnZero ");
}
public static void ColZeroMain(int planeNum, long row, long col, long Levels, long LevelSpread) {
int levelCntrl = LevelCntrlArrayGet(planeNum, col, LevelCtrlIndex);
DataArrayPut(planeNum, row, col, (byte) LevelCntrlArrayGet(planeNum, col, LevelCtrlIndex));
LevelCntrlArrayPut(planeNum, col, LevelCtrlIndex, levelCntrl);
LevelCntrlArrayPut(planeNum, col, LastIssuedLevel, levelCntrl);
if ((LevelSpread > 0) && ((row > 0) && ((row + 1) % LevelSpread) == 0)) {
LevelCntrlArrayPut(planeNum, col, LastIssuedLevel, LevelCntrlArrayGet(planeNum, col, LevelMinIndex));
if (levelCntrl == LevelCntrlArrayGet(planeNum, col, LevelMaxIndex)) {
levelCntrl = LevelCntrlArrayGet(planeNum, col, LevelMinIndex);
} else {
levelCntrl++;
}
}
LevelCntrlArrayPut(planeNum, col, LevelCtrlIndex, levelCntrl);
}
public static void ClassicTaguchiRowLevel3Levels(int planeNum) {
log.error("Processing ClassicTaguchiRowLevel3Levels ");
long NumROWSDOE = ROWSDOE;
long NumCOLMDOE = Length;
long Levels = LEVELS;
long row = 0;
if (NumROWSDOE > (10 * Levels)) {
row = 10 * Levels;//(10 * Levels);
} else if ((NumROWSDOE < (10 * Levels)) && (NumROWSDOE > Levels)) {
row = Levels;
} else {
row = Levels;
}
int col = 3;
long Value = 0;
long LastZ = NumCOLMDOE - 1;
long DupCheckColStartOrg = DupCheckColStart;
long DupCheckColEndOrg = DupCheckColEnd;
for (; row < NumROWSDOE; row++) {
for (col = 2; col < NumCOLMDOE; col++) {
Levels = LevelCntrlArrayGet(planeNum, col, LevelMaxIndex);
// Caution:Positional "If then Else" Blocks
// Results will be different if position is interchanged
if ((((row - Levels + 1) % (Levels + 1)) != 0) && ((col - 3 + 1) % (Levels + 1)) != 0) {
Value = ((row - Levels + 1) % (Levels + 1)) + ((col - 3 + 1) % (Levels + 1));
} else if (((row - Levels + 1) % (Levels + 1)) != 0) {
Value = ((col - 3 + 1) % (Levels + 1));
} else if (((col - 3 + 1) % (Levels + 1)) != 0) {
Value = ((row - Levels) % (Levels + 1));
} else {
Value = levelCntrl;
}
if (Value >= Levels) {
Value = Value % (Levels + 1);
}
// SimpleModuloLevelXn=Value;
// Value = SimpleModuloLevel(planeNum, "ClassicTaguchiRowLevel3Levels", row, col,
// SimpleModuloLevelXn,
// Levels, LevelCntrlArrayGet(planeNum, col, LevelMinIndex));
// SimpleModuloLevelXn = Value;
if (Value == 0) {
Value = 1;
}
DataArrayPut(planeNum, row, col, (byte) Value);
if (row < Length) {
dupCombinationCol(planeNum, "ClassicTaguchiRowLevel3Levels", row, 0, col, 20, false);
}
}
if (levelCntrl >= Levels) {
levelCntrl = 1;
} else {
levelCntrl++;
}
if (levelCntrlBack >= Levels) {
levelCntrlBack = 2;
} else {
levelCntrl++;
}
log.info("Completed ClassicTaguchiRowLevel3Levels ");
}
}
public static void ComputeFactorial(int planeNum, String AlgoName,
long col,
/*LEVELS*/ long N,
long R,
long RowNum,
long ColNum,
int FuncFactIndex,
int SpreadIndex,
int FuncRowFactIndex) {
//log.info("ComputeFactorial:" + AlgoName + " RowNum=" + RowNum + " ColNum=" + ColNum);
long Factorial = Fact(N, 1);
long RowFactorial = nPr(R, ColNum, 1);
for (long i = col; i <= (col + R); i++) {
//if (AlgoName.equalsIgnoreCase("RowLevel3Levels"))
//log.info("ComputeFactorial:" + AlgoName + " col=" + i + " Factorial=" + Factorial);
LevelCntrlArrayPut(planeNum, i, FuncFactIndex, (byte) Factorial);
long SpreadLevel = 1;
if (ColNum > 0) {
SpreadLevel = Factorial / ColNum;
}
//if (AlgoName.equalsIgnoreCase("RowLevel3Levels"))
//log.info("ComputeFactorial:" + AlgoName + " col=" + i + " SpreadLevel=" + SpreadLevel );
LevelCntrlArrayPut(planeNum, i, SpreadIndex, (byte) SpreadLevel);
//if (AlgoName.equalsIgnoreCase("RowLevel3Levels"))
//log.info("ComputeFactorial:" + AlgoName + " col=" + i + " RowFactorial=" + RowFactorial);
LevelCntrlArrayPut(planeNum, i, FuncRowFactIndex, (byte) RowFactorial);
}
}
public static boolean dupCombinationCol(int planeNum, String AlgoName, long row, long colDupCheckColStart, long colDupCheckColEnd, long LastZ, boolean Matrix) {
boolean RetValue = false;
String HistRow = "";
String CurrRow = "";
int Duptimes = 0;
log.info("Entered dupCombinationCol row=" + row + " colDupCheckColStart=" + colDupCheckColStart + " colDupCheckColEnd=" + colDupCheckColEnd + " LastZ=" + LastZ);
long i = 0;
long j = 0;
try {
long upperlimit = row;
if (Matrix == true) {
upperlimit = ROWSDOE;
}
CurrRow = getRowAsStringDataArray(planeNum, row, colDupCheckColStart, colDupCheckColEnd, false);
log.info("dupCombinationCol row=" + row + " CurrRow =" + CurrRow);
for (j = 0; (j < upperlimit) && (Duptimes < 1); j++) {
if ((j == row) && (Matrix == true)) {
continue;
}
RetValue = false;
log.info("dupCombinationCol CurrRow =" + CurrRow);
HistRow = getRowAsStringDataArray(planeNum, j, colDupCheckColStart, colDupCheckColEnd, false);
if ((CurrRow.length() == HistRow.length()) && (CurrRow.equalsIgnoreCase(HistRow))) {
RetValue = true;
log.info("dupCombinationCol Got Duplicates in AlgoName=" + AlgoName + ": HistRow=" + j + " Curr row=" + row);
//log.error("dupCombinationRow HistRow =" + HistRow.toString());
log.info("dupCombinationCol HistRow(" + j + " =" + HistRow);
log.info("dupCombinationCol CurrRow (" + row + " =" + CurrRow);
//FixerIncremFast(planeNum, row, colDupCheckColStart, LastZ, FixDepth);
log.info("dupCombinationCol FixedRow=" + getRowAsStringDataArray(planeNum, row, colDupCheckColStart, colDupCheckColEnd, true));
// Restart combination as the fixed Row may clash
// with previously unique values
break;
}
}
if (RetValue == true) {
log.info("Found Dups in AlgoName=" + AlgoName + " for row(Current Row)=" + row + " i(Historical Row)=" + j + " OverallDupCount=" + OverallDupCount + " DupCount=" + DupCount + " ZeroCount=" + ZeroCount);
log.info("dupCombinationCol HistRow(" + j + ") =" + getRowAsStringDataArray(planeNum, j, colDupCheckColStart, colDupCheckColEnd, true));
log.info("dupCombinationCol CurrRow(" + row + ") =" + CurrRow);
} else if (RetValue == false) {
log.info("dupCombinationCol:No duplicates for row=" + row);
RetValue = false;
}
} catch (Exception HyperE) {
log.info("Exception: dupCombinationCol");
System.out.println("Exception: dupCombinationCol");
System.out.println(HyperE.getStackTrace());
System.out.println(HyperE.getMessage());
HyperE.printStackTrace();
}
log.info("Completed dupCombinationCol ");
return RetValue;
}
public static long Fact(long n, long Result) {
long TempResult = 1;
if (n > 1) {
if (Result > SYSTEM_BIGNUMBER) {
log.info("Fact:Result=" + Result);
return (long) SYSTEM_BIGNUMBER;
} else {
TempResult = Result * n;
log.info("Fact:Result=" + Result);
if ((TempResult > SYSTEM_BIGNUMBER) && (Result < SYSTEM_BIGNUMBER)) {
return (long) Result;
} else {
return Fact(n - 1, TempResult);
}
}
} else {
return Result;
}
}
public static long nPr(long n, long r, long Result) {
long TempResult = 1;
for (int i = 1; (i <= r) && (n > 0) && (TempResult < SYSTEM_BIGNUMBERnPr) && (TempResult > 0); i++, n--) {
TempResult = Result * n;
if (TempResult > 0) {
Result = TempResult;
}
log.info("nPr:Result=" + Result + " n=" + n + " r=" + r + " i=" + i);
}
return Result;
}
public static long nCr(long n, long r, long Result) {
long TempResult = 1;
int i = 1;
TempResult = Result * nPr(n, r, Result) / Fact(r, 1);
if (TempResult > 0) {
Result = TempResult;
}
log.info("nCr:Result=" + Result + " n=" + n + " r=" + r + " i=" + i);
return Result;
}
//Normal Input Code
// Checker Function to Validate class Normal
public static boolean Checker(int planeNum, boolean UseFlag, boolean HasFlag, Integer HasColumns) {
if ((HasFlag == true) && (HasColumns > 0)) {
//if (HyperCubeArray[planeNum].SignalObj.ColNormalArray!=null) {
{
if (DataArray != null) {
{
if (LevelCntrlArray != null) {
return true;
} else {
log.error("NormalChecker:Failed Making Object Null:LevelCntrlArray");
}
}
} else {
log.error("NormalChecker:Failed Making Object Null:LevelCntrlArray");
}
}
//}
//else log.error("NormalChecker:Failed Making Object Null:ColNormalArray");
} else {
log.error("NormalChecker:Failed Making Object Null:HasNormal:HasColumns");
}
//HyperCubeArray[planeNum].SignalObj.ColNormalArray=null;
return false;
}
public static void setArrayLevelCntrlArray(int planeNum) {
long MyStartROWSDOE = Length;
long MyStartCOLMDOE = InitLevels[0].length - 1;
LevelCntrlArray = ByteBuffer.allocateDirect((int) (MyStartROWSDOE * MyStartCOLMDOE * SIZEOFCELL)).order(ByteOrder.nativeOrder());
if ((LevelCntrlArray == null)) {
log.error("setArrayLevelCntrlArray:Null LevelCntrlArray for planeNum=" + planeNum + " MyStartROWSDOE=" + MyStartROWSDOE + " MyStartCOLMDOE=" + MyStartCOLMDOE);
}
LevelValueStore = new double[(int) Length][LEVELS + 1];
LevelValueInit = new int[(int) Length];
Name = new String[(int) Length];
for (int j = 0; j < Length; j++) {
LevelValueStore[j] = new double[(int) LEVELS + 1];
LevelValueInit[j] = -1;
Name[j] = "";
}
for (long j = 0, i = 0; (j < MyStartROWSDOE); j++) {
LevelCntrlArrayPut(planeNum, j, LevelMinIndex, 1);
LevelCntrlArrayPut(planeNum, j, LevelMaxIndex, LEVELS);
LevelCntrlArrayPut(planeNum, j, LevelCtrlIndex, 1);
LevelCntrlArrayPut(planeNum, j, LastIssuedLevel, 1);
LevelCntrlArrayPut(planeNum, j, LastIssuedValue, 1);
LevelCntrlArrayPut(planeNum, j, FactorialRow1Lev, 1);
LevelCntrlArrayPut(planeNum, j, FactSpreadRow1Lev, 1);
LevelCntrlArrayPut(planeNum, j, FactRowRow1Lev, 1);
LevelCntrlArrayPut(planeNum, j, FactorialRow3Lev, 1);
LevelCntrlArrayPut(planeNum, j, FactSpreadRow3Lev, 1);
LevelCntrlArrayPut(planeNum, j, FactRowRow3Lev, 1);
LevelCntrlArrayPut(planeNum, j, FactorialNMinusLev, 1);
LevelCntrlArrayPut(planeNum, j, FactSpreadNMinusLev, 1);
LevelCntrlArrayPut(planeNum, j, FactRowNMinusLev, 1);
log.info("setArrayLevelCntrlArray:Putting Default Values at j=" + j
+ " Retrieved LevelMinValue=" + LevelCntrlArrayGet(planeNum, j, LevelMinIndex)
+ " Retrieved LevelMaxValue=" + LevelCntrlArrayGet(planeNum, j, LevelMaxIndex)
+ " Retrieved LevelCtrlIndex=" + LevelCntrlArrayGet(planeNum, j, LevelCtrlIndex)
+ " Retrieved LastIssuedLevel=" + LevelCntrlArrayGet(planeNum, j, LastIssuedLevel)
+ " Retrieved LastIssuedValue=" + LevelCntrlArrayGet(planeNum, j, LastIssuedValue)
+ " Retrieved FactorialRow1Lev=" + LevelCntrlArrayGet(planeNum, j, FactorialRow1Lev)
+ " Retrieved FactSpreadRow1Lev=" + LevelCntrlArrayGet(planeNum, j, FactSpreadRow1Lev)
+ " Retrieved FactRowRow1Lev=" + LevelCntrlArrayGet(planeNum, j, FactRowRow1Lev)
+ " Retrieved FactorialRow3Lev=" + LevelCntrlArrayGet(planeNum, j, FactorialRow3Lev)
+ " Retrieved FactSpreadRow3Lev=" + LevelCntrlArrayGet(planeNum, j, FactSpreadRow3Lev)
+ " Retrieved FactRowRow3Lev=" + LevelCntrlArrayGet(planeNum, j, FactRowRow3Lev)
+ " Retrieved FactorialNMinusLev=" + LevelCntrlArrayGet(planeNum, j, FactorialNMinusLev)
+ " Retrieved FactSpreadNMinusLev=" + LevelCntrlArrayGet(planeNum, j, FactSpreadNMinusLev)
+ " Retrieved FactRowNMinusLev=" + LevelCntrlArrayGet(planeNum, j, FactRowNMinusLev)
);
log.error("LevelCntrlArray.size=" + LevelCntrlArray.limit() + " MyStartROWSDOE=" + MyStartROWSDOE + " MyStartCOLMDOE=" + MyStartCOLMDOE + " for planeNum=" + planeNum);
}
}
public static int LevelCntrlArrayGet(int planeNum, long row, long LevelIndex) {
long MaxRow = Length;
long MaxCol = InitLevels[0].length - 1;
if ((LevelCntrlArray != null)
&& ((MaxRow * MaxCol) < LevelCntrlArray.limit())
&& (row < MaxRow)
&& ((row * LevelIndex) < LevelCntrlArray.limit())) {
long n = ((row) * MaxCol) + LevelIndex;
if (n <= LevelCntrlArray.limit()) {
return (int) LevelCntrlArray.get((int) n);
}
}
return -1;
}
public static void LevelCntrlArrayPut(int planeNum, long row, long LevelIndex, long Value) {
long MaxRow = Length;
long MaxCol = InitLevels[0].length - 1;
if (LevelCntrlArray == null) {
log.error("LevelCntrlArrayPut:LevelCntrlArray=null for planeNum=" + planeNum + " MaxRow=" + MaxRow + " MaxCol=" + MaxCol);
return;
}
if ((LevelCntrlArray != null)
&& ((MaxRow * MaxCol) < LevelCntrlArray.limit())
&& (row < MaxRow)
&& ((row * LevelIndex) < LevelCntrlArray.limit())) {
long n = ((row) * MaxCol) + LevelIndex;
if (n <= LevelCntrlArray.limit()) {
if ((Value <= Byte.MAX_VALUE) && (Value >= Byte.MIN_VALUE)) {
LevelCntrlArray.put((int) n, (byte) Value);
} else {
LevelCntrlArray.put((int) n, (byte) 1);
}
}