当前位置: 首页>>代码示例>>C#>>正文


C# Register类代码示例

本文整理汇总了C#中Register的典型用法代码示例。如果您正苦于以下问题:C# Register类的具体用法?C# Register怎么用?C# Register使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Register类属于命名空间,在下文中一共展示了Register类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddModuloQFTPhi

        public static void AddModuloQFTPhi(this QuantumComputer comp, ulong a, ulong N, RegisterRef ctrl, Register b, params RegisterRef[] controls)
        {
            if (comp.Group)
            {
                object[] parameters = new object[] { comp, a, N, ctrl, b, controls };
                comp.AddParametricGate("AddModuloQFTPhi", parameters);
                return;
            }
            else
            {
                comp.Group = true;
            }

            comp.AddQFTPhi(a, b, controls);
            comp.InverseAddQFTPhi(N, b);

            comp.InverseQFT(b);
            comp.CNot(ctrl, b[b.Width - 1]);
            comp.QFT(b);

            comp.AddQFTPhi(N, b, ctrl);
            comp.InverseAddQFTPhi(a, b, controls);

            comp.InverseQFT(b);
            comp.SigmaX(b[b.Width - 1]);
            comp.CNot(ctrl, b[b.Width - 1]);
            comp.SigmaX(b[b.Width - 1]);
            comp.QFT(b);

            comp.AddQFTPhi(a, b, controls);
        }
开发者ID:wupeng78,项目名称:QuIDE-source-code,代码行数:31,代码来源:AddModuloQFTExtension.cs

示例2: CanSetTheValueOfARegister

 public void CanSetTheValueOfARegister()
 {
     var register = new Register(8);
       const int expectedValue = 42;
       register.SetValue(expectedValue);
       Assert.That(register.GetValue(), Is.EqualTo(expectedValue));
 }
开发者ID:joshpeterson,项目名称:mos,代码行数:7,代码来源:RegisterTests.cs

示例3: RegisterTaskPanes

 public void RegisterTaskPanes(Register register)
 {
     myAddinTaskPane = register(() =>
         {
             var button = new System.Windows.Controls.Button
             {
                 Content = "Insert Quote"
             };
             button.Click += InsertQuote;
             var host = new WpfPanelHost
             {
                 Child = new UserControl
                 {
                     Content = new StackPanel
                     {
                         Children =
                         {
                             button
                         }
                     }
                 }
             };
             return host;
         }, "Quotes!");
     myAddinTaskPane.Visible = true;
     myAddinTaskPane.VisibleChanged += TaskPaneVisibleChanged;
     TaskPaneVisibleChanged(this, EventArgs.Empty);
 }
开发者ID:JoyPeterson,项目名称:VSTOContrib,代码行数:28,代码来源:DocumentViewModel.cs

示例4: InverseAddModuloQFT

 public static void InverseAddModuloQFT(this QuantumComputer comp, ulong a, ulong N, RegisterRef ctrl, Register b, params RegisterRef[] controls)
 {
     Validate(a, b, N);
     comp.QFT(b);
     comp.InverseAddModuloQFTPhi(a, N, ctrl, b, controls);
     comp.InverseQFT(b);
 }
开发者ID:wupeng78,项目名称:QuIDE-source-code,代码行数:7,代码来源:AddModuloQFTExtension.cs

示例5: cmdRegister_Click

 private void cmdRegister_Click(object sender, EventArgs e)
 {
     Register reg = new Register();
     reg.UserName = txtName.Text;
     reg.EMail = txtEMail.Text;
     mChannel.Send(reg);
 }
开发者ID:hdxhan,项目名称:IKendeLib,代码行数:7,代码来源:FrmMain.cs

示例6: BitOperation

 public BitOperation(short _targetAddress, short _bitNumber, BitOperator _op, Register.RegisterFileMap _registerFileMap, short _address)
     : base(_registerFileMap, CYCLES, _address)
 {
     this.targetAddress = _targetAddress;
     this.bitNumber = _bitNumber;
     this.op = _op;
 }
开发者ID:hipsterfister,项目名称:PIC16F84-Emulator,代码行数:7,代码来源:BitOperation.cs

示例7: RegisterSelf

 public void RegisterSelf(Register register)
 {
     contentTaskPane = register(() => new WpfPanelHost
     {
         Child = this
     }, "GitHub for Outlook", false);
 }
开发者ID:huangchao-shanghai,项目名称:VSTOContrib,代码行数:7,代码来源:TaskPaneContentHost.xaml.cs

