예제 #1
0
        public void PrintComplexMatrix(MCJCMatrix matrix)
        {
            int cols = matrix.cols();
            int rows = matrix.rows();

            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < cols; j++)
                {
                    double re = matrix.getAt(i, j);
                    double im = matrix.getAtIm(i, j);

                    Console.Write("({0};{1})  ", re, im);
                }
                Console.WriteLine();
            }
        }
예제 #2
0
        public override string ToString()
        {
            int rows = _mat.rows();
            int cols = _mat.cols();

            var sb = new StringBuilder();

            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < cols; j++)
                {
                    sb.Append(new NComplex(_mat.getAt(i, j), _mat.getAtIm(i, j)) + " ");
                }
                sb.Append("\n");
            }

            return(sb.ToString());
        }
예제 #3
0
        public void PrintComplexMatrix(MCJCMatrix matrix)
        {
            int cols = matrix.cols();
            int rows = matrix.rows();

            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < cols; j++)
                {
                    double re = matrix.getAt(i, j);
                    double im = matrix.getAtIm(i, j);

                    Console.Write("({0};{1})  ", re, im);
                }
                Console.WriteLine();
            }
        }