Пример #1
0
 static void Main()
 {
     ML.Init();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Main());
 }
        public void TestDetectMovingDown()
        {
            Assert.IsFalse(ML.DetectMovingDown(null));

            var notD1 = new int[32] {
                -1, -1, -3, -15, -1, 1, 0, -1, -1, 1, -10, -18, 0, 0, 1, 0, 0, -1, -7, 0, 7, 0, 1, 1, 0, -1, 0, -1, 0, 0, 1, 0
            };
            var notD2 = new int[32] {
                0, 1, 1, 2, 0, -1, 0, 0, 0, 1, 18, 23, -2, -1, -1, -1, 0, 1, 7, -12, -10, -1, 0, 0, 0, -1, 1, 0, -1, -1, -1, 1
            };
            var notD3 = new int[32] {
                0, 0, 0, 1, 12, 24, 2, 1, 1, 0, 0, 3, -20, 29, 4, 1, 0, 0, -3, 3, -10, 9, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0
            };

            Assert.IsFalse(ML.DetectMovingDown(notD1));
            Assert.IsFalse(ML.DetectMovingDown(notD2));
            Assert.IsFalse(ML.DetectMovingDown(notD3));

            var movD1 = new int[32] {
                0, -1, -2, -9, 0, -1, 0, -1, -1, -2, -12, -22, 0, 0, 0, 0, 0, 0, -6, 3, 5, 1, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0
            };
            var movD2 = new int[32] {
                0, 0, 0, 1, -12, 24, 2, 1, 1, 0, 0, 3, -20, 29, 4, 1, 0, 0, -3, 3, 10, 9, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0
            };
            var movD3 = new int[32] {
                0, 1, 1, 2, 0, -1, 0, 0, 0, 1, 18, 23, -2, -1, -1, -1, 0, 1, 7, -12, -10, -1, -2, 0, 0, -1, 1, 0, -1, -1, 20, 1
            };

            Assert.IsTrue(ML.DetectMovingDown(movD1));
            Assert.IsTrue(ML.DetectMovingDown(movD2));
            Assert.IsTrue(ML.DetectMovingDown(movD3));
        }
Пример #3
0
        public void MatrixFactorization_Estimator()
        {
            string labelColumnName             = "Label";
            string matrixColumnIndexColumnName = "Col";
            string matrixRowIndexColumnName    = "Row";

            // This data contains three columns, Label, Col, and Row where Col and Row will be treated as the expected input names
            // of the trained matrix factorization model.
            var data = new TextLoader(Env, GetLoaderArgs(labelColumnName, matrixColumnIndexColumnName, matrixRowIndexColumnName))
                       .Read(new MultiFileSource(GetDataPath(TestDatasets.trivialMatrixFactorization.trainFilename)));

            // "invalidData" is not compatible to "data" because it contains columns Label, ColRenamed, and RowRenamed (no column is Col or Row).
            var invalidData = new TextLoader(Env, GetLoaderArgs(labelColumnName, matrixColumnIndexColumnName + "Renamed", matrixRowIndexColumnName + "Renamed"))
                              .Read(new MultiFileSource(GetDataPath(TestDatasets.trivialMatrixFactorization.testFilename)));

            var options = new MatrixFactorizationTrainer.Options
            {
                MatrixColumnIndexColumnName = matrixColumnIndexColumnName,
                MatrixRowIndexColumnName    = matrixRowIndexColumnName,
                LabelColumnName             = labelColumnName,
                NumIterations     = 3,
                NumThreads        = 1,
                ApproximationRank = 4,
            };

            var est = ML.Recommendation().Trainers.MatrixFactorization(options);

            TestEstimatorCore(est, data, invalidInput: invalidData);

            Done();
        }
