コード例 #1
0
ファイル: or.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <N, T> or <N, T>(BlockVector <N, T> x, BlockVector <N, T> y, ref BlockVector <N, T> dst)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     gbitspan.or(x.Data, y.Data, dst.Data);
     return(ref dst);
 }
コード例 #2
0
ファイル: sub.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <N, T> sub <N, T>(BlockVector <N, T> x, BlockVector <N, T> y, ref BlockVector <N, T> z)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     ginx.sub(x.Data, y.Data, z.Data);
     return(ref z);
 }
コード例 #3
0
ファイル: sub.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <T> sub <T>(BlockVector <T> x, BlockVector <T> y, ref BlockVector <T> z)
     where T : unmanaged
 {
     mathspan.sub(x.Unblocked, y.Unblocked, z.Unblocked);
     return(ref z);
 }
コード例 #4
0
 public static Span <N, bool> eq <N, T>(BlockVector <N, T> lhs, BlockVector <N, T> rhs)
     where N : ITypeNat, new()
     where T : unmanaged
 => mathspan.eq <T>(lhs.Unsized, rhs.Unsized).ToNatural <N, bool>();
コード例 #5
0
 public static Span <bool> eq <T>(BlockVector <T> lhs, in BlockVector <T> rhs)
コード例 #6
0
 public static BlockVector <N, T> Load <N, T>(Span <T> src, N n = default)
     where N : ITypeNat, new()
     where T : struct
 => BlockVector <N, T> .LoadAligned(Span256.Load(src));
コード例 #7
0
 public static string Fomat <N, T>(this BlockVector <N, T> src)
     where T : struct
     where N : ITypeNat, new()
 => src.Unsized.FormatList();
コード例 #8
0
ファイル: add.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <N, T> add <N, T>(BlockVector <N, T> x, BlockVector <N, T> y, ref BlockVector <N, T> dst)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     ginx.add(x.Data, y.Data, dst.Data);
     return(ref dst);
 }
コード例 #9
0
 public static ref BlockVector <N, T> srl <N, T>(BlockVector <N, T> src, byte offset, ref BlockVector <N, T> dst)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     gbitspan.srl(src.Data, offset, dst.Data);
     return(ref dst);
 }
コード例 #10
0
ファイル: BlockVector.cs プロジェクト: 0xCM/arrows
 public static void Fill <N, T>(this IPolyrand random, ref BlockVector <N, T> vector, N n = default)
     where T : struct
     where N : ITypeNat, new()
 => random.StreamTo <T>(nati <N>(), ref vector.Unsized[0]);
コード例 #11
0
ファイル: add.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <N, T> add <N, T>(BlockVector <N, T> src, T scalar, ref BlockVector <N, T> dst)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     src.Data.CopyTo(dst.Data);
     mathspan.add(dst.Unsized, scalar);
     return(ref dst);
 }
コード例 #12
0
ファイル: Utilies.cs プロジェクト: 0xCM/arrows
        /// <summary>
        /// Effects a component-wise contraction on the source vector on a source vector of unsigned primal type,
        /// dst[i] = src[i].Contract(max[i])
        /// </summary>
        /// <param name="src">The vector to contract</param>
        /// <param name="max">The upper bound</param>
        /// <typeparam name="N">The length type</typeparam>
        /// <typeparam name="T">The unsigned primal type</typeparam>
        public static BlockVector <N, T> Contract <N, T>(this BlockVector <N, T> src, BlockVector <N, T> max)
            where N : ITypeNat, new()
            where T : struct
        {
            var dst = NatSpan.Alloc <N, T>();

            for (var i = 0; i < dst.Length; i++)
            {
                dst[i] = Contractors.Contract(src[i], max[i]);
            }
            return(dst);
        }
コード例 #13
0
ファイル: dot.cs プロジェクト: 0xCM/arrows
 public static T dot <N, T>(BlockVector <N, T> x, BlockVector <N, T> y)
     where N : ITypeNat, new()
     where T : unmanaged
 => mathspan.dot <T>(x.Unsized, y.Unsized);
コード例 #14
0
ファイル: dot.cs プロジェクト: 0xCM/arrows
 public static T dot <T>(BlockVector <T> x, BlockVector <T> y)
     where T : unmanaged
 => mathspan.dot <T>(x.Unblocked, y.Unblocked);
コード例 #15
0
 public static ref BlockVector <T> div <T>(ref BlockVector <T> lhs, in BlockVector <T> rhs)
コード例 #16
0
ファイル: and.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <N, T> and <N, T>(BlockVector <N, T> lhs, BlockVector <N, T> rhs, ref BlockVector <N, T> dst)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     gbitspan.and <T>(lhs.Data, rhs.Data, dst);
     return(ref dst);
 }
コード例 #17
0
 public static BlockVector <N, T> Alloc <N, T>(N n, T fill)
     where N : ITypeNat, new()
     where T : struct
 => BlockVector <N, T> .LoadAligned(Span256.Alloc <N, T>(fill));
コード例 #18
0
ファイル: and.cs プロジェクト: 0xCM/arrows
 public static ref BlockVector <N, T> and <N, T>(BlockVector <N, T> lhs, T rhs, ref BlockVector <N, T> dst)
     where N : ITypeNat, new()
     where T : unmanaged
 {
     lhs.Data.CopyTo(dst.Data);
     gbitspan.and(dst.Data, rhs);
     return(ref dst);
 }
コード例 #19
0
 public static BlockVector <N, T> Load <N, T>(N length, params T[] src)
     where N : ITypeNat, new()
     where T : struct
 => BlockVector <N, T> .LoadAligned(Span256.Load <T>(src));
コード例 #20
0
 public static ref BlockVector <T> negate <T>(ref BlockVector <T> src)
     where T : unmanaged
 {
     mathspan.negate(src.Unblocked);
     return(ref src);
 }