forked from SciSharp/NumSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.cs
More file actions
63 lines (46 loc) · 2.11 KB
/
np.cs
File metadata and controls
63 lines (46 loc) · 2.11 KB
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
using NumSharp.Backends;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
namespace NumSharp
{
/// <summary>
/// API bridge between NumSharp and Python NumPy
/// </summary>
public static partial class np
{
public static BackendType BackendEngine { get; set; }
// https://docs.scipy.org/doc/numpy-1.16.0/user/basics.types.html
public static readonly Type bool_ = typeof(bool);
public static readonly Type bool8 = bool_;
public static readonly Type @bool = bool_;
public static readonly Type @char = typeof(char);
public static readonly Type @byte = typeof(byte);
public static readonly Type uint8 = typeof(byte);
public static readonly Type ubyte = uint8;
public static readonly Type int16 = typeof(short);
public static readonly Type uint16 = typeof(ushort);
public static readonly Type int32 = typeof(int);
public static readonly Type uint32 = typeof(uint);
public static readonly Type int_ = typeof(long);
public static readonly Type int64 = int_;
public static readonly Type intp = int_; //TODO! IntPtr?
public static readonly Type int0 = int_;
public static readonly Type uint64 = typeof(ulong);
public static readonly Type uint0 = uint64;
public static readonly Type @uint = uint64;
public static readonly Type float32 = typeof(float);
public static readonly Type float_ = typeof(double);
public static readonly Type float64 = float_;
public static readonly Type @double = float_;
public static readonly Type complex_ = typeof(Complex);
public static readonly Type complex128 = complex_;
public static readonly Type complex64 = complex_;
public static readonly Type @decimal = typeof(decimal);
public static Type chars => throw new NotSupportedException("Please use char with extra dimension.");
public static NumPyRandom random { get; } = new NumPyRandom();
// np.nan
public static double nan => double.NaN;
}
}