Exemple #1
0
        static void Str_bool_matr()
        {
            String_matrix tbl1 = new String_matrix(false);
            String_matrix tbl2 = new String_matrix(true);


            // print out tables
            Console.WriteLine("Code 1: ");
            tbl1.Write_matrix();

            Console.WriteLine("Code 2: ");
            tbl2.Write_matrix();

            bool comp = tbl1 >= tbl2;

            Console.WriteLine();
            Console.WriteLine("Compare >= " + comp);

            comp = tbl1 <= tbl2;
            Console.WriteLine();
            Console.WriteLine("Compare <= " + comp);

            comp = tbl1 < tbl2;
            Console.WriteLine();
            Console.WriteLine("Compare < " + comp);

            comp = tbl1 > tbl2;
            Console.WriteLine();
            Console.WriteLine("Compare > " + comp);
        }
Exemple #2
0
        static void Str_matr()
        {
            String_matrix tbl1 = new String_matrix(false);
            String_matrix tbl2 = new String_matrix(true);


            // print out tables
            Console.WriteLine("Code 1: ");
            tbl1.Write_matrix();

            Console.WriteLine("Code 2: ");
            tbl2.Write_matrix();

            // perform addition and print out  results
            String_matrix tbl3 = tbl1 + tbl2;

            Console.WriteLine();
            Console.WriteLine("Code 1 + Code 2 = ");
            tbl3.Write_matrix();

            tbl3 += tbl2;

            Console.WriteLine();
            Console.WriteLine("Code 1 + Code2 + Code 2 = ");
            tbl3.Write_matrix();
        }
Exemple #3
0
        public static String_matrix operator +(String_matrix tbl1, String_column tbl2)
        {
            String_matrix res_str_matrix = new String_matrix();

            for (int i = 0; i < Size1; i++)
            {
                for (int j = 0; j < Size2; j++)
                {
                    res_str_matrix[i, j] = tbl1[i, j] + " " + tbl2[j];
                }
            }

            return(res_str_matrix);
        }
Exemple #4
0
        public static String_matrix operator ++(String_matrix tbl1)
        {
            String_matrix res_str_matrix = new String_matrix();

            for (int i = 0; i < Size1; i++)
            {
                for (int j = 0; j < Size2 - 1; j++)
                {
                    res_str_matrix[i, j] = tbl1[i, j] + " " + tbl1[i, j + 1];
                }
                res_str_matrix[i, Size2 - 1] = tbl1[i, Size2 - 1] + " " + tbl1[i, 0];
            }
            return(res_str_matrix);
        }
Exemple #5
0
        static void Str_plusplus_matr()
        {
            String_matrix tbl1 = new String_matrix(false);

            //String_matrix tbl3 = new String_matrix(false);

            // print out tables
            Console.WriteLine("Code 1: ");
            tbl1.Write_matrix();

            // perform increment and print out  results
            tbl1 = ++tbl1;

            Console.WriteLine();
            Console.WriteLine("Code 1 ++ = ");
            tbl1.Write_matrix();
        }
Exemple #6
0
        static void Str_column_matr()
        {
            String_matrix tbl1 = new String_matrix(false);
            String_column tbl2 = new String_column();

            // print out tables
            Console.WriteLine("Code 1: ");
            tbl1.Write_matrix();

            Console.WriteLine("Using  column. ");

            // perform addition and print out  results
            String_matrix tbl3 = tbl1 + tbl2;

            Console.WriteLine();
            Console.WriteLine("Code 1 + column = ");
            tbl3.Write_matrix();
        }
Exemple #7
0
        public override bool Equals(object obj)
        {
            String_matrix strob = (String_matrix)obj;

            return(String.Compare(strob.Str_clmn(), this.Str_clmn()) == 0 ? true : false);;
        }