, , , , , . .

 

 

!

 

:

:

 

 

 

?

StudentHelp, , MS Word. , , antiplagiat.ru, etxt.ru advego.ru. StudentHelp , Word .


:


:

: . : 11.05.2012. : 2011. : 9. antiplagiat.ru: < 30%

():


















4:














:
. . -105
..
:
..








2009
: , . , , ("" ) ( ) " " , .

: , . , . . . .bmp.

.
: , , , , , ; ; ; - , .


1982 . . , .
, , , . (, , , ), . , , ("" ) .
, . , , . , , :

, X = { xi: i=0...n-1}, n . xi +1, -1. , k- , Xk, , , xik, k=0...m-1, m . a ( "") - , , Y = Xk, Y : Y = { yi: i=0,...n-1}. , .
, , , , , , ( ) " " ( ).
:
(1)
i j , , ; xik, xjk i- j- k- .

(p ):
1. . :
yi(0) = xi , i = 0...n-1, (2)
. yi .
2.
, j=0...n-1(3)

(4)
f (), .):

.2

3. , . 2, ( ) . , .

, , ( , ) (""), .

, , :
1) . . m , 0.15n. , , , .
2) , , . , .

:

. , w.txt.
I. : , .


:
-
- ( )
- 堫- ( )
- Π
- : , , , ( ),
( ), Ļ.
:

II. : , . : . . :


, .
!:

w.txt.
II. : , :

, . :

. :

!:


:

, .
: , , , :


:
namespace Hopfild
{
public partial class Hopf_net : Form
{
sbyte[,] w;
int test; // : 1 - , 0 -
int N; //
int Nisp; // ,

public Hopf_net()
{
InitializeComponent();
}

public int[] Loadbmpd(String fname) //
{
Bitmap image = new Bitmap(fname);
int[] x = new int[N];
int k = 0; //
for (int i = 0; i < (int)Math.Sqrt(N); i++)
{
if (k == N) break;
for (int j = 0; j < (int)Math.Sqrt(N); j++)
if (image.GetPixel(i, j).ToArgb() == Color.Black.ToArgb())
x[k++] = 1;
else
x[k++] = -1;
}
return x;
}

public int[] Loadbmpd_see(String fname) //
{
Bitmap image = new Bitmap(fname);
int[] x = new int[N];
int k = 0;
for (int i = 0; i < (int)Math.Sqrt(N); i++)
{
if (k == N) break;
for (int j = 0; j < (int)Math.Sqrt(N); j++)
{
if (i < (int)Math.Sqrt(Nisp) && j < (int)Math.Sqrt(Nisp)) //,

{
if (image.GetPixel(i, j).ToArgb() == Color.Black.ToArgb())
x[k++] = 1;
else
x[k++] = -1;
}
else
{
x[k++] = -1; // ,
}
}
}
return x;
}

private void button3_Click(object sender, EventArgs e) //
{
openFileDialog1.Filter = "bmp files (*.bmp)|*.bmp|All files (*.*)|*.*";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);
}
}

public int ff(int sum) //
{
if (sum >= 0) return 1;
else return -1;
}

private void button1_Click(object sender, EventArgs e)
{
N = 10000;
test = 0;
//
int Obr; //
if (textBox1.Text == "")
{
Obr = 3; textBox1.Text = "3";
}
else int.TryParse(textBox1.Text, out Obr);

//
label2.Text = " "; //Hopf_net.ActiveForm.Refresh();
MessageBox.Show(" . .");

// 1.bmp, 2.bmp string [] filesm
string [] filesm = new string [Obr];
for (int i = 0; i < Obr; i++)
filesm[i] = Path.GetDirectoryName(Application.ExecutablePath)+"\\good\\" + i.ToString() + ".bmp";

int[][] x = new int[Obr][]; //
for (int i = 0; i < Obr; i++)
x[i] = Loadbmpd(filesm[i]);

//
FileStream stream = new FileStream(Path.GetDirectoryName(Application.ExecutablePath) + "\\w.txt", FileMode.Create, FileAccess.Write);
StreamWriter f1 = new StreamWriter(stream);
f1.WriteLine(N.ToString());
int sum;

label2.Text = " ";// Hopf_net.ActiveForm.Refresh();
MessageBox.Show(" . .");
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
sum = 0;
if (i != j)
{
for (int k = 0; k < Obr; k++)
sum += x[k][i] * x[k][j];
}
f1.WriteLine(sum.ToString());
}
}
f1.Close();
stream.Close();