Пример #4
0
        public void UgroupTest()
        {
            var data = new List <UngroupExample> {
                new UngroupExample {
                    Age = 18, UserName = new[] { "Amy", "Willy" }, Gender = new[] { "Girl", "Boy" }
                },
                new UngroupExample {
                    Age = 20, UserName = new[] { "Dori", "Ariel" }, Gender = new[] { "Fish", "Mermaid" }
                }
            };
            var dataView = ComponentCreation.CreateDataView(Env, data);

            var ungroupTransform = new UngroupTransform(Env, dataView, UngroupTransform.UngroupMode.Inner, "UserName", "Gender");
            var ungrouped        = ML.CreateEnumerable <GroupExample>(ungroupTransform, false).ToList();

            Assert.Equal(4, ungrouped.Count);

            Assert.Equal(18, ungrouped[0].Age);
            Assert.Equal("Amy", ungrouped[0].UserName);
            Assert.Equal("Girl", ungrouped[0].Gender);

            Assert.Equal(18, ungrouped[1].Age);
            Assert.Equal("Willy", ungrouped[1].UserName);
            Assert.Equal("Boy", ungrouped[1].Gender);

            Assert.Equal(20, ungrouped[2].Age);
            Assert.Equal("Dori", ungrouped[2].UserName);
            Assert.Equal("Fish", ungrouped[2].Gender);

            Assert.Equal(20, ungrouped[3].Age);
            Assert.Equal("Ariel", ungrouped[3].UserName);
            Assert.Equal("Mermaid", ungrouped[3].Gender);
        }
Пример #5
0
        // POST: api/Prediction
        public string Post([FromBody] byte[] data)
        {
            if (data == null)
            {
                return(null);
            }

            using var stream = new MemoryStream(data);
            var image = Image.FromStream(stream);

            if (image == null)
            {
                return(null);
            }

            //ml processing

            image.Save("path");

            var model = ML.model("path");

            model.run();

            return(JsonConvert.SerializeObject(data));
        }
Пример #6
0
        public ActionResult DeleteConfirmed(int id)
        {
            ML mL = db.MLs.Find(id);

            db.MLs.Remove(mL);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #7
0
 public Main()
 {
     InitializeComponent();
     mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
     AllowDrop    = true;
     ML.Logger   += Log;
     ML.Init();
 }
Пример #8
0
        protected override Parser.Result Evaluate(string data, ref int from)
        {
            var list = Utils.GetFunctionArgs(data, ref from, ParaCnt);

            uint.TryParse(list[0], out uint arg1);
            ML.ER_SetErr((ei)arg1);
            Interpreter.Instance.AppendOutput("Error_Set(" + arg1.ToString() + ")");
            return(new Parser.Result());
        }
Пример #9
0
        protected override Parser.Result Evaluate(string data, ref int from)
        {
            var list = Utils.GetFunctionArgs(data, ref from, ParaCnt);

            uint.TryParse(list[0], out uint arg1);
            bool bRet = ML.MT_GetHomeDone((mi)arg1);

            Interpreter.Instance.AppendOutput("Motor_CheckHome(" + arg1.ToString() + ") = " + bRet.ToString());
            return(new Parser.Result(bRet == true ? 1 : 0, null, null));
        }
Пример #10
0
 public ActionResult Edit([Bind(Include = "UserID,DogID,Age,Gender,FirstName,Breed")] ML mL)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mL).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mL));
 }
