Пример #1
0
        /// <summary>
        /// Initialize the state
        /// </summary>
        /// <param name="ckt"></param>
        public void Initialize(Circuit ckt)
        {
            // Initialize all matrices
            Order   = ckt.Nodes.Count + 1;
            Real    = new CircuitStateReal(Order);
            Complex = new CircuitStateComplex(Order);
            Noise   = new CircuitStateNoise();
            if (ckt.Method != null)
            {
                ReinitStates(ckt.Method);
            }
            else
            {
                States = new Vector <double> [2];
            }

            // Fill the states
            NumStates = Math.Max(NumStates, 1);
            for (int i = 0; i < States.Length; i++)
            {
                States[i] = new DenseVector(NumStates);
            }

            Initialized = true;
        }
Пример #2
0
        /// <summary>
        /// Initialize the state
        /// </summary>
        /// <param name="ckt"></param>
        public void Initialize(Circuit ckt)
        {
            // Initialize all matrices
            Order   = ckt.Nodes.Count + 1;
            Real    = new CircuitStateReal(Order);
            Complex = new CircuitStateComplex(Order);

            // Allocate states
            if (ckt.Method != null)
            {
                States = new Vector <double> [ckt.Method.MaxOrder + 2];
            }
            else
            {
                States = new Vector <double> [2];
            }
            NumStates = Math.Max(NumStates, 1);
            for (int i = 0; i < States.Length; i++)
            {
                States[i] = new DenseVector(NumStates);
            }

            Initialized = true;
        }