예제 #1
0
        private static AllSequences smethod2(CodeFile codeFile, int int2)
        {
            int[]        hashes       = codeFile.Hashes;
            int[]        hashes2      = codeFile.Hashes;
            AllSequences allSequences = new AllSequences();
            AllSequences result;

            if (hashes.Length == 0)
            {
                result = allSequences;
            }
            else
            {
                int[] array  = new int[hashes2.Length];
                int[] array2 = new int[hashes2.Length];

                for (int i = 0; i < hashes.Length; i++)
                {
                    for (int j = i; j < hashes2.Length; j++)
                    {
                        if (i != j)
                        {
                            if (hashes[i] != hashes2[j])
                            {
                                array2[j] = 0;
                            }
                            else
                            {
                                if (i == 0 || j == 0)
                                {
                                    array2[j] = 1;
                                }
                                else
                                {
                                    array2[j] = 1 + array[j - 1];
                                }

                                if (array2[j] > int2)
                                {
                                    allSequences.AddCoordToAppropriateSequence(new Coord
                                    {
                                        I    = i,
                                        J    = j,
                                        Size = array2[j]
                                    });
                                }
                            }
                        }
                    }

                    int[] array3 = array;
                    array  = array2;
                    array2 = array3;
                }

                result = allSequences;
            }

            return(result);
        }
예제 #2
0
		private static AllSequences smethod2(CodeFile codeFile, int int2)
		{
			int[] hashes = codeFile.Hashes;
			int[] hashes2 = codeFile.Hashes;
			AllSequences allSequences = new AllSequences();
			AllSequences result;

			if (hashes.Length == 0)
			{
				result = allSequences;
			}
			else
			{
				int[] array = new int[hashes2.Length];
				int[] array2 = new int[hashes2.Length];

				for (int i = 0; i < hashes.Length; i++)
				{
					for (int j = i; j < hashes2.Length; j++)
					{
						if (i != j)
						{
							if (hashes[i] != hashes2[j])
							{
								array2[j] = 0;
							}
							else
							{
								if (i == 0 || j == 0)
								{
									array2[j] = 1;
								}
								else
								{
									array2[j] = 1 + array[j - 1];
								}

								if (array2[j] > int2)
								{
									allSequences.AddCoordToAppropriateSequence(new Coord
									{
										I = i,
										J = j,
										Size = array2[j]
									});
								}
							}
						}
					}

					int[] array3 = array;
					array = array2;
					array2 = array3;
				}

				result = allSequences;
			}

			return result;
		}
예제 #3
0
		internal static AllSequences smethod1(CodeFile codeFile1, CodeFile codeFile2, int int2)
		{
			AllSequences result;

			if (codeFile1 == codeFile2)
			{
				result = Analysis.smethod2(codeFile1, int2);
			}
			else
			{
				int[] hashes = codeFile1.Hashes;
				int[] hashes2 = codeFile2.Hashes;
				AllSequences allSequences = new AllSequences();

				if (hashes.Intersect(hashes2).Count<int>() == 0)
				{
					Analysis.int0++;
					result = allSequences;
				}
				else if (hashes.Length == 0 || hashes2.Length == 0)
				{
					result = allSequences;
				}
				else
				{
					int[] array = new int[hashes2.Length];
					int[] array2 = new int[hashes2.Length];

					for (int i = 0; i < hashes.Length; i++)
					{
						for (int j = 0; j < hashes2.Length; j++)
						{
							if (hashes[i] != hashes2[j])
							{
								array2[j] = 0;
							}
							else
							{
								if (i == 0 || j == 0)
								{
									array2[j] = 1;
								}
								else
								{
									array2[j] = 1 + array[j - 1];
								}

								if (array2[j] > int2)
								{
									allSequences.AddCoordToAppropriateSequence(new Coord
									{
										I = i,
										J = j,
										Size = array2[j]
									});
								}
							}
						}

						int[] array3 = array;
						array = array2;
						array2 = array3;
					}

					result = allSequences;
				}
			}

			return result;
		}
예제 #4
0
        internal static AllSequences smethod_1(CodeFile codeFile_0, CodeFile codeFile_1, int int_2)
        {
            AllSequences result;

            if (codeFile_0 == codeFile_1)
            {
                result = Analysis.smethod_2(codeFile_0, int_2);
            }
            else
            {
                int[]        hashes       = codeFile_0.Hashes;
                int[]        hashes2      = codeFile_1.Hashes;
                AllSequences allSequences = new AllSequences();
                if (hashes.Intersect(hashes2).Count <int>() == 0)
                {
                    Analysis.int_0++;
                    result = allSequences;
                }
                else if (hashes.Length == 0 || hashes2.Length == 0)
                {
                    result = allSequences;
                }
                else
                {
                    int[] array  = new int[hashes2.Length];
                    int[] array2 = new int[hashes2.Length];
                    for (int i = 0; i < hashes.Length; i++)
                    {
                        for (int j = 0; j < hashes2.Length; j++)
                        {
                            if (hashes[i] != hashes2[j])
                            {
                                array2[j] = 0;
                            }
                            else
                            {
                                if (i == 0 || j == 0)
                                {
                                    array2[j] = 1;
                                }
                                else
                                {
                                    array2[j] = 1 + array[j - 1];
                                }
                                if (array2[j] > int_2)
                                {
                                    allSequences.AddCoordToAppropriateSequence(new Coord
                                    {
                                        I    = i,
                                        J    = j,
                                        Size = array2[j]
                                    });
                                }
                            }
                        }
                        int[] array3 = array;
                        array  = array2;
                        array2 = array3;
                    }
                    result = allSequences;
                }
            }
            return(result);
        }