Пример #11
0
        protected override Parser.Result Evaluate(string data, ref int from)
        {
            var list = Utils.GetFunctionArgs(data, ref from, ParaCnt);

            uint.TryParse(list[0], out uint arg1);
            uint.TryParse(list[1], out uint arg2);
            bool bRet = ML.CL_Complete((ci)arg1, (fb)arg2);

            Interpreter.Instance.AppendOutput("Cylinder_CheckStop(" + arg1.ToString() + "," + arg2.ToString() + ") = " + bRet.ToString());
            return(new Parser.Result(bRet == true ? 1 : 0, null, null));
        }
        public void ViewDetails()

        {
            //Populate the Excel Sheet
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ManageListings");
            Thread.Sleep(2000);
            //page Refresh
            Global.GlobalDefinitions.driver.Navigate().Refresh();
            ML.Click();
            Thread.Sleep(4000);

            while (true)

            {
                var j = 1;

                while (j <= 10)

                {
                    // identify 2nd row of table. Then extact the text and assign to a variable
                    var Category1 = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table/tbody/tr[" + j + "]/td[2]")).Text;
                    var ViewBtn   = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table/tbody/tr[" + j + "]/td[8]/i[1]"));
                    //compare the text with the expected text. "Graphics & Design"

                    if (Category1 == (Global.GlobalDefinitions.ExcelLib.ReadData(2, "Category1")))

                    {
                        //Clickin on View Button
                        ViewBtn.Click();
                        break;
                    }
                    j++;
                }
                var btnNext = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div/button[4]"));
                btnNext.Click();
            }

            //Validation for View Button
            var Text = (Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-detail-section']/div[3]/div/div[1]/div/div/div/a[1]")).Text);

            Assert.AreEqual("Graphics & Design ", Text);
            Console.WriteLine(" user can see the details");
            Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, " can view the details");

            //string text = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-detail-section']/div[2]/div/div[2]/div[1]/div[1]/div[2]/h1/span")).Text;

            //			if (text == "QA")
            //			{
            //				Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, " can view the details");
            //			}
            //			else
            //			Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, " can't see the details");
        }
Пример #13
0
        protected override Parser.Result Evaluate(string data, ref int from)
        {
            var list = Utils.GetFunctionArgs(data, ref from, ParaCnt);

            uint.TryParse(list[0], out uint arg1);
            if (!Constants.CHECK)
            {
                ML.MT_GoHome((mi)arg1);
            }
            Interpreter.Instance.AppendOutput("Motor_Home(" + arg1.ToString() + ")");
            return(new Parser.Result());
        }
Пример #14
0
        protected override Parser.Result Evaluate(string data, ref int from)
        {
            var list = Utils.GetFunctionArgs(data, ref from, ParaCnt);

            uint.TryParse(list[0], out uint arg1);
            uint.TryParse(list[1], out uint arg2);
            if (!Constants.CHECK)
            {
                ML.CL_Move((ci)arg1, (fb)arg2);
            }
            Interpreter.Instance.AppendOutput("Cylinder_Move(" + arg1.ToString() + "," + arg2.ToString() + ")");
            return(new Parser.Result());
        }
Пример #15
0
        protected override Parser.Result Evaluate(string data, ref int from)
        {
            var list = Utils.GetFunctionArgs(data, ref from, ParaCnt);

            uint.TryParse(list[0], out uint arg1);
            double.TryParse(list[1], out double arg2);
            if (!Constants.CHECK)
            {
                ML.MT_GoAbsRun(arg1, arg2);
            }
            Interpreter.Instance.AppendOutput("MoveMotr(" + arg1.ToString() + ", " + arg2.ToString() + ")");
            return(new Parser.Result());
        }
Пример #16
0
        public void WordTokenizeWorkout()
        {
            var data = new[] { new TestClass()
                               {
                                   A = "This is a good sentence.", B = new string[2] {
                                       "Much words", "Wow So Cool"
                                   }
                               } };
            var dataView    = ML.Data.ReadFromEnumerable(data);
            var invalidData = new[] { new TestWrong()
                                      {
                                          A = 1, B = new float[2] {
                                              2, 3
                                          }
                                      } };
            var invalidDataView = ML.Data.ReadFromEnumerable(invalidData);
            var pipe            = new WordTokenizingEstimator(Env, new[] {
                new WordTokenizingEstimator.ColumnInfo("TokenizeA", "A"),
                new WordTokenizingEstimator.ColumnInfo("TokenizeB", "B"),
            });

            TestEstimatorCore(pipe, dataView, invalidInput: invalidDataView);

            // Reuse the pipe trained on dataView in TestEstimatorCore to make prediction.
            var result = pipe.Fit(dataView).Transform(dataView);

            // Extract the transformed result of the first row (the only row we have because data contains only one TestClass) as a native class.
            var nativeResult = ML.CreateEnumerable <NativeResult>(result, false).First();

            // Check the tokenization of A. Expected result is { "This", "is", "a", "good", "sentence." }.
            var tokenizeA = new[] { "This", "is", "a", "good", "sentence." };

            Assert.True(tokenizeA.Length == nativeResult.TokenizeA.Length);
            for (int i = 0; i < tokenizeA.Length; ++i)
            {
                Assert.Equal(tokenizeA[i], nativeResult.TokenizeA[i]);
            }

            // Check the tokenization of B. Expected result is { "Much", "words", "Wow", "So", "Cool" }. One may think that the expected output
            // should be a 2-D array { { "Much", "words"}, { "Wow", "So", "Cool" } }, but please note that ML.NET may flatten all outputs if
            // they are high-dimension tensors.
            var tokenizeB = new[] { "Much", "words", "Wow", "So", "Cool" };

            Assert.True(tokenizeB.Length == nativeResult.TokenizeB.Length);
            for (int i = 0; i < tokenizeB.Length; ++i)
            {
                Assert.Equal(tokenizeB[i], nativeResult.TokenizeB[i]);
            }

            Done();
        }