x = null;
filesm = null;
System.GC.Collect();
MessageBox.Show(" !");
label2.Text = "";
}

private void button2_Click(object sender, EventArgs e)
{
//
string s; //
N = 10000; //
int kolvit = 0; //
if (textBox2.Text == "")
{
Nisp = 10000; textBox2.Text = "10000";
}
else int.TryParse(textBox2.Text, out Nisp);
label2.Text = " ";
MessageBox.Show(" . .");
if (test == 0)
{
FileStream stream = new FileStream(Path.GetDirectoryName(Application.ExecutablePath) + "\\w.txt", FileMode.Open, FileAccess.Read);
StreamReader f1 = new StreamReader(stream);

s = f1.ReadLine(); //
int.TryParse(s, out N);

w = new sbyte[N, N];
for (int k = 0; k < N; k++)
{
for (int i = 0; i < N; i++)
{
s = f1.ReadLine(); // w
sbyte.TryParse(s, out w[k, i]);
}
}
f1.Close();
stream.Close();
test = 1;
}

int[] y = new int[N]; //
int[] yo = new int[N]; //
int[] ys = new int[N] ; //

int sum = 0;
long flag = 0; //
int nn = (int)Math.Sqrt(N);
label2.Text = " ";// Hopf_net.ActiveForm.Refresh();
yo = Loadbmpd_see(openFileDialog1.FileName);

for (int j = 0; j < N; j++)
{
ys[j] = yo[j]; //
}

label2.Text = "";
MessageBox.Show(". .");
do
{
flag = 0;
for (int j = 0; j < N; j++)
{
y[j] = yo[j]; //
}

for (int j = 0; j < N; j++)
{
sum = 0;
for (int i = 0; i < N; i++)
{
sum += y[i] * w[i, j];
}
yo[j] = ff(sum);
}

for (int j = 0; j < N; j++)
{
if (y[j] != yo[j]) // , ,
flag++;
}
kolvit++;
} while (flag != 0);
if (kolvit > 3) MessageBox.Show(" !");
label6.Text = kolvit.ToString();
label2.Text = ""; //Hopf_net.ActiveForm.Refresh();

Bitmap ybmp = new Bitmap(nn, nn); //
for (int j = 0; j < nn; j++)
{
for (int i = 0; i < nn; i++)
if (yo[i + j * nn] == 1)
{
ybmp.SetPixel(j, i, Color.Black);
}
else
{
ybmp.SetPixel(j, i, Color.White);
}
}
pictureBox2.Image = Image.FromFile(openFileDialog1.FileName);
pictureBox2.Image = ybmp;

int nn1 = (int)Math.Sqrt(Nisp); //
Bitmap ybmp1 = new Bitmap(nn1, nn1);
for (int j = 0; j < nn1; j++)
{
for (int i = 0; i < nn1; i++)
if (ys[i + j * nn] == 1)
{
ybmp1.SetPixel(j, i, Color.Black);
}
else
{
ybmp1.SetPixel(j, i, Color.White);
}
}
pictureBox1.Image = ybmp1;

label2.Text = "";
MessageBox.Show(" !");
}

private void pictureBox1_Click(object sender, EventArgs e)
{
}

private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(" \n " +
"\n -105 \n" +
" \n", "Π",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}

private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void button5_Click(object sender, EventArgs e) //
{
pictureBox1.Image = null;
pictureBox2.Image = null;
}

private void label3_Click(object sender, EventArgs e)
{
}

private void label4_Click(object sender, EventArgs e)
{
}

private void button6_Click(object sender, EventArgs e) //
{
saveFileDialog1.Filter = "bmp files (*.bmp)|*.bmp|All files (*.*)|*.*";
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
pictureBox2.Image.Save(saveFileDialog1.FileName);
}
}

private void Hopf_net_Load(object sender, EventArgs e)
{
test = 0;
}
}
}



: , ; , . , .bmp. , . w.txt. .
, :
1) (""), ;
2) m , 0.15n. , , , .



..................



90% antiplagiat.ru, etxt.ru advego.ru




* . , .