Exemplo n.º 1
0
        public Complex_F64 computeDeterminant()
        {
            if (m != n)
            {
                throw new ArgumentException("Must be a square matrix.");
            }

            double realRet = pivsign;
            double realImg = 0;

            int total = m * stride;

            for (int i = 0; i < total; i += stride + 2)
            {
                double real      = dataLU[i];
                double imaginary = dataLU[i + 1];

                double r = realRet * real - realImg * imaginary;
                double t = realRet * imaginary + realImg * real;

                realRet = r;
                realImg = t;
            }

            det.setTo(realRet, realImg);
            return(det);
        }