예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Frequency"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
 public Frequency(IComponentBindingContext context) : base(context)
 {
     _complex         = context.GetState <IComplexSimulationState>();
     ComplexVariables = new DiodeVariables <Complex>(Name, _complex, context);
     _elements        = new ElementSet <Complex>(_complex.Solver,
                                                 ComplexVariables.GetMatrixLocations(_complex.Map));
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(IComponentBindingContext context)
            : base(context)
        {
            context.Nodes.CheckNodes(2);

            var state = context.GetState <IBiasingSimulationState>();

            _iteration = context.GetState <IIterationSimulationState>();

            Variables = new DiodeVariables <double>(Name, state, context);
            Elements  = new ElementSet <double>(state.Solver,
                                                Variables.GetMatrixLocations(state.Map),
                                                Variables.GetRhsIndicies(state.Map));
        }