47341 (Калькулятор для матриць), страница 2
Описание файла
Документ из архива "Калькулятор для матриць", который расположен в категории "". Всё это находится в предмете "информатика" из 1 семестр, которые можно найти в файловом архиве . Не смотря на прямую связь этого архива с , его также можно найти и в других разделах. Архив можно найти в разделе "курсовые/домашние работы", в предмете "информатика, программирование" в общих файлах.
Онлайн просмотр документа "47341"
Текст 2 страницы из документа "47341"
private: System::Windows::Forms::MenuItem * menuItem7;
private: System::Windows::Forms::MenuItem * menuItem8;
private: System::Windows::Forms::MenuItem * menuItem9;
private: System::Windows::Forms::MenuItem * menuItem10;
private: System::Windows::Forms::MenuItem * menuItem11;
private: System::Windows::Forms::Button * button10;
private: System::Windows::Forms::Button * button11;
private: System::Windows::Forms::MenuItem * menuItem12;
private: System::Windows::Forms::Button * button9;
private:
////////////////////////////////////////////////////////
double DET(double **X,int n)
{
double **T,kk=0;
int i,j,l,e=1;
if(n==1)return X[0][0];
if(n==2)return X[0][0]*X[1][1]-X[1][0]*X[0][1];
T=new double*[n-1];
for(i=0;i T[i]=new double[n-1]; for(l=0;l { for(j=0;j for(i=0;i T[i][j]=X[i+1][j]; for(j=l+1;j for(i=0;i { T[i][j-1]=X[i][j+1]; kk+=DET(T,n-1)*X[0][l]*e; e*=-1; } } return kk; } ///////////////////////////////////////////////////////// double ALG_DOP(double **X,int n,int r,int c) { double **T,k; int i,j,e=1,ee=1; if(n==1) return X[0][0]; if(n==2) { if((r+c)%2==1) {ee=-1;} } return ee; T=new double*[n-1]; for(i=0;i T[i]=new double[n-1]; for(i=0;i { for(j=0;j T[i][j]=X[i][j]; for(j=c+1;j T[i][j-1]=X[i][j]; } for(i=r+1;i { for(j=0;j T[i-1][j]=X[i][j]; for(j=c+1;j T[i-1][j-1]=X[i][j]; } k=DET(T,n-1); if((r+c)%2==1) e=-1; return k*e; } //////////////////////////////////////////////////// String* CNV_ARRAY(double **X,int n) { int i,j; String *s; String *ss; for(i=0;i { for(j=0;j { ss=Convert::ToString(X[i][j]); s=s->Concat(s,ss," "); } s=s->Concat(s,"\n\0"); } return s; } //////////////////////////////////////////////////// void GET_ARRAY(String *text,double **X,int n) { int i,j,k=0,p=0; double dd; for(i=0;i { for(j=0;j { while(((p+k)Length)&&(text->Chars[p+k]!=wchar_t(' '))&&(text->Chars[p+k]!='\n')){k++;} dd=Convert::ToDouble(text->Substring(p,k)); X[i][j]=dd; p=p+k+1; k=0; } } } ////////////////////////////////////////////////////// void TRANSP_ARRAY(double **X,int n) { int i,j; double ca; for(i=0;i for(j=i+1;j { ca=X[i][j]; X[i][j]=X[j][i]; X[j][i]=ca; } } ////////////////////////////////////////////////////// double TRACE(double **X,int n) { int i,j; double tt=0; for(i=0;i for(j=0;j { if(i==j) tt+=X[i][j]; } return tt; } //////////////////////////////////////////////////// /// /// Required designer variable. /// System::ComponentModel::Container * components; /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->label1 = new System::Windows::Forms::Label(); this->label2 = new System::Windows::Forms::Label(); this->label3 = new System::Windows::Forms::Label(); this->label4 = new System::Windows::Forms::Label(); this->label5 = new System::Windows::Forms::Label(); this->label6 = new System::Windows::Forms::Label(); this->textBox1 = new System::Windows::Forms::TextBox(); this->textBox2 = new System::Windows::Forms::TextBox(); this->textBox3 = new System::Windows::Forms::TextBox(); this->textBox4 = new System::Windows::Forms::TextBox(); this->textBox5 = new System::Windows::Forms::TextBox(); this->textBox6 = new System::Windows::Forms::TextBox(); this->button1 = new System::Windows::Forms::Button(); this->button2 = new System::Windows::Forms::Button(); this->button3 = new System::Windows::Forms::Button(); this->button4 = new System::Windows::Forms::Button(); this->button5 = new System::Windows::Forms::Button(); this->button6 = new System::Windows::Forms::Button(); this->button7 = new System::Windows::Forms::Button(); this->button8 = new System::Windows::Forms::Button(); this->button9 = new System::Windows::Forms::Button(); this->mainMenu1 = new System::Windows::Forms::MainMenu(); this->menuItem1 = new System::Windows::Forms::MenuItem(); this->menuItem2 = new System::Windows::Forms::MenuItem(); this->menuItem3 = new System::Windows::Forms::MenuItem(); this->menuItem4 = new System::Windows::Forms::MenuItem(); this->menuItem5 = new System::Windows::Forms::MenuItem(); this->menuItem6 = new System::Windows::Forms::MenuItem(); this->menuItem7 = new System::Windows::Forms::MenuItem(); this->menuItem8 = new System::Windows::Forms::MenuItem(); this->menuItem9 = new System::Windows::Forms::MenuItem(); this->menuItem10 = new System::Windows::Forms::MenuItem(); this->menuItem11 = new System::Windows::Forms::MenuItem(); this->button10 = new System::Windows::Forms::Button(); this->button11 = new System::Windows::Forms::Button(); this->menuItem12 = new System::Windows::Forms::MenuItem(); this->SuspendLayout(); // // label1 // this->label1->Location = System::Drawing::Point(16, 88); this->label1->Name = S"label1"; this->label1->Size = System::Drawing::Size(24, 23); this->label1->TabIndex = 15; this->label1->Text = S"A:"; this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // label2 // this->label2->Location = System::Drawing::Point(8, 192); this->label2->Name = S"label2"; this->label2->Size = System::Drawing::Size(32, 23); this->label2->TabIndex = 16; this->label2->Text = S"B:"; this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // label3 // this->label3->Location = System::Drawing::Point(352, 192); this->label3->Name = S"label3"; this->label3->Size = System::Drawing::Size(32, 23); this->label3->TabIndex = 17; this->label3->Text = S"C:"; this->label3->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // label4 // this->label4->Location = System::Drawing::Point(16, 16); this->label4->Name = S"label4"; this->label4->Size = System::Drawing::Size(48, 23); this->label4->TabIndex = 18; this->label4->Text = S"SIZE:"; this->label4->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // label5 // this->label5->Location = System::Drawing::Point(152, 16); this->label5->Name = S"label5"; this->label5->Size = System::Drawing::Size(48, 23); this->label5->TabIndex = 19; this->label5->Text = S"CONST:"; this->label5->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // label6 // this->label6->Location = System::Drawing::Point(176, 216); this->label6->Name = S"label6"; this->label6->Size = System::Drawing::Size(56, 23); this->label6->TabIndex = 20; this->label6->Text = S"REZULT:"; this->label6->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // textBox1 // this->textBox1->AutoSize = false; this->textBox1->BackColor = System::Drawing::Color::Lavender; this->textBox1->Location = System::Drawing::Point(48, 56); this->textBox1->Name = S"textBox1"; this->textBox1->Size = System::Drawing::Size(100, 80); this->textBox1->TabIndex = 1; this->textBox1->Text = S""; this->textBox1->TextAlign = System::Windows::Forms::HorizontalAlignment::Center; // // textBox2 // this->textBox2->AutoSize = false; this->textBox2->BackColor = System::Drawing::Color::Lavender; this->textBox2->Location = System::Drawing::Point(48, 160); this->textBox2->Name = S"textBox2"; this->textBox2->Size = System::Drawing::Size(100, 80); this->textBox2->TabIndex = 2; this->textBox2->Text = S""; this->textBox2->TextAlign = System::Windows::Forms::HorizontalAlignment::Center; // // textBox3 // this->textBox3->AutoSize = false; this->textBox3->BackColor = System::Drawing::Color::AliceBlue; this->textBox3->Location = System::Drawing::Point(392, 160); this->textBox3->Name = S"textBox3"; this->textBox3->Size = System::Drawing::Size(100, 80); this->textBox3->TabIndex = 4; this->textBox3->Text = S""; this->textBox3->TextAlign = System::Windows::Forms::HorizontalAlignment::Center; // // textBox4 // this->textBox4->AutoSize = false; this->textBox4->BackColor = System::Drawing::Color::LavenderBlush; this->textBox4->Location = System::Drawing::Point(64, 16); this->textBox4->Name = S"textBox4"; this->textBox4->Size = System::Drawing::Size(64, 20); this->textBox4->TabIndex = 0; this->textBox4->Text = S""; this->textBox4->TextAlign = System::Windows::Forms::HorizontalAlignment::Center; // textBox5 // this->textBox5->AutoSize = false; this->textBox5->BackColor = System::Drawing::Color::LavenderBlush; this->textBox5->Location = System::Drawing::Point(208, 16); this->textBox5->Name = S"textBox5"; this->textBox5->Size = System::Drawing::Size(40, 20); this->textBox5->TabIndex = 3; this->textBox5->Text = S""; this->textBox5->TextAlign = System::Windows::Forms::HorizontalAlignment::Center; // // textBox6 // this->textBox6->AutoSize = false; this->textBox6->BackColor = System::Drawing::Color::AliceBlue; this->textBox6->Location = System::Drawing::Point(240, 208); this->textBox6->Name = S"textBox6"; this->textBox6->Size = System::Drawing::Size(48, 32); this->textBox6->TabIndex = 5; this->textBox6->Text = S""; this->textBox6->TextAlign = System::Windows::Forms::HorizontalAlignment::Center; // // button1 // this->button1->BackColor = System::Drawing::Color::LightSkyBlue; this->button1->Location = System::Drawing::Point(272, 8); this->button1->Name = S"button1"; this->button1->Size = System::Drawing::Size(32, 23); this->button1->TabIndex = 6; this->button1->Text = S"*"; this->button1->Click += new System::EventHandler(this, button1_Click); // // button2 // this->button2->BackColor = System::Drawing::Color::LightSkyBlue; this->button2->Location = System::Drawing::Point(344, 8); this->button2->Name = S"button2"; this->button2->Size = System::Drawing::Size(32, 23); this->button2->TabIndex = 7; this->button2->Text = S"+"; this->button2->Click += new System::EventHandler(this, button2_Click); // // button3 // this->button3->BackColor = System::Drawing::Color::LightSkyBlue; this->button3->Location = System::Drawing::Point(432, 8); this->button3->Name = S"button3"; this->button3->Size = System::Drawing::Size(32, 23); this->button3->TabIndex = 8; this->button3->Text = S"--"; this->button3->Click += new System::EventHandler(this, button3_Click); // // button4 // this->button4->BackColor = System::Drawing::Color::LightSkyBlue; this->button4->Location = System::Drawing::Point(264, 48); this->button4->Name = S"button4"; this->button4->Size = System::Drawing::Size(48, 23); this->button4->TabIndex = 9; this->button4->Text = S"*const"; this->button4->Click += new System::EventHandler(this, button4_Click); // // button5 // this->button5->BackColor = System::Drawing::Color::LightSkyBlue; this->button5->Location = System::Drawing::Point(264, 96); this->button5->Name = S"button5"; this->button5->Size = System::Drawing::Size(48, 23); this->button5->TabIndex = 10; this->button5->Text = S"/const"; this->button5->Click += new System::EventHandler(this, button5_Click); // // button6 // this->button6->BackColor = System::Drawing::Color::LightSkyBlue; this->button6->Location = System::Drawing::Point(344, 48); this->button6->Name = S"button6"; this->button6->Size = System::Drawing::Size(40, 23); this->button6->TabIndex = 11; this->button6->Text = S"det"; this->button6->Click += new System::EventHandler(this, button6_Click); // // button7 // this->button7->BackColor = System::Drawing::Color::LightSkyBlue; this->button7->Location = System::Drawing::Point(344, 96); this->button7->Name = S"button7"; this->button7->Size = System::Drawing::Size(40, 23); this->button7->TabIndex = 12; this->button7->Text = S"^-1"; this->button7->Click += new System::EventHandler(this, button7_Click); // // button8 // this->button8->BackColor = System::Drawing::Color::LightSkyBlue; this->button8->Location = System::Drawing::Point(416, 48); this->button8->Name = S"button8"; this->button8->Size = System::Drawing::Size(48, 23); this->button8->TabIndex = 13; this->button8->Text = S"transp"; this->button8->Click += new System::EventHandler(this, button8_Click); // // button9 // this->button9->BackColor = System::Drawing::Color::LightSkyBlue; this->button9->Location = System::Drawing::Point(416, 96); this->button9->Name = S"button9"; this->button9->Size = System::Drawing::Size(48, 23); this->button9->TabIndex = 14; this->button9->Text = S"norma"; this->button9->Click += new System::EventHandler(this, button9_Click); // // mainMenu1 //