private void CheckCorrectness()
        {
            for (int i = 0; i < this.y.Length; i++)
            {
                y[i] = this.xStar[basis[i]];
            }

            BMatrix B  = new BMatrix(basis, A);
            Vector  rs = (Vector)(B * (new Vector(y)));

            double err = 0;

            for (int i = 0; i < y.Length; i++)
            {
                double d = Math.Abs(this.constraints[i].rightSide - rs[i]);
                if (d > err)
                {
                    err = d;
                }
            }

            if (err > this.pivotEpsilon)
            {
                Console.WriteLine("error is big {0}", err);
            }
        }
        /// <summary>
        /// create the initial factorization of the form Ln*Pn*...*L1*P1*A=Un-1*...U0
        /// </summary>
        /// <param name="APar"></param>
        internal StandardFactorization(Matrix APar, UMatrix Upar)
        {
            Contract.Requires(APar != null);
            Contract.Requires(Upar != null);

            this.A   = (BMatrix)APar;
            this.dim = A.NumberOfColumns;
            this.U   = Upar;
            InitMatrixUAndMarkovichNumbers();
            CalculateInitialFactorization();

#if DEBUGGLEE
            //   if(calls>=63)
            //     CheckFactorization();
#endif
        }
    /// <summary>
    /// create the initial factorization of the form Ln*Pn*...*L1*P1*A=Un-1*...U0
    /// </summary>
    /// <param name="APar"></param>
    internal StandardFactorization(Matrix APar, UMatrix Upar)
    {
      Contract.Requires(APar != null);
      Contract.Requires(Upar != null);

      this.A = (BMatrix)APar;
      this.dim = A.NumberOfColumns;
      this.U = Upar;
      InitMatrixUAndMarkovichNumbers();
      CalculateInitialFactorization();

#if DEBUGGLEE
         //   if(calls>=63)
       //     CheckFactorization();
#endif

    }
Пример #4
0
        private void CheckCorrectness() {
            for (int i = 0; i < this.y.Length; i++)
                y[i] = this.xStar[basis[i]];

            BMatrix B = new BMatrix(basis, A);
           Vector rs = (Vector)(B * (new Vector(y)));

            double err = 0;
            for (int i = 0; i < y.Length; i++) {
                double d = Math.Abs(this.constraints[i].rightSide - rs[i]);
                if (d > err)
                    err = d;
            }

            if (err > this.pivotEpsilon)
                Console.WriteLine("error is big {0}", err);
        }