1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.hipparchus.exception;
23
24 import java.util.Locale;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 public enum LocalizedCoreFormats implements Localizable {
41
42
43 ARRAY_SIZE_EXCEEDS_MAX_VARIABLES("array size cannot be greater than {0}"),
44
45
46 ARRAY_SIZES_SHOULD_HAVE_DIFFERENCE_1("array sizes should have difference 1 ({0} != {1} + 1)"),
47
48
49 ARRAY_SUMS_TO_ZERO("array sums to zero"),
50
51
52 AT_LEAST_ONE_COLUMN("matrix must have at least one column"),
53
54
55 AT_LEAST_ONE_ROW("matrix must have at least one row"),
56
57
58 BANDWIDTH("bandwidth ({0})"),
59
60
61 BESSEL_FUNCTION_BAD_ARGUMENT("Bessel function of order {0} cannot be computed for x = {1}"),
62
63
64 BESSEL_FUNCTION_FAILED_CONVERGENCE("Bessel function of order {0} failed to converge for x = {1}"),
65
66
67 BINOMIAL_INVALID_PARAMETERS_ORDER("must have n >= k for binomial coefficient (n, k), got k = {0}, n = {1}"),
68
69
70 BINOMIAL_NEGATIVE_PARAMETER("must have n >= 0 for binomial coefficient (n, k), got n = {0}"),
71
72
73 CANNOT_COMPUTE_0TH_ROOT_OF_UNITY("cannot compute 0-th root of unity, indefinite result"),
74
75
76 CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA("cannot compute beta density at 0 when alpha = {0,number}"),
77
78
79 CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA("cannot compute beta density at 1 when beta = %.3g"),
80
81
82 CANNOT_COMPUTE_NTH_ROOT_FOR_NEGATIVE_N("cannot compute nth root for null or negative n: {0}"),
83
84
85 CANNOT_DISCARD_NEGATIVE_NUMBER_OF_ELEMENTS("cannot discard a negative number of elements ({0})"),
86
87
88 CANNOT_FORMAT_INSTANCE_AS_COMPLEX("cannot format a {0} instance as a complex number"),
89
90
91 CANNOT_FORMAT_OBJECT_TO_FRACTION("cannot format given object as a fraction number"),
92
93
94 CANNOT_SUBSTITUTE_ELEMENT_FROM_EMPTY_ARRAY("cannot substitute an element from an empty array"),
95
96
97 COLUMN_INDEX("column index ({0})"),
98
99
100 COMPLEX_CANNOT_BE_CONSIDERED_A_REAL_NUMBER("complex number ({0},{1}) cannot be considered to be a real number"),
101
102
103 CONSTRAINT("constraint"),
104
105
106 CONTINUED_FRACTION_INFINITY_DIVERGENCE("Continued fraction convergents diverged to +/- infinity for value {0}"),
107
108
109 CONTINUED_FRACTION_NAN_DIVERGENCE("Continued fraction diverged to NaN for value {0}"),
110
111
112 CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTOR("contraction criteria ({0}) smaller than the expansion factor ({1}). This would lead to a never ending loop of expansion and contraction as a newly expanded internal storage array would immediately satisfy the criteria for contraction."),
113
114
115 CONTRACTION_CRITERIA_SMALLER_THAN_ONE("contraction criteria smaller than one ({0}). This would lead to a never ending loop of expansion and contraction as an internal storage array length equal to the number of elements would satisfy the contraction criteria."),
116
117
118 CONVERGENCE_FAILED("convergence failed"),
119
120
121 CUMULATIVE_PROBABILITY_RETURNED_NAN("Cumulative probability function returned NaN for argument {0} p = {1}"),
122
123
124 DERIVATION_ORDER_NOT_ALLOWED("derivation order {0} is not allowed here"),
125
126
127 DIFFERENT_ROWS_LENGTHS("some rows have length {0} while others have length {1}"),
128
129
130 DIGEST_NOT_INITIALIZED("digest not initialized"),
131
132
133 DIMENSIONS_MISMATCH_2x2("got {0}x{1} but expected {2}x{3}"),
134
135
136 DIMENSIONS_MISMATCH("inconsistent dimensions: {0} != {1}"),
137
138
139 DISCRETE_CUMULATIVE_PROBABILITY_RETURNED_NAN("Discrete cumulative probability function returned NaN for argument {0}"),
140
141
142 DISTRIBUTION_NOT_LOADED("distribution not loaded"),
143
144
145 DUPLICATED_ABSCISSA_DIVISION_BY_ZERO("duplicated abscissa {0} causes division by zero"),
146
147
148 EMPTY_INTERPOLATION_SAMPLE("sample for interpolation is empty"),
149
150
151 EMPTY_POLYNOMIALS_COEFFICIENTS_ARRAY("empty polynomials coefficients array"),
152
153
154 EMPTY_SELECTED_COLUMN_INDEX_ARRAY("empty selected column index array"),
155
156
157 EMPTY_SELECTED_ROW_INDEX_ARRAY("empty selected row index array"),
158
159
160 ENDPOINTS_NOT_AN_INTERVAL("endpoints do not specify an interval: [{0}, {1}]"),
161
162
163 EVALUATION("evaluation"),
164
165
166 EXPANSION_FACTOR_SMALLER_THAN_ONE("expansion factor smaller than one ({0})"),
167
168
169 FACTORIAL_NEGATIVE_PARAMETER("must have n >= 0 for n!, got n = {0}"),
170
171
172 FAILED_BRACKETING("number of iterations={4}, maximum iterations={5}, initial={6}, lower bound={7}, upper bound={8}, final a value={0}, final b value={1}, f(a)={2}, f(b)={3}"),
173
174
175 FAILED_DECOMPOSITION("failed decomposition of a {0}x{1} matrix"),
176
177
178 FAILED_FRACTION_CONVERSION("Unable to convert {0} to fraction after {1} iterations"),
179
180
181 FIRST_COLUMNS_NOT_INITIALIZED_YET("first {0} columns are not initialized yet"),
182
183
184 FIRST_ROWS_NOT_INITIALIZED_YET("first {0} rows are not initialized yet"),
185
186
187 FRACTION_CONVERSION_OVERFLOW("Overflow trying to convert {0} to fraction ({1}/{2})"),
188
189
190 GCD_OVERFLOW_32_BITS("overflow: gcd({0}, {1}) is 2^31"),
191
192
193 GCD_OVERFLOW_64_BITS("overflow: gcd({0}, {1}) is 2^63"),
194
195
196 ILL_CONDITIONED_OPERATOR("condition number {1} is too high "),
197
198
199 INDEX_LARGER_THAN_MAX("the index specified: {0} is larger than the current maximal index {1}"),
200
201
202 INDEX_NOT_POSITIVE("index ({0}) is not positive"),
203
204
205 INDEX("index ({0})"),
206
207
208 NOT_FINITE_NUMBER("{0} is not a finite number"),
209
210
211 INFINITE_BOUND("interval bounds must be finite"),
212
213
214 ARRAY_ELEMENT("value {0} at index {1}"),
215
216
217 INFINITE_ARRAY_ELEMENT("Array contains an infinite element, {0} at index {1}"),
218
219
220 INFINITE_VALUE_CONVERSION("cannot convert infinite value"),
221
222
223 INITIAL_CAPACITY_NOT_POSITIVE("initial capacity ({0}) is not positive"),
224
225
226 INITIAL_COLUMN_AFTER_FINAL_COLUMN("initial column {1} after final column {0}"),
227
228
229 INITIAL_ROW_AFTER_FINAL_ROW("initial row {1} after final row {0}"),
230
231
232 INSUFFICIENT_DATA("insufficient data"),
233
234
235 INSUFFICIENT_DIMENSION("insufficient dimension {0}, must be at least {1}"),
236
237
238 DIMENSION("dimension ({0})"),
239
240
241 INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE("sample contains {0} observed points, at least {1} are required"),
242
243
244 INSUFFICIENT_ROWS_AND_COLUMNS("insufficient data: only {0} rows and {1} columns."),
245
246
247 INTERNAL_ERROR("internal error, please fill a bug report at {0}"),
248
249
250 INVALID_MAX_ITERATIONS("bad value for maximum iterations number: {0}"),
251
252
253 ITERATIONS("iterations"),
254
255
256 LCM_OVERFLOW_32_BITS("overflow: lcm({0}, {1}) is 2^31"),
257
258
259 LCM_OVERFLOW_64_BITS("overflow: lcm({0}, {1}) is 2^63"),
260
261
262 LOWER_BOUND_NOT_BELOW_UPPER_BOUND("lower bound ({0}) must be strictly less than upper bound ({1})"),
263
264
265 LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT("lower endpoint ({0}) must be less than or equal to upper endpoint ({1})"),
266
267
268 EVALUATIONS("evaluations"),
269
270
271 MAX_COUNT_EXCEEDED("maximal count ({0}) exceeded"),
272
273
274 NAN_ELEMENT_AT_INDEX("element {0} is NaN"),
275
276
277 NAN_VALUE_CONVERSION("cannot convert NaN value"),
278
279
280 NEGATIVE_DEFINITE_MATRIX("negative definite matrix"),
281
282
283 NEGATIVE_COMPLEX_MODULE("negative complex module {0}"),
284
285
286 NEGATIVE_ELEMENT_AT_INDEX("element {0} is negative: {1}"),
287
288
289 NUMBER_OF_SUCCESSES("number of successes ({0})"),
290
291
292 NUMBER_OF_INTERPOLATION_POINTS("number of interpolation points ({0})"),
293
294
295 NUMBER_OF_TRIALS("number of trials ({0})"),
296
297
298 ROBUSTNESS_ITERATIONS("number of robustness iterations ({0})"),
299
300
301 START_POSITION("start position ({0})"),
302
303
304 NON_CONVERGENT_CONTINUED_FRACTION("Continued fraction convergents failed to converge (in less than {0} iterations) for value {1}"),
305
306
307 NON_SQUARE_MATRIX("non square ({0}x{1}) matrix"),
308
309
310 NORM("Norm ({0})"),
311
312
313 NORMALIZE_INFINITE("Cannot normalize to an infinite value"),
314
315
316 NORMALIZE_NAN("Cannot normalize to NaN"),
317
318
319 NOT_DECREASING_SEQUENCE("points {3} and {2} are not decreasing ({1} < {0})"),
320
321
322 NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION("spline partition must have at least {0} points, got {1}"),
323
324
325 NOT_INCREASING_SEQUENCE("points {3} and {2} are not increasing ({1} > {0})"),
326
327
328 NOT_POSITIVE_DEFINITE_MATRIX("not positive definite matrix"),
329
330
331 NON_POSITIVE_DEFINITE_OPERATOR("non positive definite linear operator"),
332
333
334 NON_SELF_ADJOINT_OPERATOR("non self-adjoint linear operator"),
335
336
337 NON_SQUARE_OPERATOR("non square ({0}x{1}) linear operator"),
338
339
340 DEGREES_OF_FREEDOM("degrees of freedom ({0})"),
341
342
343 NOT_POSITIVE_EXPONENT("invalid exponent {0} (must be positive)"),
344
345
346 NUMBER_OF_ELEMENTS_SHOULD_BE_POSITIVE("number of elements should be positive ({0})"),
347
348
349 BASE("base ({0})"),
350
351
352 EXPONENT("exponent ({0})"),
353
354
355 LENGTH("length ({0})"),
356
357
358 MEAN("mean ({0})"),
359
360
361 NOT_POSITIVE_NUMBER_OF_SAMPLES("number of sample is not positive: {0}"),
362
363
364 NUMBER_OF_SAMPLES("number of samples ({0})"),
365
366
367 PERMUTATION_SIZE("permutation size ({0}"),
368
369
370 POPULATION_SIZE("population size ({0})"),
371
372
373 NOT_POSITIVE_SCALE("scale must be positive ({0})"),
374
375
376 SCALE("scale ({0})"),
377
378
379 SHAPE("shape ({0})"),
380
381
382 STANDARD_DEVIATION("standard deviation ({0})"),
383
384
385 NOT_POSITIVE_WINDOW_SIZE("window size must be positive ({0})"),
386
387
388 NOT_STRICTLY_DECREASING_SEQUENCE("points {3} and {2} are not strictly decreasing ({1} <= {0})"),
389
390
391 NOT_STRICTLY_INCREASING_SEQUENCE("points {3} and {2} are not strictly increasing ({1} >= {0})"),
392
393
394 NON_SYMMETRIC_MATRIX("non symmetric matrix: the difference between entries at ({0},{1}) and ({1},{0}) is larger than {2}"),
395
396
397 NO_CONVERGENCE_WITH_ANY_START_POINT("none of the {0} start points lead to convergence"),
398
399
400 NO_DATA("no data"),
401
402
403 NO_OPTIMUM_COMPUTED_YET("no optimum computed yet"),
404
405
406 NAN_NOT_ALLOWED("NaN is not allowed"),
407
408
409 NULL_NOT_ALLOWED("null is not allowed"),
410
411
412 ARRAY_ZERO_LENGTH_OR_NULL_NOT_ALLOWED("a null or zero length array not allowed"),
413
414
415 DENOMINATOR("denominator"),
416
417
418 DENOMINATOR_FORMAT("denominator format"),
419
420
421 FRACTION("fraction"),
422
423
424 FUNCTION("function"),
425
426
427 IMAGINARY_FORMAT("imaginary format"),
428
429
430 INPUT_ARRAY("input array"),
431
432
433 NUMERATOR("numerator"),
434
435
436 NUMERATOR_FORMAT("numerator format"),
437
438
439 REAL_FORMAT("real format"),
440
441
442 WHOLE_FORMAT("whole format"),
443
444
445 NUMBER_TOO_LARGE("{0} is larger than the maximum ({1})"),
446
447
448 NUMBER_TOO_SMALL("{0} is smaller than the minimum ({1})"),
449
450
451 NUMBER_TOO_LARGE_BOUND_EXCLUDED("{0} is larger than, or equal to, the maximum ({1})"),
452
453
454 NUMBER_TOO_SMALL_BOUND_EXCLUDED("{0} is smaller than, or equal to, the minimum ({1})"),
455
456
457 NUMBER_OF_SUCCESS_LARGER_THAN_POPULATION_SIZE("number of successes ({0}) must be less than or equal to population size ({1})"),
458
459
460 NUMERATOR_OVERFLOW_AFTER_MULTIPLY("overflow, numerator too large after multiply: {0}"),
461
462
463 OBSERVED_COUNTS_BOTTH_ZERO_FOR_ENTRY("observed counts are both zero for entry {0}"),
464
465
466 OUT_OF_RANGE_ROOT_OF_UNITY_INDEX("out of range root of unity index {0} (must be in [{1};{2}])"),
467
468
469 OUT_OF_RANGE("out of range"),
470
471
472 OUT_OF_RANGE_SIMPLE("{0} out of [{1}, {2}] range"),
473
474
475 OUT_OF_RANGE_LEFT("{0} out of ({1}, {2}] range"),
476
477
478 OVERFLOW("overflow"),
479
480
481 OVERFLOW_IN_FRACTION("overflow in fraction {0}/{1}, cannot negate"),
482
483
484 OVERFLOW_IN_ADDITION("overflow in addition: {0} + {1}"),
485
486
487 OVERFLOW_IN_SUBTRACTION("overflow in subtraction: {0} - {1}"),
488
489
490 OVERFLOW_IN_MULTIPLICATION("overflow in multiplication: {0} * {1}"),
491
492
493 PERMUTATION_EXCEEDS_N("permutation size ({0}) exceeds permuation domain ({1})"),
494
495
496 POLYNOMIAL("polynomial"),
497
498
499 ROOTS_OF_UNITY_NOT_COMPUTED_YET("roots of unity have not been computed yet"),
500
501
502 ROW_INDEX("row index ({0})"),
503
504
505 NOT_BRACKETING_INTERVAL("interval does not bracket a root: f({0,number,##0.################E0}) = {2,number,##0.################E0}, f({1,number,##0.################E0}) = {3,number,##0.################E0}"),
506
507
508 START_POINT_NOT_IN_INTERVAL("The start point {0} is not in the interval [{1}, {2}]"),
509
510
511 SAMPLE_SIZE_EXCEEDS_COLLECTION_SIZE("sample size ({0}) exceeds collection size ({1})"),
512
513
514 SAMPLE_SIZE_LARGER_THAN_POPULATION_SIZE("sample size ({0}) must be less than or equal to population size ({1})"),
515
516
517 SIMPLE_MESSAGE("{0}"),
518
519
520 SINGULAR_MATRIX("matrix is singular"),
521
522
523 SINGULAR_OPERATOR("operator is singular"),
524
525
526 SUBARRAY_ENDS_AFTER_ARRAY_END("subarray ends after array end"),
527
528
529 TOO_LARGE_CUTOFF_SINGULAR_VALUE("cutoff singular value is {0}, should be at most {1}"),
530
531
532 TOO_MANY_ELEMENTS_TO_DISCARD_FROM_ARRAY("cannot discard {0} elements from a {1} elements array"),
533
534
535 UNKNOWN_MODE("unknown mode {0}, known modes: {1} ({2}), {3} ({4}), {5} ({6}), {7} ({8}), {9} ({10}) and {11} ({12})"),
536
537
538 CANNOT_PARSE_AS_TYPE("string \"{0}\" unparseable (from position {1}) as an object of type {2}"),
539
540
541 CANNOT_PARSE("string \"{0}\" unparseable (from position {1})"),
542
543
544 UNSUPPORTED_OPERATION("unsupported operation"),
545
546
547 ARITHMETIC_EXCEPTION("arithmetic exception"),
548
549
550 ILLEGAL_STATE("illegal state"),
551
552
553 USER_EXCEPTION("exception generated in user code"),
554
555
556 URL_CONTAINS_NO_DATA("URL {0} contains no data"),
557
558
559 VECTOR_MUST_HAVE_AT_LEAST_ONE_ELEMENT("vector must have at least one element"),
560
561
562 WEIGHT_AT_LEAST_ONE_NON_ZERO("weight array must contain at least one non-zero value"),
563
564
565 WRONG_NUMBER_OF_POINTS("{0} points are required, got only {1}"),
566
567
568 NUMBER_OF_POINTS("number of points ({0})"),
569
570
571 ZERO_DENOMINATOR("denominator must be different from 0"),
572
573
574 ZERO_DENOMINATOR_IN_FRACTION("zero denominator in fraction {0}/{1}"),
575
576
577 ZERO_FRACTION_TO_DIVIDE_BY("the fraction to divide by must not be zero: {0}/{1}"),
578
579
580 ZERO_NORM("zero norm"),
581
582
583 ZERO_NOT_ALLOWED("zero not allowed here"),
584
585
586 ZERO_STATE_SIZE("state dimension must be different from 0"),
587
588
589 RIGHT_EDGE_GREATER_THAN_LEFT_EDGE("left edge {0} should be smaller than right edge {1}"),
590
591
592 INPUT_EXPECTED_BETWEEN_ZERO_AND_ONE_INCLUDED("input {0} is expected to be between [0:1]");
593
594
595 private final String sourceFormat;
596
597
598
599
600
601 LocalizedCoreFormats(final String sourceFormat) {
602 this.sourceFormat = sourceFormat;
603 }
604
605
606 @Override
607 public String getSourceString() {
608 return sourceFormat;
609 }
610
611
612 @Override
613 public String getLocalizedString(final Locale locale) {
614 return getLocalizedString("assets/" + LocalizedCoreFormats.class.getName().replaceAll("\\.", "/"),
615 name(), locale);
616 }
617
618 }