Friday, February 25, 2011

MathCom_Summery Lecturre from Ch 8 ,9 ,10,11,12

Chapter 08-Number Theory
==================





Chapter 09-Combinatiorics
==================




Chapter 10-Recursion & Recurrence Relations
==================




Chapter 10-Recursion & Recurrence Relations
==================












Chapter 12-Tree
==================



Download Full Image (if you can see them clear )
http://www.ziddu.com/download/13973844/SumCh8-9-10-11-12.rar.html

MathCom_Final-Answer Exercise Ch8,9,10,11,12

Chapter-08 Number Theory
===================


 Chapter-09 Combinatorics
===================






 Chapter-10 Recursive & Recurrence Relation
===================








Chapter-11 - Graph Theory
===================






 Chapter-12 Tree
===================







ถ้ามองไม่ชัดสามารถดาวน์โหลด Link ข้างล่างก็ได้


Download ! Full Image !

โชคดีทุกคุณนะครับ !!!

Tuesday, February 1, 2011

CPP_Class Mulitple of Matrix

Code C++ language for execute the program terminate the Mulitple of Matrix and Substand and Summation
below :
=========================================

#include<iostream>
#include<stdio.h>
#include<string.h>
#define max 10
using namespace std;
bool plus_minus;
class MatrixOperation
    { private:
            int i,j,k,Ar,Ac,Br,Bc,MA[max][max],MB[max][max],MC[max][max];
            char NameMatrix;
      public:
        //---------------------------------------
            void InputDimention(void)
            {   loop:
                cout<<"====Multiply of Matrix <<Maxinum (10x10)>>====\nInput Demintion of Matrix A :\n";
                cout<<"row    : ";cin>>Ar;
                cout<<"column : ";cin>>Ac;
                cout<<"\nInput Demintion of Matrix B :\n";
                cout<<"row    : ";cin>>Br;
                cout<<"column : ";cin>>Bc;
                if(Ac!=Br)
                {   cout<<"\n***Can't multiply Matrix , Please try again ! >\n\a\n";
                    goto loop;
                }
                if((Ar==Ac)&&(Br==Bc))
                {   cout<<"\n***Can plus or minu Matrix A & B !\n\a\n";
                    plus_minus=true;
                }
                else
                    cout<<"\n***Can't plus or minu Matrix A & B !\n***But can multiply Matrix A*B\a\n";
            }
        //-------------------------------------
            void InputMatrix(void)
            {   cout<<"Input Matrix A ("<<Ar<<"x"<<Ac<<") : \n"<<endl;
                for(i=1;i<=Ar;i++)
                    for(j=1;j<=Ac;j++)
                        {   cout<<"MA["<<i<<"]["<<j<<"]: ";
                            cin>>MA[i][j];
                        }
                cout<<"Input Matrix B ("<<Br<<"x"<<Bc<<") : \n"<<endl;
                for(j=1;j<=Br;j++)
                    for(k=1;k<=Bc;k++)
                        {   cout<<"MA["<<j<<"]["<<k<<"]: ";
                            cin>>MB[j][k];
                        }
                cout<<"\nMatrix A :\n";
                for(i=1;i<=Ar;i++)
                {   cout<<"\t";
                    for(j=1;j<=Ac;j++)
                        cout<<MA[i][j]<<"\t";
                    cout<<"\n";
                }
                cout<<"\nMatrix B :\n";
                for(j=1;j<=Br;j++)
                {   cout<<"\t";
                    for(k=1;k<=Bc;k++)
                        cout<<MB[j][k]<<"\t";
                    cout<<"\n";
                }
            }
        //---------------------------------------
            void MultiplyMatrix(void)

            {   for(i=1;i<=Ar;i++)
                    for(k=1;k<=Bc;k++)
                        {   MC[i][k]=0;
                            for(j=1;j<=Ac;j++)
                                MC[i][k]+=(MA[i][j]*MB[j][k]); 
                        }
            }
//------------------------------------
            void DisplayMulti(void)
            {   cout<<"\n=========Result of Multiply Matrix A*B===========\nAxB : \n";
                for(i=1;i<=Ar;i++)
                {   cout<<"\t";
                    for(k=1;k<=Bc;k++)
                       cout<<MC[i][k]<<"\t";
                    cout<<endl;
                }
            }
        //-----------------------------------------
            void PlusMinusMatrix(void)
            {   cout<<"\n=======Result of Plus and Minus A+B & A-B ========\n";
                cout<<"A + B :\n\n";
                for(i=1;i<=Ar;i++)
                {   cout<<"\t";
                    for(j=1;j<=Ac;j++)
                       cout<<MA[i][j]+MB[i][j]<<"\t";
                    cout<<endl;
                }

                cout<<"\n=================================================\nA - B :\n\n";
                for(i=1;i<=Ar;i++)
                {   cout<<"\t";
                    for(j=1;j<=Ac;j++)
                       cout<<MA[i][j]-MB[i][j]<<"\t";
                    cout<<endl;
                }
                cout<<"\n=================================================";
            }
    };
int main()
{   MatrixOperation Obj;
    Obj.InputDimention();
    Obj.InputMatrix();
    Obj.MultiplyMatrix();
    Obj.DisplayMulti();
    if(plus_minus==true)
        Obj.PlusMinusMatrix();
    return 0;
}