273 references to ExprTypeKind
Microsoft.ML.Transforms (273)
Expression\CodeGen.cs (50)
174
case
ExprTypeKind
.R4:
182
case
ExprTypeKind
.I4:
186
case
ExprTypeKind
.I8:
189
case
ExprTypeKind
.R4:
192
case
ExprTypeKind
.R8:
197
case
ExprTypeKind
.I8:
234
case
ExprTypeKind
.BL:
238
case
ExprTypeKind
.I4:
242
case
ExprTypeKind
.I8:
246
case
ExprTypeKind
.R4:
250
case
ExprTypeKind
.R8:
254
case
ExprTypeKind
.TX:
263
case
ExprTypeKind
.Error:
299
case
ExprTypeKind
.I4:
303
case
ExprTypeKind
.I8:
307
case
ExprTypeKind
.R4:
311
case
ExprTypeKind
.R8:
420
case
ExprTypeKind
.I4:
423
case
ExprTypeKind
.I8:
426
case
ExprTypeKind
.R4:
427
case
ExprTypeKind
.R8:
505
Contracts.Assert(node.SrcKind ==
ExprTypeKind
.BL);
540
if (node.SrcKind ==
ExprTypeKind
.I4)
571
else if (node.SrcKind ==
ExprTypeKind
.I8)
602
else if (node.SrcKind ==
ExprTypeKind
.R4)
635
Contracts.Assert(node.SrcKind ==
ExprTypeKind
.R8);
766
ExprTypeKind
kind = node.ArgTypeKind;
768
if (kind ==
ExprTypeKind
.TX && items.Length == 2)
808
case
ExprTypeKind
.BL:
811
case
ExprTypeKind
.I4:
812
case
ExprTypeKind
.I8:
815
case
ExprTypeKind
.R4:
816
case
ExprTypeKind
.R8:
835
case
ExprTypeKind
.BL:
839
case
ExprTypeKind
.TX:
843
case
ExprTypeKind
.I4:
847
case
ExprTypeKind
.I8:
851
case
ExprTypeKind
.R4:
855
case
ExprTypeKind
.R8:
971
case
ExprTypeKind
.BL:
977
case
ExprTypeKind
.I4:
983
case
ExprTypeKind
.I8:
989
case
ExprTypeKind
.R4:
995
case
ExprTypeKind
.R8:
1001
case
ExprTypeKind
.TX:
1029
private void GenBrNaCore(ExprNode node,
ExprTypeKind
kind, Label labNa, bool dup)
1036
case
ExprTypeKind
.R4:
1037
case
ExprTypeKind
.R8:
1042
case
ExprTypeKind
.Error:
1043
case
ExprTypeKind
.None:
Expression\LambdaBinder.cs (133)
66
case
ExprTypeKind
.BL:
69
case
ExprTypeKind
.I4:
72
case
ExprTypeKind
.I8:
75
case
ExprTypeKind
.R4:
78
case
ExprTypeKind
.R8:
81
case
ExprTypeKind
.TX:
144
node.SetType(
ExprTypeKind
.Error);
174
node.SetType(
ExprTypeKind
.Error);
203
private string GetStr(
ExprTypeKind
kind)
207
case
ExprTypeKind
.BL:
209
case
ExprTypeKind
.R4:
210
case
ExprTypeKind
.R8:
212
case
ExprTypeKind
.I4:
213
case
ExprTypeKind
.I8:
215
case
ExprTypeKind
.TX:
233
node.SetType(
ExprTypeKind
.Error);
243
private void BadArg(ExprNode arg,
ExprTypeKind
kind)
268
case
ExprTypeKind
.I4:
271
case
ExprTypeKind
.I8:
274
case
ExprTypeKind
.R4:
277
case
ExprTypeKind
.R8:
294
node.SetType(
ExprTypeKind
.Error);
304
BadArg(arg,
ExprTypeKind
.BL);
321
node.SetType(
ExprTypeKind
.Error);
343
node.SetType(
ExprTypeKind
.Error);
349
node.SetType(
ExprTypeKind
.Error);
359
node.SetType(
ExprTypeKind
.BL);
402
private void ReconcileNumericTypes(ExprNode a, ExprNode b, out
ExprTypeKind
kind)
417
kind =
ExprTypeKind
.Float;
428
ExprTypeKind
kind;
436
goto case
ExprTypeKind
.Float;
438
case
ExprTypeKind
.I4:
440
node.SetType(
ExprTypeKind
.I4);
454
case
ExprTypeKind
.I8:
456
node.SetType(
ExprTypeKind
.I8);
470
case
ExprTypeKind
.R4:
472
node.SetType(
ExprTypeKind
.R4);
486
case
ExprTypeKind
.R8:
488
node.SetType(
ExprTypeKind
.R8);
825
ExprTypeKind
kind;
839
kind =
ExprTypeKind
.None;
846
node.SetType(
ExprTypeKind
.Error);
849
case
ExprTypeKind
.BL:
851
node.SetType(
ExprTypeKind
.BL);
863
case
ExprTypeKind
.I4:
865
node.SetType(
ExprTypeKind
.I4);
883
case
ExprTypeKind
.I8:
885
node.SetType(
ExprTypeKind
.I8);
903
case
ExprTypeKind
.R4:
905
node.SetType(
ExprTypeKind
.R4);
923
case
ExprTypeKind
.R8:
925
node.SetType(
ExprTypeKind
.R8);
943
case
ExprTypeKind
.TX:
945
node.SetType(
ExprTypeKind
.TX);
972
ExprTypeKind
kind =
ExprTypeKind
.None;
990
node.SetType(
ExprTypeKind
.BL);
1131
public readonly
ExprTypeKind
[] Kinds;
1132
public readonly
ExprTypeKind
ReturnKind;
1174
var kinds = new
ExprTypeKind
[ps.Length];
1184
var
extCur = ExprNode.ToExprTypeKind(type);
1185
if (extCur <=
ExprTypeKind
.Error || extCur >=
ExprTypeKind
._Lim)
1196
ExprTypeKind
kindRet;
1204
var
extRet = ExprNode.ToExprTypeKind(meth.ReturnType);
1206
if (kindRet <=
ExprTypeKind
.Error || kindRet >=
ExprTypeKind
._Lim)
1219
private Candidate(IFunctionProvider provider, MethodInfo meth,
ExprTypeKind
[] kinds,
ExprTypeKind
kindRet, bool isVar)
1234
public bool IsApplicable(
ExprTypeKind
[] kinds, out int bad)
1250
var
kind = Kinds[Kinds.Length - 1];
1283
var
t1 = Kinds[k];
1284
var
t2 = other.Kinds[k];
1343
node.SetType(
ExprTypeKind
.Error);
1369
node.SetType(
ExprTypeKind
.Error);
1468
private static bool CanConvert(
ExprTypeKind
src,
ExprTypeKind
dst)
1471
Contracts.Assert(
ExprTypeKind
.Error <= src && src <
ExprTypeKind
._Lim);
1472
Contracts.Assert(
ExprTypeKind
.Error < dst && dst <
ExprTypeKind
._Lim);
1474
if (src ==
ExprTypeKind
.Error)
1479
if (src ==
ExprTypeKind
.I4)
1480
return dst ==
ExprTypeKind
.I8 || dst ==
ExprTypeKind
.R4 || dst ==
ExprTypeKind
.R8;
1481
if (src ==
ExprTypeKind
.I8)
1482
return dst ==
ExprTypeKind
.R8;
1483
if (src ==
ExprTypeKind
.R4)
1484
return dst ==
ExprTypeKind
.R8;
1491
private object Convert(ExprNode expr,
ExprTypeKind
kind)
1495
case
ExprTypeKind
.BL:
1499
BadArg(expr,
ExprTypeKind
.BL);
1502
case
ExprTypeKind
.I4:
1506
BadArg(expr,
ExprTypeKind
.I4);
1509
case
ExprTypeKind
.I8:
1513
BadArg(expr,
ExprTypeKind
.I8);
1516
case
ExprTypeKind
.R4:
1520
BadArg(expr,
ExprTypeKind
.R4);
1523
case
ExprTypeKind
.R8:
1527
BadArg(expr,
ExprTypeKind
.R8);
1530
case
ExprTypeKind
.TX:
1534
BadArg(expr,
ExprTypeKind
.TX);
1644
private bool ValidateType(ExprNode expr, ref
ExprTypeKind
itemKind)
1649
ExprTypeKind
kind = expr.ExprType;
1652
case
ExprTypeKind
.Error:
1655
case
ExprTypeKind
.None:
1664
case
ExprTypeKind
.Error:
1669
case
ExprTypeKind
.None:
1675
ExprTypeKind
kindNew;
1683
internal static bool CanPromote(bool precise,
ExprTypeKind
k1,
ExprTypeKind
k2, out
ExprTypeKind
res)
1688
if (res !=
ExprTypeKind
.Error && res !=
ExprTypeKind
.None)
1690
res =
ExprTypeKind
.Error;
1699
res =
ExprTypeKind
.Error;
1715
res =
ExprTypeKind
.I8;
1721
res = precise ?
ExprTypeKind
.R8 :
ExprTypeKind
.R4;
1733
res =
ExprTypeKind
.R8;
1738
res =
ExprTypeKind
.Error;
1746
private static int MapKindToIndex(
ExprTypeKind
kind)
1750
case
ExprTypeKind
.I4:
1752
case
ExprTypeKind
.I8:
1754
case
ExprTypeKind
.R4:
1756
case
ExprTypeKind
.R8:
1775
private static readonly Cmp[] _fnEqual = new Cmp[(int)
ExprTypeKind
._Lim]
1789
private static readonly Cmp[] _fnNotEqual = new Cmp[(int)
ExprTypeKind
._Lim]
1803
private static readonly Cmp[] _fnLess = new Cmp[(int)
ExprTypeKind
._Lim]
1817
private static readonly Cmp[] _fnLessEqual = new Cmp[(int)
ExprTypeKind
._Lim]
1831
private static readonly Cmp[] _fnGreater = new Cmp[(int)
ExprTypeKind
._Lim]
1845
private static readonly Cmp[] _fnGreaterEqual = new Cmp[(int)
ExprTypeKind
._Lim]
Expression\LambdaParser.cs (1)
435
if (res.ExprType ==
ExprTypeKind
.None)
Expression\Node.cs (82)
274
public
ExprTypeKind
ExprType { get; private set; }
277
private bool IsSimple(
ExprTypeKind
kind)
283
public bool HasType { get { return
ExprTypeKind
.Error < ExprType && ExprType <
ExprTypeKind
._Lim; } }
284
public bool IsNone { get { return ExprType ==
ExprTypeKind
.None; } }
285
public bool IsError { get { return ExprType ==
ExprTypeKind
.Error; } }
287
public bool IsBool { get { return IsSimple(
ExprTypeKind
.BL); } }
293
IsSimple(
ExprTypeKind
.I4) || IsSimple(
ExprTypeKind
.I8) ||
294
IsSimple(
ExprTypeKind
.R4) || IsSimple(
ExprTypeKind
.R8);
297
public bool IsI4 { get { return IsSimple(
ExprTypeKind
.I4); } }
298
public bool IsI8 { get { return IsSimple(
ExprTypeKind
.I8); } }
299
public bool IsRx { get { return IsSimple(
ExprTypeKind
.R4) || IsSimple(
ExprTypeKind
.R8); } }
300
public bool IsR4 { get { return IsSimple(
ExprTypeKind
.R4); } }
301
public bool IsR8 { get { return IsSimple(
ExprTypeKind
.R8); } }
302
public bool IsTX { get { return IsSimple(
ExprTypeKind
.TX); } }
304
public
ExprTypeKind
SrcKind { get; private set; }
313
ExprTypeKind
kind;
322
public void SetType(
ExprTypeKind
kind)
332
public void SetType(
ExprTypeKind
kind, object value)
344
internal static Type ToSysType(
ExprTypeKind
kind)
348
case
ExprTypeKind
.BL:
350
case
ExprTypeKind
.I4:
352
case
ExprTypeKind
.I8:
354
case
ExprTypeKind
.R4:
356
case
ExprTypeKind
.R8:
358
case
ExprTypeKind
.TX:
365
internal static
ExprTypeKind
ToExprTypeKind(Type type)
368
return
ExprTypeKind
.BL;
370
return
ExprTypeKind
.I4;
372
return
ExprTypeKind
.I8;
374
return
ExprTypeKind
.R4;
376
return
ExprTypeKind
.R8;
378
return
ExprTypeKind
.TX;
379
return
ExprTypeKind
.Error;
392
SetType(
ExprTypeKind
.BL);
398
SetType(
ExprTypeKind
.BL);
404
SetType(
ExprTypeKind
.I4);
410
SetType(
ExprTypeKind
.I4);
416
SetType(
ExprTypeKind
.I8);
422
SetType(
ExprTypeKind
.I8);
428
SetType(
ExprTypeKind
.R4);
434
SetType(
ExprTypeKind
.R4);
440
SetType(
ExprTypeKind
.R8);
446
SetType(
ExprTypeKind
.R8);
452
SetType(
ExprTypeKind
.TX);
458
SetType(
ExprTypeKind
.TX);
462
public void Convert(
ExprTypeKind
kind)
472
case
ExprTypeKind
.I8:
473
Contracts.Assert(ExprType ==
ExprTypeKind
.I4);
480
case
ExprTypeKind
.R4:
481
Contracts.Assert(ExprType ==
ExprTypeKind
.I4);
488
case
ExprTypeKind
.R8:
489
Contracts.Assert(ExprType ==
ExprTypeKind
.I4 || ExprType ==
ExprTypeKind
.I8 ||
490
ExprType ==
ExprTypeKind
.R4);
493
if (ExprType ==
ExprTypeKind
.I4)
498
else if (ExprType ==
ExprTypeKind
.I8)
545
case
ExprTypeKind
.I4:
546
case
ExprTypeKind
.I8:
549
Convert(
ExprTypeKind
.I8);
561
case
ExprTypeKind
.I4:
562
case
ExprTypeKind
.R4:
565
Convert(
ExprTypeKind
.R4);
577
case
ExprTypeKind
.I4:
578
case
ExprTypeKind
.I8:
579
case
ExprTypeKind
.R4:
580
case
ExprTypeKind
.R8:
583
Convert(
ExprTypeKind
.R8);
648
public
ExprTypeKind
ExprType;
661
ExprType =
ExprTypeKind
.Error;
663
ExprType =
ExprTypeKind
.TX;
665
ExprType =
ExprTypeKind
.BL;
667
ExprType =
ExprTypeKind
.I4;
669
ExprType =
ExprTypeKind
.I8;
671
ExprType =
ExprTypeKind
.R4;
673
ExprType =
ExprTypeKind
.R8;
755
SetType(
ExprTypeKind
.Error);
790
SetType(
ExprTypeKind
.Error);
1074
public
ExprTypeKind
ArgTypeKind;
Expression\Printer.cs (7)
220
case
ExprTypeKind
.I4:
223
case
ExprTypeKind
.I8:
226
case
ExprTypeKind
.R4:
229
case
ExprTypeKind
.R8:
232
case
ExprTypeKind
.BL:
235
case
ExprTypeKind
.TX:
314
if (node.ExprType ==
ExprTypeKind
.None)