@@ -1,1464 +0,0 @@
5−import java.io.IOException;
6−import java.io.InputStream;
7−import java.io.OutputStream;
8−import java.math.BigInteger;
11− public static byte LPlus(byte x, byte y) {
12− return (byte)(x + y);
14− public static char LPlus(char x, char y) {
15− return (char)(x + y);
17− public static short LPlus(short x, short y) {
18− return (short)(x + y);
20− public static int LPlus(int x, int y) {
23− public static long LPlus(long x, long y) {
26− public static double LPlus(double x, double y) {
29− public static BigInteger LPlus(BigInteger x, BigInteger y) {
32− public static byte[] LPlus(byte[] x, byte[] y) {
33− byte[] res = x.clone();
34− for (int i = 0; i < res.length; ++i) {
39− public static short[] LPlus(short[] x, short[] y) {
40− short[] res = x.clone();
41− for (int i = 0; i < res.length; ++i) {
46− public static int[] LPlus(int[] x, int[] y) {
47− int[] res = x.clone();
48− for (int i = 0; i < res.length; ++i) {
53− public static long[] LPlus(long[] x, long[] y) {
54− long[] res = x.clone();
55− for (int i = 0; i < res.length; ++i) {
61− public static byte LMinus(byte x, byte y) {
62− return (byte)(x - y);
64− public static char LMinus(char x, char y) {
65− return (char)(x - y);
67− public static short LMinus(short x, short y) {
68− return (short)(x - y);
70− public static int LMinus(int x, int y) {
73− public static long LMinus(long x, long y) {
76− public static double LMinus(double x, double y) {
79− public static BigInteger LMinus(BigInteger x, BigInteger y) {
80− return x.subtract(y);
82− public static byte[] LMinus(byte[] x, byte[] y) {
83− byte[] res = x.clone();
84− for (int i = 0; i < res.length; ++i) {
89− public static short[] LMinus(short[] x, short[] y) {
90− short[] res = x.clone();
91− for (int i = 0; i < res.length; ++i) {
96− public static int[] LMinus(int[] x, int[] y) {
97− int[] res = x.clone();
98− for (int i = 0; i < res.length; ++i) {
103− public static long[] LMinus(long[] x, long[] y) {
104− long[] res = x.clone();
105− for (int i = 0; i < res.length; ++i) {
111− public static byte LTimes(byte x, byte y) {
112− return (byte)(x * y);
114− public static char LTimes(char x, char y) {
115− return (char)(x * y);
117− public static short LTimes(short x, short y) {
118− return (short)(x * y);
120− public static int LTimes(int x, int y) {
123− public static long LTimes(long x, long y) {
126− public static double LTimes(double x, double y) {
129− public static BigInteger LTimes(BigInteger x, BigInteger y) {
130− return x.multiply(y);
132− public static byte[] LTimes(byte[] x, byte[] y) {
133− byte[] res = x.clone();
134− for (int i = 0; i < res.length; ++i) {
139− public static short[] LTimes(short[] x, short[] y) {
140− short[] res = x.clone();
141− for (int i = 0; i < res.length; ++i) {
146− public static int[] LTimes(int[] x, int[] y) {
147− int[] res = x.clone();
148− for (int i = 0; i < res.length; ++i) {
153− public static long[] LTimes(long[] x, long[] y) {
154− long[] res = x.clone();
155− for (int i = 0; i < res.length; ++i) {
161− public static byte LUDiv(byte x, byte y) {
162− return (byte)(((short)x) / ((short)y));
164− public static char LUDiv(char x, char y) {
165− return (char)(((long)x) / ((long)y));
167− public static short LUDiv(short x, short y) {
168− return (short)(((int)x) / ((int)y));
170− public static int LUDiv(int x, int y) {
171− return (int)(((long)x) / ((long)y));
173− public static long LUDiv(long x, long y) {
174− return BigInteger.valueOf(x).divide(BigInteger.valueOf(y)).longValue();
176− public static byte[] LUDiv(byte[] x, byte[] y) {
177− byte[] res = x.clone();
178− for (int i = 0; i < res.length; ++i) {
179− res[i] = (byte)(((short)res[i]) / ((short)y[i]));
183− public static short[] LUDiv(short[] x, short[] y) {
184− short[] res = x.clone();
185− for (int i = 0; i < res.length; ++i) {
186− res[i] = (short)(((int)res[i]) / ((int)y[i]));
190− public static int[] LUDiv(int[] x, int[] y) {
191− int[] res = x.clone();
192− for (int i = 0; i < res.length; ++i) {
193− res[i] = (int)(((long)res[i]) / ((long)y[i]));
197− public static long[] LUDiv(long[] x, long[] y) {
198− long[] res = x.clone();
199− for (int i = 0; i < res.length; ++i) {
200− res[i] = BigInteger.valueOf(res[i]).divide(BigInteger.valueOf(y[i])).longValue();
205− public static byte LSDiv(byte x, byte y) {
206− return (byte)(x / y);
208− public static char LSDiv(char x, char y) {
209− return (char)(x / y);
211− public static short LSDiv(short x, short y) {
212− return (short)(x / y);
214− public static int LSDiv(int x, int y) {
217− public static long LSDiv(long x, long y) {
220− public static double LSDiv(double x, double y) {
223− public static BigInteger LSDiv(BigInteger x, BigInteger y) {
226− public static byte[] LSDiv(byte[] x, byte[] y) {
227− byte[] res = x.clone();
228− for (int i = 0; i < res.length; ++i) {
233− public static short[] LSDiv(short[] x, short[] y) {
234− short[] res = x.clone();
235− for (int i = 0; i < res.length; ++i) {
240− public static int[] LSDiv(int[] x, int[] y) {
241− int[] res = x.clone();
242− for (int i = 0; i < res.length; ++i) {
247− public static long[] LSDiv(long[] x, long[] y) {
248− long[] res = x.clone();
249− for (int i = 0; i < res.length; ++i) {
255− public static byte LURem(byte x, byte y) {
256− return (byte)(((short)x) % ((short)y));
258− public static char LURem(char x, char y) {
259− return (char)(((long)x) % ((long)y));
261− public static short LURem(short x, short y) {
262− return (short)(((int)x) % ((int)y));
264− public static int LURem(int x, int y) {
265− return (int)(((long)x) % ((long)y));
267− public static long LURem(long x, long y) {
268− return BigInteger.valueOf(x).divide(BigInteger.valueOf(y)).longValue();
270− public static byte[] LURem(byte[] x, byte[] y) {
271− byte[] res = x.clone();
272− for (int i = 0; i < res.length; ++i) {
273− res[i] = (byte)(((short)res[i]) % ((short)y[i]));
277− public static short[] LURem(short[] x, short[] y) {
278− short[] res = x.clone();
279− for (int i = 0; i < res.length; ++i) {
280− res[i] = (short)(((int)res[i]) % ((int)y[i]));
284− public static int[] LURem(int[] x, int[] y) {
285− int[] res = x.clone();
286− for (int i = 0; i < res.length; ++i) {
287− res[i] = (int)(((long)res[i]) % ((long)y[i]));
291− public static long[] LURem(long[] x, long[] y) {
292− long[] res = x.clone();
293− for (int i = 0; i < res.length; ++i) {
294− res[i] = BigInteger.valueOf(res[i]).divide(BigInteger.valueOf(y[i])).longValue();
299− public static byte LSRem(byte x, byte y) {
300− return (byte)(x % y);
302− public static char LSRem(char x, char y) {
303− return (char)(x % y);
305− public static short LSRem(short x, short y) {
306− return (short)(x % y);
308− public static int LSRem(int x, int y) {
311− public static long LSRem(long x, long y) {
314− public static double LSRem(double x, double y) {
317− public static BigInteger LSRem(BigInteger x, BigInteger y) {
318− return x.remainder(y);
320− public static byte[] LSRem(byte[] x, byte[] y) {
321− byte[] res = x.clone();
322− for (int i = 0; i < res.length; ++i) {
327− public static short[] LSRem(short[] x, short[] y) {
328− short[] res = x.clone();
329− for (int i = 0; i < res.length; ++i) {
334− public static int[] LSRem(int[] x, int[] y) {
335− int[] res = x.clone();
336− for (int i = 0; i < res.length; ++i) {
341− public static long[] LSRem(long[] x, long[] y) {
342− long[] res = x.clone();
343− for (int i = 0; i < res.length; ++i) {
350− public static byte LAnd(byte x, byte y) {
351− return (byte)(x & y);
353− public static char LAnd(char x, char y) {
354− return (char)(x & y);
356− public static short LAnd(short x, short y) {
357− return (short)(x & y);
359− public static int LAnd(int x, int y) {
362− public static long LAnd(long x, long y) {
365− public static BigInteger LAnd(BigInteger x, BigInteger y) {
368− public static byte[] LAnd(byte[] x, byte[] y) {
369− byte[] res = x.clone();
370− for (int i = 0; i < res.length; ++i) {
375− public static short[] LAnd(short[] x, short[] y) {
376− short[] res = x.clone();
377− for (int i = 0; i < res.length; ++i) {
382− public static int[] LAnd(int[] x, int[] y) {
383− int[] res = x.clone();
384− for (int i = 0; i < res.length; ++i) {
389− public static long[] LAnd(long[] x, long[] y) {
390− long[] res = x.clone();
391− for (int i = 0; i < res.length; ++i) {
397− public static byte LOr(byte x, byte y) {
398− return (byte)(x | y);
400− public static char LOr(char x, char y) {
401− return (char)(x | y);
403− public static short LOr(short x, short y) {
404− return (short)(x | y);
406− public static int LOr(int x, int y) {
409− public static long LOr(long x, long y) {
412− public static BigInteger LOr(BigInteger x, BigInteger y) {
415− public static byte[] LOr(byte[] x, byte[] y) {
416− byte[] res = x.clone();
417− for (int i = 0; i < res.length; ++i) {
422− public static short[] LOr(short[] x, short[] y) {
423− short[] res = x.clone();
424− for (int i = 0; i < res.length; ++i) {
429− public static int[] LOr(int[] x, int[] y) {
430− int[] res = x.clone();
431− for (int i = 0; i < res.length; ++i) {
436− public static long[] LOr(long[] x, long[] y) {
437− long[] res = x.clone();
438− for (int i = 0; i < res.length; ++i) {
444− public static byte LXOr(byte x, byte y) {
445− return (byte)(x ^ y);
447− public static char LXOr(char x, char y) {
448− return (char)(x ^ y);
450− public static short LXOr(short x, short y) {
451− return (short)(x ^ y);
453− public static int LXOr(int x, int y) {
456− public static long LXOr(long x, long y) {
459− public static BigInteger LXOr(BigInteger x, BigInteger y) {
462− public static byte[] LXOr(byte[] x, byte[] y) {
463− byte[] res = x.clone();
464− for (int i = 0; i < res.length; ++i) {
469− public static short[] LXOr(short[] x, short[] y) {
470− short[] res = x.clone();
471− for (int i = 0; i < res.length; ++i) {
476− public static int[] LXOr(int[] x, int[] y) {
477− int[] res = x.clone();
478− for (int i = 0; i < res.length; ++i) {
483− public static long[] LXOr(long[] x, long[] y) {
484− long[] res = x.clone();
485− for (int i = 0; i < res.length; ++i) {
491− public static byte LCompl(byte x) {
494− public static char LCompl(char x) {
497− public static short LCompl(short x) {
500− public static int LCompl(int x) {
503− public static long LCompl(long x) {
506− public static BigInteger LCompl(BigInteger x) {
509− public static byte[] LCompl(byte[] x) {
510− byte[] res = new byte[x.length];
511− for (int i = 0; i < res.length; ++i) {
512− res[i] = (byte)~(x[i]);
516− public static short[] LCompl(short[] x) {
517− short[] res = new short[x.length];
518− for (int i = 0; i < res.length; ++i) {
519− res[i] = (short)~(x[i]);
523− public static int[] LCompl(int[] x) {
524− int[] res = new int[x.length];
525− for (int i = 0; i < res.length; ++i) {
526− res[i] = (int)~(x[i]);
530− public static long[] LCompl(long[] x) {
531− long[] res = new long[x.length];
532− for (int i = 0; i < res.length; ++i) {
533− res[i] = (long)~(x[i]);
538− public static byte LSHL(byte x, byte y) {
539− return (byte)(x << y);
541− public static char LSHL(char x, char y) {
542− return (char)(x << y);
544− public static short LSHL(short x, short y) {
545− return (short)(x << y);
547− public static int LSHL(int x, int y) {
550− public static long LSHL(long x, long y) {
553− public static BigInteger LSHL(BigInteger x, BigInteger y) {
554− return x.shiftLeft(y.intValue());
556− public static byte[] LSHL(byte[] x, byte[] y) {
557− byte[] res = x.clone();
558− for (int i = 0; i < res.length; ++i) {
563− public static short[] LSHL(short[] x, short[] y) {
564− short[] res = x.clone();
565− for (int i = 0; i < res.length; ++i) {
570− public static int[] LSHL(int[] x, int[] y) {
571− int[] res = x.clone();
572− for (int i = 0; i < res.length; ++i) {
577− public static long[] LSHL(long[] x, long[] y) {
578− long[] res = x.clone();
579− for (int i = 0; i < res.length; ++i) {
585− public static byte LLSHR(byte x, byte y) {
586− return (byte)(x >>> y);
588− public static char LLSHR(char x, char y) {
589− return (char)(x >>> y);
591− public static short LLSHR(short x, short y) {
592− return (short)(x >>> y);
594− public static int LLSHR(int x, int y) {
597− public static long LLSHR(long x, long y) {
600− public static byte[] LLSHR(byte[] x, byte[] y) {
601− byte[] res = x.clone();
602− for (int i = 0; i < res.length; ++i) {
607− public static short[] LLSHR(short[] x, short[] y) {
608− short[] res = x.clone();
609− for (int i = 0; i < res.length; ++i) {
614− public static int[] LLSHR(int[] x, int[] y) {
615− int[] res = x.clone();
616− for (int i = 0; i < res.length; ++i) {
621− public static long[] LLSHR(long[] x, long[] y) {
622− long[] res = x.clone();
623− for (int i = 0; i < res.length; ++i) {
629− public static byte LASHR(byte x, byte y) {
630− return (byte)(x >> y);
632− public static char LASHR(char x, char y) {
633− return (char)(x >> y);
635− public static short LASHR(short x, short y) {
636− return (short)(x >> y);
638− public static int LASHR(int x, int y) {
641− public static long LASHR(long x, long y) {
644− public static BigInteger LASHR(BigInteger x, BigInteger y) {
645− return x.shiftRight(y.intValue());
647− public static byte[] LASHR(byte[] x, byte[] y) {
648− byte[] res = x.clone();
649− for (int i = 0; i < res.length; ++i) {
654− public static short[] LASHR(short[] x, short[] y) {
655− short[] res = x.clone();
656− for (int i = 0; i < res.length; ++i) {
661− public static int[] LASHR(int[] x, int[] y) {
662− int[] res = x.clone();
663− for (int i = 0; i < res.length; ++i) {
668− public static long[] LASHR(long[] x, long[] y) {
669− long[] res = x.clone();
670− for (int i = 0; i < res.length; ++i) {
676− public static int LEq(byte x, byte y) {
677− return (x == y ? 1 : 0);
679− public static int LEq(char x, char y) {
680− return (x == y ? 1 : 0);
682− public static int LEq(short x, short y) {
683− return (x == y ? 1 : 0);
685− public static int LEq(int x, int y) {
686− return (x == y ? 1 : 0);
688− public static int LEq(long x, long y) {
689− return (x == y ? 1 : 0);
691− public static int LEq(double x, double y) {
692− return (x == y ? 1 : 0);
694− public static int LEq(BigInteger x, BigInteger y) {
695− return (x.equals(y) ? 1 : 0);
697− public static byte[] LEq(byte[] x, byte[] y) {
698− byte[] res = new byte[x.length];
699− for (int i = 0; i < x.length; ++i) {
700− res[i] = (byte)(x[i] == y[i] ? -1 : 0);
704− public static short[] LEq(short[] x, short[] y) {
705− short[] res = new short[x.length];
706− for (int i = 0; i < x.length; ++i) {
707− res[i] = (short)(x[i] == y[i] ? -1 : 0);
711− public static int[] LEq(int[] x, int[] y) {
712− int[] res = new int[x.length];
713− for (int i = 0; i < x.length; ++i) {
714− res[i] = (x[i] == y[i] ? -1 : 0);
718− public static long[] LEq(long[] x, long[] y) {
719− long[] res = new long[x.length];
720− for (int i = 0; i < x.length; ++i) {
721− res[i] = (x[i] == y[i] ? -1 : 0);
726− public static int LLt(byte x, byte y) {
727− return (x < y ? 1 : 0);
729− public static int LLt(char x, char y) {
730− return (x < y ? 1 : 0);
732− public static int LLt(short x, short y) {
733− return (x < y ? 1 : 0);
735− public static int LLt(int x, int y) {
736− return (x < y ? 1 : 0);
738− public static int LLt(long x, long y) {
739− return (x < y ? 1 : 0);
741− public static double LLt(double x, double y) {
742− return (x < y ? 1 : 0);
744− public static int LLt(BigInteger x, BigInteger y) {
745− return (x.compareTo(y) < 0 ? 1 : 0);
747− public static byte[] LLt(byte[] x, byte[] y) {
748− byte[] res = new byte[x.length];
749− for (int i = 0; i < x.length; ++i) {
750− res[i] = (byte)(x[i] < y[i] ? -1 : 0);
754− public static short[] LLt(short[] x, short[] y) {
755− short[] res = new short[x.length];
756− for (int i = 0; i < x.length; ++i) {
757− res[i] = (short)(x[i] < y[i] ? -1 : 0);
761− public static int[] LLt(int[] x, int[] y) {
762− int[] res = new int[x.length];
763− for (int i = 0; i < x.length; ++i) {
764− res[i] = (x[i] < y[i] ? -1 : 0);
768− public static long[] LLt(long[] x, long[] y) {
769− long[] res = new long[x.length];
770− for (int i = 0; i < x.length; ++i) {
771− res[i] = (x[i] < y[i] ? -1 : 0);
776− public static int LLe(byte x, byte y) {
777− return (x <= y ? 1 : 0);
779− public static int LLe(char x, char y) {
780− return (x <= y ? 1 : 0);
782− public static int LLe(short x, short y) {
783− return (x <= y ? 1 : 0);
785− public static int LLe(int x, int y) {
786− return (x <= y ? 1 : 0);
788− public static int LLe(long x, long y) {
789− return (x <= y ? 1 : 0);
791− public static double LLe(double x, double y) {
792− return (x <= y ? 1 : 0);
794− public static int LLe(BigInteger x, BigInteger y) {
795− return (x.compareTo(y) <= 0 ? 1 : 0);
797− public static byte[] LLe(byte[] x, byte[] y) {
798− byte[] res = new byte[x.length];
799− for (int i = 0; i < x.length; ++i) {
800− res[i] = (byte)(x[i] <= y[i] ? -1 : 0);
804− public static short[] LLe(short[] x, short[] y) {
805− short[] res = new short[x.length];
806− for (int i = 0; i < x.length; ++i) {
807− res[i] = (short)(x[i] <= y[i] ? -1 : 0);
811− public static int[] LLe(int[] x, int[] y) {
812− int[] res = new int[x.length];
813− for (int i = 0; i < x.length; ++i) {
814− res[i] = (x[i] <= y[i] ? -1 : 0);
818− public static long[] LLe(long[] x, long[] y) {
819− long[] res = new long[x.length];
820− for (int i = 0; i < x.length; ++i) {
821− res[i] = (x[i] <= y[i] ? -1 : 0);
826− public static int LGt(byte x, byte y) {
827− return (x > y ? 1 : 0);
829− public static int LGt(char x, char y) {
830− return (x > y ? 1 : 0);
832− public static int LGt(short x, short y) {
833− return (x > y ? 1 : 0);
835− public static int LGt(int x, int y) {
836− return (x > y ? 1 : 0);
838− public static int LGt(long x, long y) {
839− return (x > y ? 1 : 0);
841− public static double LGt(double x, double y) {
842− return (x > y ? 1 : 0);
844− public static int LGt(BigInteger x, BigInteger y) {
845− return (x.compareTo(y) > 0 ? 1 : 0);
847− public static byte[] LGt(byte[] x, byte[] y) {
848− byte[] res = new byte[x.length];
849− for (int i = 0; i < x.length; ++i) {
850− res[i] = (byte)(x[i] > y[i] ? -1 : 0);
854− public static short[] LGt(short[] x, short[] y) {
855− short[] res = new short[x.length];
856− for (int i = 0; i < x.length; ++i) {
857− res[i] = (short)(x[i] > y[i] ? -1 : 0);
861− public static int[] LGt(int[] x, int[] y) {
862− int[] res = new int[x.length];
863− for (int i = 0; i < x.length; ++i) {
864− res[i] = (x[i] > y[i] ? -1 : 0);
868− public static long[] LGt(long[] x, long[] y) {
869− long[] res = new long[x.length];
870− for (int i = 0; i < x.length; ++i) {
871− res[i] = (x[i] > y[i] ? -1 : 0);
876− public static int LGe(byte x, byte y) {
877− return (x >= y ? 1 : 0);
879− public static int LGe(char x, char y) {
880− return (x >= y ? 1 : 0);
882− public static int LGe(short x, short y) {
883− return (x >= y ? 1 : 0);
885− public static int LGe(int x, int y) {
886− return (x >= y ? 1 : 0);
888− public static int LGe(long x, long y) {
889− return (x >= y ? 1 : 0);
891− public static double LGe(double x, double y) {
892− return (x >= y ? 1 : 0);
894− public static int LGe(BigInteger x, BigInteger y) {
895− return (x.compareTo(y) >= 0 ? 1 : 0);
897− public static byte[] LGe(byte[] x, byte[] y) {
898− byte[] res = new byte[x.length];
899− for (int i = 0; i < x.length; ++i) {
900− res[i] = (byte)(x[i] >= y[i] ? -1 : 0);
904− public static short[] LGe(short[] x, short[] y) {
905− short[] res = new short[x.length];
906− for (int i = 0; i < x.length; ++i) {
907− res[i] = (short)(x[i] >= y[i] ? -1 : 0);
911− public static int[] LGe(int[] x, int[] y) {
912− int[] res = new int[x.length];
913− for (int i = 0; i < x.length; ++i) {
914− res[i] = (x[i] >= y[i] ? -1 : 0);
918− public static long[] LGe(long[] x, long[] y) {
919− long[] res = new long[x.length];
920− for (int i = 0; i < x.length; ++i) {
921− res[i] = (x[i] >= y[i] ? -1 : 0);
927− public static short LSExtIT16(byte x) {
930− public static int LSExtIT32(byte x) {
933− public static long LSExtIT64(byte x) {
936− public static BigInteger LSExtITBig(byte x) {
937− return BigInteger.valueOf(x);
939− public static short[] LSExtITVec16(byte[] x) {
940− short[] res = new short[x.length];
941− for (int i = 0; i < res.length; ++i) {
942− res[i] = (short)x[i];
946− public static int[] LSExtITVec32(byte[] x) {
947− int[] res = new int[x.length];
948− for (int i = 0; i < res.length; ++i) {
953− public static long[] LSExtITVec64(byte[] x) {
954− long[] res = new long[x.length];
955− for (int i = 0; i < res.length; ++i) {
956− res[i] = (long)x[i];
961− public static short LSExtIT16(char x) {
964− public static int LSExtIT32(char x) {
967− public static long LSExtIT64(char x) {
970− public static BigInteger LSExtITBig(char x) {
971− return BigInteger.valueOf(x);
974− public static int LSExtIT32(short x) {
977− public static long LSExtIT64(short x) {
980− public static BigInteger LSExtITBig(short x) {
981− return BigInteger.valueOf(x);
983− public static int[] LSExtITVec32(short[] x) {
984− int[] res = new int[x.length];
985− for (int i = 0; i < res.length; ++i) {
990− public static long[] LSExtITVec64(short[] x) {
991− long[] res = new long[x.length];
992− for (int i = 0; i < res.length; ++i) {
993− res[i] = (long)x[i];
998− public static long LSExtIT64(int x) {
1001− public static BigInteger LSExtITBig(int x) {
1002− return BigInteger.valueOf(x);
1004− public static long[] LSExtITVec64(int[] x) {
1005− long[] res = new long[x.length];
1006− for (int i = 0; i < res.length; ++i) {
1007− res[i] = (long)x[i];
1011− public static BigInteger LSExtITBig(long x) {
1012− return BigInteger.valueOf(x);
1016− public static short LZExtIT16(byte x) {
1017− return (short)(x < 0 ? x + (2 << 7) : x);
1019− public static int LZExtIT32(byte x) {
1020− return (int)(x < 0 ? x + (2 << 7) : x);
1022− public static long LZExtIT64(byte x) {
1023− return (long)(x < 0 ? x + (2 << 7) : x);
1025− public static BigInteger LZExtITBig(byte x) {
1026− return BigInteger.valueOf(x < 0 ? x + (2 << 7) : x);
1028− public static char LZExtITChar(byte x) {
1029− return (char)(x < 0 ? x + (2 << 7) : x);
1031− public static short[] LZExtITVec16(byte[] x) {
1032− short[] res = new short[x.length];
1033− for (int i = 0; i < res.length; ++i) {
1034− res[i] = (short)(x[i] < 0 ? x[i] + (2 << 7) : x[i]);
1038− public static int[] LZExtITVec32(byte[] x) {
1039− int[] res = new int[x.length];
1040− for (int i = 0; i < res.length; ++i) {
1041− res[i] = (int)(x[i] < 0 ? x[i] + (2 << 7) : x[i]);
1045− public static long[] LZExtITVec64(byte[] x) {
1046− long[] res = new long[x.length];
1047− for (int i = 0; i < res.length; ++i) {
1048− res[i] = (long)(x[i] < 0 ? x[i] + (2 << 7) : x[i]);
1053− public static int LZExtIT32(short x) {
1054− return (int)(x < 0 ? x + (2 << 15) : x);
1056− public static long LZExtIT64(short x) {
1057− return (long)(x < 0 ? x + (2 << 15) : x);
1059− public static BigInteger LZExtITBig(short x) {
1060− return BigInteger.valueOf(x < 0 ? x + (2 << 15) : x);
1062− public static char LZExtITChar(short x) {
1063− return (char)(x < 0 ? x + (2 << 15) : x);
1065− public static int[] LZExtITVec32(short[] x) {
1066− int[] res = new int[x.length];
1067− for (int i = 0; i < res.length; ++i) {
1068− res[i] = (int)(x[i] < 0 ? x[i] + (2 << 15) : x[i]);
1072− public static long[] LZExtITVec64(short[] x) {
1073− long[] res = new long[x.length];
1074− for (int i = 0; i < res.length; ++i) {
1075− res[i] = (long)(x[i] < 0 ? x[i] + (2 << 15) : x[i]);
1080− public static long LZExtIT64(int x) {
1081− return (long)(x < 0 ? ((long)x) + (2l << 31) : x);
1083− public static BigInteger LZExtITBig(int x) {
1084− return BigInteger.valueOf(x < 0 ? ((long)x) + (2l << 31) : x);
1086− public static char LZExtITChar(int x) {
1087− return (char)(x < 0 ? ((long)x) + (2l << 31) : x);
1089− public static long[] LZExtITVec64(int[] x) {
1090− long[] res = new long[x.length];
1091− for (int i = 0; i < res.length; ++i) {
1092− res[i] = (long)(((long)x[i]) < 0 ? x[i] + (2l << 31) : x[i]);
1097− public static BigInteger LZExtITBig(long x) {
1098− return (x < 0 ? BigInteger.valueOf(x).add(BigInteger.valueOf(2).shiftLeft(61)) : BigInteger.valueOf(x));
1100− public static char LZExtITChar(long x) {
1101− return (char)((x < 0 ? BigInteger.valueOf(x).add(BigInteger.valueOf(2).shiftLeft(61)) : BigInteger.valueOf(x)).intValue());
1104− public static byte LTruncIT8(short x) {
1107− public static byte[] LTruncITVec8(short[] x) {
1108− byte[] res = new byte[x.length];
1109− for (int i = 0; i < res.length; ++i) {
1110− res[i] = (byte)x[i];
1114− public static char LTruncITChar(short x) {
1118− public static byte LTruncIT8(int x) {
1121− public static short LTruncIT16(int x) {
1124− public static byte[] LTruncITVec8(int[] x) {
1125− byte[] res = new byte[x.length];
1126− for (int i = 0; i < res.length; ++i) {
1127− res[i] = (byte)x[i];
1131− public static short[] LTruncITVec16(int[] x) {
1132− short[] res = new short[x.length];
1133− for (int i = 0; i < res.length; ++i) {
1134− res[i] = (short)x[i];
1138− public static char LTruncITChar(int x) {
1142− public static byte LTruncIT8(long x) {
1145− public static short LTruncIT16(long x) {
1148− public static int LTruncIT32(long x) {
1151− public static byte[] LTruncITVec8(long[] x) {
1152− byte[] res = new byte[x.length];
1153− for (int i = 0; i < res.length; ++i) {
1154− res[i] = (byte)x[i];
1158− public static short[] LTruncITVec16(long[] x) {
1159− short[] res = new short[x.length];
1160− for (int i = 0; i < res.length; ++i) {
1161− res[i] = (short)x[i];
1165− public static int[] LTruncITVec32(long[] x) {
1166− int[] res = new int[x.length];
1167− for (int i = 0; i < res.length; ++i) {
1168− res[i] = (int)x[i];
1172− public static char LTruncITChar(long x) {
1176− public static byte LTruncIT8(BigInteger x) {
1177− return x.byteValue();
1179− public static short LTruncIT16(BigInteger x) {
1180− return x.shortValue();
1182− public static int LTruncIT32(BigInteger x) {
1183− return x.intValue();
1185− public static long LTruncIT64(BigInteger x) {
1186− return x.longValue();
1188− public static char LTruncITChar(BigInteger x) {
1189− return (char)x.intValue();
1192− public static byte LTruncIT8(char x) {
1195− public static short LTruncIT16(char x) {
1198− public static int LTruncIT32(char x) {
1201− public static long LTruncIT64(char x) {
1204− public static BigInteger LTruncITBig(char x) {
1205− return BigInteger.valueOf(x);
1209− public static double LFExp(double x) {
1210− return Math.exp(x);
1212− public static double LFLog(double x) {
1213− return Math.log(x);
1215− public static double LFSin(double x) {
1216− return Math.sin(x);
1218− public static double LFCos(double x) {
1219− return Math.cos(x);
1221− public static double LFTan(double x) {
1222− return Math.tan(x);
1224− public static double LFASin(double x) {
1225− return Math.asin(x);
1227− public static double LFACos(double x) {
1228− return Math.acos(x);
1230− public static double LFATan(double x) {
1231− return Math.atan(x);
1233− public static double LFSqrt(double x) {
1234− return Math.sqrt(x);
1236− public static double LFFloor(double x) {
1237− return Math.floor(x);
1239− public static double LFCeil(double x) {
1240− return Math.ceil(x);
1243− public static byte[] LMkVec(byte ... x) {
1246− public static short[] LMkVec(short ... x) {
1249− public static int[] LMKVec(int ... x) {
1252− public static long[] LMKVec(long ... x) {
1256− public static byte LIdxVec(byte[] x, int y) {
1259− public static short LIdxVec(short[] x, int y) {
1262− public static int LIdxVec(int[] x, int y) {
1265− public long LIdxVec(long[] x, int y) {
1269− public static byte[] LUpdateVec(byte[] x, int y, byte z) {
1273− public static short[] LUpdateVec(short[] x, int y, short z) {
1277− public static int[] LUpdateVec(int[] x, int y, int z) {
1281− public long[] LUpdateVec(long[] x, int y, long z) {
1286− public static String LStrConcat(String ... args) {
1287− StringBuilder builder = new StringBuilder();
1288− for (String arg : args) {
1289− builder.append(arg);
1291− return builder.toString();
1294− public static int LStrLt(String x, String y) {
1295− return (x.compareTo(y) < 0 ? 1 : 0);
1298− public static int LStrEq(String x, String y) {
1299− return (x.equals(y) ? 1 : 0);
1302− public static int LStrLen(String x) {
1306− public static double LIntFloat(byte x) {
1309− public static double LIntFloat(char x) {
1312− public static double LIntFloat(short x) {
1315− public static double LIntFloat(int x) {
1318− public static double LIntFloat(long x) {
1321− public static double LIntFloat(BigInteger x) {
1322− return x.doubleValue();
1325− public static byte LFloatIntIT8(double x) {
1328− public static short LFloatIntIT16(double x) {
1331− public static int LFloatIntIT32(double x) {
1334− public static long LFloatIntIT64(double x) {
1337− public static BigInteger LFloatIntITBig(double x) {
1338− return BigInteger.valueOf((long)x);
1340− public static char LFloatIntITChar(double x) {
1344− public static String LIntStr(byte x) {
1345− return Byte.toString(x);
1347− public static String LIntStr(char x) {
1348− return Character.toString(x);
1350− public static String LIntStr(short x) {
1351− return Short.toString(x);
1353− public static String LIntStr(int x) {
1354− return Integer.toString(x);
1356− public static String LIntStr(long x) {
1357− return Long.toString(x);
1359− public static String LIntStr(BigInteger x) {
1360− return x.toString();
1362− public static byte LStrIntIT8(String x) {
1363− return Byte.parseByte(x);
1365− public static short LStrIntIT16(String x) {
1366− return Short.parseShort(x);
1368− public static int LStrIntIT32(String x) {
1369− return Integer.parseInt(x);
1371− public static long LStrIntIT64(String x) {
1372− return Long.parseLong(x);
1374− public static BigInteger LStrIntITBig(String x) {
1375− return new BigInteger(x);
1377− public static char LStrIntITChar(String x) {
1378− return x.charAt(0);
1381− public static String LFloatStr(double x) {
1382− return Double.toString(x);
1384− public static double LStrFloat(String x) {
1385− return Double.parseDouble(x);
1388− public static char LIntCh(byte x) {
1391− public static char LIntCh(char x) {
1394− public static char LIntCh(short x) {
1397− public static char LIntCh(int x) {
1400− public static char LIntCh(long x) {
1403− public static char LIntCh(BigInteger x) {
1404− return (char)(x.intValue());
1406− public static byte LChIntIT8(char x) {
1409− public static short LChIntIT16(char x) {
1412− public static int LChIntIT32(char x) {
1415− public static long LChIntIT64(char x) {
1418− public static BigInteger LChIntITBig(char x) {
1419− return BigInteger.valueOf((long)x);
1422− public static void LPrintNum(Object x) {
1423− System.out.print(x);
1425− public static void LPrintStr(String x) {
1426− System.out.print(x);
1428− public static String LReadStr(Object x) {
1430− return ForeignPrimitives.idris_readStr(x);
1431− } catch (IOException ex) {
1432− throw new RuntimeException(ex);
1436− public static char LStrHead(String x) {
1437− return x.charAt(0);
1439− public static String LStrTail(String x) {
1440− return x.substring(1);
1442− public static String LStrCons(char x, String y) {
1443− return String.format("%c%s", x, y);
1445− public static char LStrIndex(String x, int y) {
1446− return x.charAt(y);
1448− public static String LStrRev(String x) {
1449− return new StringBuffer(x).reverse().toString();
1452− public static InputStream LStdIn() {
1455− public static OutputStream LStdOut() {
1458− public static OutputStream LStdErr() {
1461− public static Thread LVMPtr() {
1462− return Thread.currentThread();