コード例 #1
0
            public CubeAction Mul(CubeAction other)
            {
                var mulAction = new CubeAction(Operator.Mul, this, other, false);

                CubeAction ret;

                if (this.RefMode || other.RefMode || mulAction.Count() >= RefModeLengthThreshold ||
                    mulAction.Count() < 0)     // It could overflow for very large CubeAction, but we tolerate it
                {
                    mulAction.AccelerationMap = GetAccelerationMap().Mul(other.GetAccelerationMap());
                    ret = mulAction;
                }
                else
                {
                    if (Ops.Count + other.Ops.Count > OpCountForAccelerationMap)
                    {
                        // As tested, without aggressively propagate building AccelerationMap,
                        // there can be many long generators * short generators, that resulted
                        // in new long generators without AccelerationMap.
                        LazyBuildAccelerationMap();
                        other.LazyBuildAccelerationMap();
                    }

                    var mulOps = mulAction.GetOps();
                    ret = new CubeAction(mulOps, false);
                    if (AccelerationMap != null && other.AccelerationMap != null)
                    {
                        ret.AccelerationMap = AccelerationMap.Mul(other.AccelerationMap);
                        ret.VerifyAccelerationMap();
                    }
                }

                ret.VerifySetupAccelerationMap();
                ret.VerifySetupRefMode();
                return(ret);
            }