Пример #17
0
        // GET: MLs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("MyAccount", "Users"));
            }
            ML mL = db.MLs.Find(id);

            if (mL == null)
            {
                return(HttpNotFound());
            }
            return(View(mL));
        }
Пример #18
0
        void DoCopyTree(ref TPredicateItemBig ABig, ref TDynamicArray AStack)
        {
            int m_who;
            TAlternativeParserItemList ML;
            TAlternativeParserItemBase mBase;
            TAlternativeParserItemTFS  mTFS;
            TAlternativeParserItemBig  mBig;
            TPredicateItemTFE          mTFE;
            TAlternativeParserItemBig  mRfc = ABig.Rfc;

            ML = mRfc.MainList;
            for (int i = 0; i <= ML.Count - 1; i++)
            {
                mBase = ML.GetItems(i);
                m_who = mBase.Who();
                if (m_who == 0)
                {
                    mTFS = (TAlternativeParserItemTFS)(mBase);
                    TPredicateItemTFS iTfs = new TPredicateItemTFS();
                    iTfs.Assign(mTFS);
                    ABig.AddItem(iTfs);
                    for (int j = 0; j <= iTfs.TFECount - 1; j++)
                    {
                        mTFE = iTfs.GetTFEItems(j);
                        if (mTFE.RfcTFE.Big != null)
                        {
                            TPredicateItemBig iBig = NewBig(mTFE.RfcTFE.Big);
                            mTFE.Big = iBig;
                            AStack.InsertToFirst(iBig);
                        }
                    }
                }
                if (m_who == 1)
                {
                    mBig = (TAlternativeParserItemBig)(mBase);
                    TPredicateItemBig iBig = NewBig(mBig);
                    ABig.AddItem(iBig);
                    AStack.InsertToFirst(iBig);
                }
            }

            for (int i = 0; i <= mRfc.CountBig - 1; i++)
            {
                mBig = mRfc.GetItemsBig(i);
                TPredicateItemBig iBig = NewBig(mBig);
                ABig.AddItem(iBig);
                AStack.InsertToFirst(iBig);
            }
        }
Пример #19
0
        public void TestTextPredictAndSet()
        {
            var intention = new ML <MyTextRow, bool>();

            IEnumerable <MyTextRow> data = GetTextData();
            var msg = "Parking is terrible";

            var result = intention.Using(MLType.TextFeaturizingEstimator)
                         .LearnFrom(data)
                         .PredictAndSet(new MyTextRow {
                Text = msg
            });

            Assert.IsTrue(result.Label);
        }
