public void Aggregate_Matrix4x4_Multiply_Test()
        {
            using (var matrices = new NativeArray <Matrix4x4>(1024, Allocator.Persistent))
            {
                InitializeMatrixArray(matrices);
                var identity = Matrix4x4.identity;
                sw.Start();
                for (var i = 0; i < Count; i++)
                {
                    identity = matrices.Aggregate <Matrix4x4>(identity, (accumulate, seed) => accumulate * seed);
                }
                Debug.Log(sw.Stop().ToString());

                sw.Start();
                for (var i = 0; i < Count; i++)
                {
                    matrices.Aggregate <Matrix4x4, Multiply>(ref identity, default);
                }
                Debug.Log(sw.Stop().ToString());

                identity = Matrix4x4.identity;
                sw.Start();
                for (var i = 0; i < Count; i++)
                {
                    identity = LE.Aggregate(matrices, identity, (accumulate, seed) => accumulate * seed);
                }
                Debug.Log(sw.Stop().ToString());
            }
        }
Пример #2
0
 public TResult Invoke(NativeArray <T> seq)
 {
     return(seq.Aggregate(Seed, Func, ResultSelector));
 }
Пример #3
0
 public T Invoke(NativeArray <T> seq)
 {
     return(seq.Aggregate(Func));
 }
Пример #4
0
 public TAccumulate Invoke(NativeArray <T> seq)
 {
     return(seq.Aggregate(Seed, Func));
 }