private CubeAction Reverse(bool forceRefMode) { var reverseAction = new CubeAction(Operator.Reverse, this, null, false); CubeAction ret; if (forceRefMode || this.RefMode || reverseAction.Count() >= RefModeLengthThreshold || reverseAction.Count() < 0) // It could overflow for very large CubeAction, but we tolerate it { reverseAction.AccelerationMap = GetAccelerationMap().Reverse(); ret = reverseAction; } else { var reverseOps = reverseAction.GetOps(); ret = new CubeAction(reverseOps, false); if (AccelerationMap != null) { ret.AccelerationMap = AccelerationMap.Reverse(); ret.VerifyAccelerationMap(); } } ret.VerifySetupAccelerationMap(); ret.VerifySetupRefMode(); return(ret); }