Пример #20
0
        public ActionResult Create(int UserID, int DogID, Double Age, DogGender?Gender, string FirstName, String Breed)
        {
            ML mL = new ML();

            mL.UserID    = UserID;
            mL.DogID     = DogID;
            mL.Age       = Age;
            mL.Gender    = Gender;
            mL.FirstName = FirstName;
            mL.Breed     = Breed;

            db.MLs.Add(mL);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #21
0
        public void TestLinearPredictWithOutput()
        {
            var intention = new ML <MyLinearRow, float>();

            IEnumerable <MyLinearRow> data = GetFloatData();

            var result = intention.Using(MLType.LightGbm)
                         .WhereScoreIs("Score")
                         .LearnFrom(data)
                         .PredictWithOutput(new MyLinearRow {
                Val1 = 1, Val2 = 0, Val3 = 0
            });

            Assert.IsTrue(result.Score > 0.75);
        }
Пример #22
0
        private void RestoreSavedNote()
        {
            IEnumerable <NoteNode> noteslist = ML.RetrieveNotes(null);

            if (noteslist.Count() > 0)
            {
                foreach (var note in noteslist)
                {
                    note.IsSaved = true;
                    TrVwNotesList.Nodes.Add(note);
                }
                TrVwNotesList.SelectedNode = TrVwNotesList.Nodes?[0];
                TxtTitle.Text = (TrVwNotesList.SelectedNode as NoteNode)?.Title;
                RTxtDesc.Text = (TrVwNotesList.SelectedNode as NoteNode)?.Desc;
            }
        }
Пример #23
0
        public void CacheTest()
        {
            var src  = Enumerable.Range(0, 100).Select(c => new MyData()).ToArray();
            var data = ML.CreateDataView(src);

            data.GetColumn <float[]>(ML, "Features").ToArray();
            data.GetColumn <float[]>(ML, "Features").ToArray();
            Assert.True(src.All(x => x.AccessCount == 2));

            src  = Enumerable.Range(0, 100).Select(c => new MyData()).ToArray();
            data = ML.CreateDataView(src);
            data = ML.Data.Cache(data);
            data.GetColumn <float[]>(ML, "Features").ToArray();
            data.GetColumn <float[]>(ML, "Features").ToArray();
            Assert.True(src.All(x => x.AccessCount == 1));
        }
 public void Reset()
 {
     code[0] = dout.Addres;
     if (code[1] == 0x10)
     {
         for (int a = 8; a < code.Length; a += 2)
         {
             code[a] = 0;
         }
     }
     else
     {
         code[5] = 0;
     }
     ML.Interrupt(code);
 }
Пример #25
0
        public void GroupTest()
        {
            var data = new List <GroupExample> {
                new GroupExample {
                    Age = 18, UserName = "******", Gender = "Girl"
                },
                new GroupExample {
                    Age = 18, UserName = "******", Gender = "Boy"
                },
                new GroupExample {
                    Age = 20, UserName = "******", Gender = "Fish"
                },
                new GroupExample {
                    Age = 20, UserName = "******", Gender = "Mermaid"
                }
            };
            var dataView = ComponentCreation.CreateDataView(Env, data);

            var groupTransform = new GroupTransform(Env, dataView, "Age", "UserName", "Gender");
            var grouped        = ML.CreateEnumerable <UngroupExample>(groupTransform, false).ToList();

            // Expected content of grouped should contains two rows.
            // Age, UserName, Gender
            // 18,  {"Amy", "Willy"}, {"Girl", "Boy"}
            // 20,  {"Dori", "Ariel"}, {"Fish", "Mermaid"}
            // Note that "Age, UserName, Gender" is not a row; it just shows column names per row below it.
            Assert.Equal(2, grouped.Count);

            // grouped[0] is the first output row --- 18,  {"Amy", "Willy"}, {"Girl", "Boy"}
            Assert.Equal(18, grouped[0].Age);
            Assert.Equal(2, grouped[0].UserName.Length);
            Assert.Equal("Amy", grouped[0].UserName[0]);
            Assert.Equal("Willy", grouped[0].UserName[1]);
            Assert.Equal(2, grouped[0].Gender.Length);
            Assert.Equal("Girl", grouped[0].Gender[0]);
            Assert.Equal("Boy", grouped[0].Gender[1]);

            // grouped[1] is the second output row --- 20,  {"Dori", "Ariel"}, {"Fish", "Mermaid"}
            Assert.Equal(20, grouped[1].Age);
            Assert.Equal(2, grouped[1].Gender.Length);
            Assert.Equal("Dori", grouped[1].UserName[0]);
            Assert.Equal("Ariel", grouped[1].UserName[1]);
            Assert.Equal(2, grouped[1].Gender.Length);
            Assert.Equal("Fish", grouped[1].Gender[0]);
            Assert.Equal("Mermaid", grouped[1].Gender[1]);
        }
Пример #26
0
 private void StartCamera()
 {
     ML.OnFrameResult += result =>
     {
         if (Disposing || !Visible)
         {
             return;
         }
         Invoke(new MethodInvoker(delegate
         {
             CurrentParrot   = result.ParrotCount;
             CurrentRabbit   = result.RabbitCount;
             CurrentSergeant = result.SergeantCount;
         }));
     };
     ML.StartFile(imageBoxFrameGrabber1, imageBoxFrameGrabber2, file);
 }
Пример #27
0
 public void Run()
 {
     lock (Lab3.locker)
     {
         Matrix MF = new Matrix(N);
         Matrix MG = new Matrix(N);
         Matrix MH = new Matrix(N);
         Matrix ML;
         MF.MatrixFillsOne(1);
         MG.MatrixFillsOne(1);
         MH.MatrixFillsOne(1);
         Console.WriteLine("F2 started.");
         ML = MF.sum(MG.multiply(MH));
         Console.WriteLine("ML = \n" + ML.toString());
         Console.WriteLine("Function 2 end.");
     }
 }
Пример #28
0
        private void CtrlDHandler()
        {
            NoteNode note = TrVwNotesList.SelectedNode as NoteNode;

            if (note?.IsSaved ?? false)
            {
                if (ML.DeleteNoteNode(note))
                {
                    TxtTitle.Text = RTxtDesc.Text = string.Empty;

                    note.IsSaved = false;
                    TrVwNotesList.Nodes.Remove(note);
                }
                else
                {
                    MessageBox.Show("failed deletion");
                }
            }
        }
Пример #29
0
    void NextGenome()
    {
        Random.InitState((int)69);
        GameObject[] carts = GameObject.FindGameObjectsWithTag("Cart");
        foreach (GameObject cart in carts)
        {
            Destroy(cart);
        }
        bool new_gene = false;

        Debug.Log("Next Genome!");
        genome++;
        if (genome == MAX_GENOMES)
        {
            new_gene = true;
            generation++;
            genome = 0;
        }
        GameObject[] tunnels = GameObject.FindGameObjectsWithTag("Tunnel");
        foreach (GameObject tunnel in tunnels)
        {
            Spawner spawner = tunnel.GetComponentInChildren <Spawner>();
            if (spawner != null)
            {
                spawner.NewRound();
            }
        }

        GameObject[] intersections = GameObject.FindGameObjectsWithTag("Intersection");
        foreach (GameObject intersection in intersections)
        {
            ML ml = intersection.GetComponent <ML> ();
            if (ml != null)
            {
                ml.cost = 0;
                if (new_gene == true)
                {
                    ml.NewGeneration();
                }
            }
        }
        new_gene = false;
    }
Пример #30
0
        private void CtrlEHandler()
        {
            NoteNode note = TrVwNotesList.SelectedNode as NoteNode;

            if (note?.IsSaved ?? false)
            {
                if (ML.DeleteNoteNode(note))
                {
                    TxtTitle.Enabled = RTxtDesc.Enabled = true;
                    note.IsSaved     = false;
                    note.ForeColor   = Color.Yellow;
                    note.BackColor   = Color.Red;
                }
                else
                {
                    MessageBox.Show("failed deletion");
                }
            }
        }
Пример #31
0
		//------------------------------------------------------------------------
		// currection method
		//------------------------------------------------------------------------




		public ML.LineSegment3 CorrectionLineSegment(MonoDrop srcDrop , ML.LineSegment3 lineSeg3)
		{
			if (null == srcDrop)
				return lineSeg3;

			//Correction value
			//PairInt parameter is array index(0 start , 1 is not ).
			//Index2 startPos = PairInt.Start_C5_R0;
			Vector3 putPos_left_up = m_boardInfo.GetPositionAt_ViewLeftUp () + Single.UIRoot.transform.position;
			Vector3 putPos_right_up = m_boardInfo.GetPositionAt_ViewRightUp () + Single.UIRoot.transform.position;
			Vector3 putPos_left_bottom = m_boardInfo.GetPositionAt_ViewLeftBottom () + Single.UIRoot.transform.position;
			Vector3 putPos_right_bottom = m_boardInfo.GetPositionAt_ViewRightBottom () + Single.UIRoot.transform.position;

			//Vector3 putPos_left_up = GetPositionOfPutDrop (new PairInt (0, 0));
			//Vector3 putPos_right_up = GetPositionOfPutDrop (new PairInt (0, (int)ConstBoard.Max_Row-1));
			//Vector3 putPos_left_bottom = GetPositionOfPutDrop (new PairInt ((int)ConstBoard.Max_Column-1, 0));
			//Vector3 putPos_right_bottom = GetPositionOfPutDrop (new PairInt ((int)ConstBoard.Max_Column-1, (int)ConstBoard.Max_Row-1));

#if UNITY_EDITOR
			//-------------------------------------------------------------------------
			//20140906 chamto test
			//-------------------------------------------------------------------------
			Single.MonoDebug.cube_LeftUp.transform.position = putPos_left_up;
			Single.MonoDebug.cube_RightUp.transform.position = putPos_right_up;
			Single.MonoDebug.cube_LeftBottom.transform.position = putPos_left_bottom;
			Single.MonoDebug.cube_RightBottom.transform.position = putPos_right_bottom;
			//-------------------------------------------------------------------------
#endif

			Bounds bob = m_boardInfo.GetBoundaryOfView (Single.UIRoot.transform.position);
			ML.LineSegment3 result = new ML.LineSegment3();
			result.origin = srcDrop.gotoWorldPosition;
			result.last = lineSeg3.last;



			//CDefine.DebugLog ("Bounds " + bob + bob.min + bob.max);
			if (lineSeg3.last.y >= bob.max.y) 
			{	//------------- correction up -------------
				//CDefine.DebugLog("----correction up");
				result.last_y = putPos_left_up.y;
				if(lineSeg3.last.x <= bob.min.x)
				{	//correction left-up
					result.last = putPos_left_up;
					//CDefine.DebugLog("----correction left up" + putPos_left_up);
				}
				if(lineSeg3.last.x >= bob.max.x)
				{	//correction right-up
					result.last = putPos_right_up;
					//CDefine.DebugLog("----correction right up");
				}

			}else
				if (lineSeg3.last.y <= bob.min.y) 
			{	////------------- correction bottom -------------
				//CDefine.DebugLog("----correction bottom");
				result.last_y = putPos_left_bottom.y;
				if(lineSeg3.last.x <= bob.min.x)
				{	//correction left-bottom
					result.last = putPos_left_bottom;
					//CDefine.DebugLog("----correction left bottom"+putPos_left_bottom);
				}
				if(lineSeg3.last.x >= bob.max.x)
				{	//correction right-bottom
					result.last = putPos_right_bottom;
					//CDefine.DebugLog("----correction right bottom");
				}

			}else
				if(lineSeg3.last.x <= bob.min.x)
			{	////------------- correction left -------------
				result.last_x = putPos_left_up.x;
				//CDefine.DebugLog("----correction left");
			}else
				if(lineSeg3.last.x >= bob.max.x)
			{	////------------- correction right -------------
				result.last_x = putPos_right_up.x;
				//CDefine.DebugLog("----correction right");
			}else 
			{
				////------------- correction is not required
				//CDefine.DebugLog("----correction is not required");
				return lineSeg3;
			}

			//CDefine.DebugLog ("Correction LineSegement : " + result);
			return result;
		}
 public override void Compute(ML.Data.IMLData input, double[] output)
 {
     if(input is ML.Data.Basic.BasicMLData)
         Compute(((ML.Data.Basic.BasicMLData)input).Data, output);
     else
     {
         // TODO: make this more efficient
         var tmp = new double[input.Count];
         input.CopyTo(tmp, 0, input.Count);
         Compute(tmp, output);
     }
 }