示例8: Add

        // Add(a, b, 0) -> (a, a+b, 0)
        // Registers a, b and c must not overlap
        // Registers a and b have the same width
        // Register c is used for storing carries and must be minimum one bit wider than register a (or b)
        // Initial value of c must be 0
        public static void Add(this QuantumComputer comp,
            Register a, Register b, Register c)
        {
            if (comp.Group)
            {
                object[] parameters = new object[] { comp, a, b, c };
                comp.AddParametricGate("Add", parameters);
                return;
            }
            else
            {
                comp.Group = true;
            }

            int width = a.Width;
            int i = 0;
            for (; i < width - 1; i++)
            {
                comp.Carry(c[i], a[i], b[i], c[i + 1]);
            }
            comp.Carry(c[i], a[i], b[i], b[i + 1]);

            comp.CNot(b[i], a[i]);
            comp.Sum(c[i], a[i], b[i]);
            i--;
            for (; i >= 0; i--)
            {
                comp.InverseCarry(c[i], a[i], b[i], c[i + 1]);
                comp.Sum(c[i], a[i], b[i]);
            }
        }
开发者ID:wupeng78,项目名称:QuIDE-source-code,代码行数:36,代码来源:AddExtension.cs

示例9: AddQFTPhi

        public static void AddQFTPhi(this QuantumComputer comp, Register a, Register b, params RegisterRef[] controls)
        {
            if (comp.Group)
            {
                object[] parameters = new object[] { comp, a, b, controls };
                comp.AddParametricGate("AddQFTPhi", parameters);
                return;
            }
            else
            {
                comp.Group = true;
            }

            Validate(a, b);

            for (int j = b.Width - 1; j >= 0; j--)
            {
                for (int i = j; i >= 0; i--)
                {
                    List<RegisterRef> list = controls.ToList<RegisterRef>();
                    list.Add(a[i]);
                    RegisterRef[] controls2 = list.ToArray();
                    comp.CPhaseShift(Math.Abs(j-i), b[j], controls2);
                }
            }
        }
开发者ID:wupeng78,项目名称:QuIDE-source-code,代码行数:26,代码来源:AddQFTExtension.cs

示例10: AddQFT

 public static void AddQFT(this QuantumComputer comp, ulong a, Register b, params RegisterRef[] controls)
 {
     Validate(a, b);
     comp.QFT(b);
     comp.AddQFTPhi(a, b, controls);
     comp.InverseQFT(b);
 }
开发者ID:wupeng78,项目名称:QuIDE-source-code,代码行数:7,代码来源:AddQFTExtension.cs

示例11: RotateOperation

 public RotateOperation(short _sourceAddress, short _targetAddress, RotationDirection _direction, Register.RegisterFileMap _registerFileMap, short _address)
     : base(_registerFileMap, CYCLES, _address)
 {
     this.data = _registerFileMap.Get(_sourceAddress);
     this.targetAddress = _targetAddress;
     this.direction = _direction;
 }
开发者ID:hipsterfister,项目名称:PIC16F84-Emulator,代码行数:7,代码来源:RotateOperation.cs

示例12: updateRegisterState

 private void updateRegisterState(TextBox txt, Register register)
 {
     txt.Invoke((MethodInvoker)(() =>
     {
         txt.Text = _vm.cpu.Registers[register].ToString();
     }));
 }
开发者ID:claassen,项目名称:RIVM,代码行数:7,代码来源:Debugger.cs

示例13: EmitMOV

 public void EmitMOV(Register regDst, int imm32)
 {
     AddrMode rexAddrMode = new AddrMode(regDst, null, 0, 0, AddrModeSize.Int32);
     EmitRexPrefix(regDst, ref rexAddrMode);
     Builder.EmitByte((byte)(0xB8 | ((int)regDst & 0x07)));
     Builder.EmitInt(imm32);
 }
开发者ID:justinvp,项目名称:corert,代码行数:7,代码来源:X64Emitter.cs

示例14: triggerInterrupt

 /// <summary>
 /// Pushes the current value of our programmCounter to the operationStack and sets programmCounter to INTERRUPT_VECTOR_ADDRESS
 /// </summary>
 public void triggerInterrupt(Data.OperationStack operationStack, Register.ProgramCounter programCounter)
 {
     operationStack.push(programCounter.value);
     programCounter.value = Register.RegisterConstants.INTERRUPT_VECTOR_ADDRESS;
     registerFileMap.clearBit(Register.RegisterConstants.INTCON_ADDRESS, Register.RegisterConstants.INTCON_GIE_MASK);
     pic.setInterruptIsNext(false);
 }
开发者ID:hipsterfister,项目名称:PIC16F84-Emulator,代码行数:10,代码来源:InterruptHandler.cs

示例15: EmitMOV

 public void EmitMOV(Register regDst, Register regSrc)
 {
     AddrMode rexAddrMode = new AddrMode(regSrc, null, 0, 0, AddrModeSize.Int64);
     EmitRexPrefix(regDst, ref rexAddrMode);
     Builder.EmitByte(0x89);
     Builder.EmitByte((byte)(0xC0 | (((int)regSrc & 0x07) << 3) | (((int)regDst & 0x07))));
 }
开发者ID:tijoytom,项目名称:corert,代码行数:7,代码来源:X64Emitter.cs


注:本文中的Register类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。