Esempio n. 1
0
        public Mat22 MulT(Mat22 m)
        {
            Vec2 c1 = new Vec2(Col1.Dot(m.Col1), Col2.Dot(m.Col1));
            Vec2 c2 = new Vec2(Col1.Dot(m.Col2), Col2.Dot(m.Col2));

            return(new Mat22(c1, c2));
        }
Esempio n. 2
0
        /// <summary>
        /// Fetches the cols as array.
        /// </summary>
        /// <returns></returns>
        public string[] FetchColsAsArray()
        {
            string[] result = new string[TotalCols];

            if (Col1 == null)
            {
                Col1 = string.Empty;
            }

            if (Col2 == null)
            {
                Col2 = string.Empty;
            }

            if (Col3 == null)
            {
                Col3 = string.Empty;
            }


            result[0] = Col1.Replace("\\\\", "\\");
            result[1] = Col2.Replace("\\\\", "\\");
            result[2] = Col3.Replace("\\\\", "\\");


            return(result);
        }
Esempio n. 3
0
        public override int GetHashCode()
        {
            int hashCode = -1473066521;

            hashCode = hashCode * -1521134295 + Col1.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Col2);

            hashCode = hashCode * -1521134295 + Col3.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Col4);

            return(hashCode);
        }
Esempio n. 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Col1 != null ? Col1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Col2 != null ? Col2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Col3 != null ? Col3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Cols1 != null ? Cols1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Cols2 != null ? Cols2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Cols3 != null ? Cols3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)EvaluationFn;
         return(hashCode);
     }
 }
Esempio n. 5
0
        public int CompareTo(Test3 other)
        {
            int ret = Col1.CompareTo(other.Col1);

            if (ret == 0)
            {
                ret = string.Compare(Col2, Col2, StringComparison.OrdinalIgnoreCase);
                if (ret == 0)
                {
                    ret = Col3.CompareTo(other.Col3);
                }
            }
            return(ret);
        }
Esempio n. 6
0
        private void HalconWin_HMouseMove(object sender, HMouseEventArgs e)
        {
            HTuple Window = new HTuple();

            Window = HalconWin.HalconWindow;
            HTuple Row1, Col1, Button;

            try
            {
                HOperatorSet.GetMposition(Window, out Row1, out Col1, out Button);
                StatusLblX.Text = Col1.ToString();
                StatusLblY.Text = Row1.ToString();
            }
            catch
            {
            }
        }
Esempio n. 7
0
        private void UpdateRect(object sender, ElapsedEventArgs e)
        {
            Application.Current.Dispatcher.Invoke(
                delegate {
                var mousePos = FormsControl.MousePosition;

                _cropRegion.X2 = mousePos.X;
                _cropRegion.Y2 = mousePos.Y;

                Row0.SetValue(RowDefinition.HeightProperty, new GridLength(_cropRegion.TopLeft.Y + TopLeftOffset, GridUnitType.Pixel));
                Row1.SetValue(RowDefinition.HeightProperty, new GridLength(_cropRegion.BottomRight.Y - _cropRegion.TopLeft.Y, GridUnitType.Pixel));
                Row2.SetValue(RowDefinition.HeightProperty, new GridLength(1, GridUnitType.Star));
                Col0.SetValue(ColumnDefinition.WidthProperty, new GridLength(_cropRegion.TopLeft.X + TopLeftOffset, GridUnitType.Pixel));
                Col1.SetValue(ColumnDefinition.WidthProperty, new GridLength(_cropRegion.BottomRight.X - _cropRegion.TopLeft.X, GridUnitType.Pixel));
                Col2.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Star));
            }
                );
        }
Esempio n. 8
0
        public Class1()
        {
            /*создаем коллекуцию*/
            List <account_базаданныхсайта> Col1 = new List <account_базаданныхсайта>();

            Col1 x1 = new Col1("Skogen", "TrineHjerbb");
            Col1 x2 = new Col1("kristian", "KristianBerg");

            Col1.Add(x1);
            Col2.Add(x2);

            /*Linq*/
            string x = x.Where(a => (a.name == "Skogen") && (a.x == "TrineHjerbb")).Count();

            Console.WriteLine(x);

            x = (from a in x where ((a.name == "Skogen") && (a.x == "TrineHjerbb")) select a).Count();
            Console.WriteLine(x);
        }
Esempio n. 9
0
        public SummaryForm()
        {
            InitializeComponent();
            if (Form1.S.dataGridView1.DataSource != null)
            {
                int Col1, Col2;
                int temp;
                int selectedCellCount = Form1.S.dataGridView1.GetCellCount(DataGridViewElementStates.Selected);
                Col1 = Form1.S.dataGridView1.CurrentRow.Cells.IndexOf(Form1.S.dataGridView1.CurrentCell) + 1;
                Col2 = Form1.S.dataGridView1.SelectedCells[selectedCellCount - 1].ColumnIndex + 1;
                if (Col1 > Col2)
                {
                    temp = Col1;
                    Col1 = Col2;
                    Col2 = temp;
                }
                textBox_StartCol.Text = Col1.ToString();
                textBox_EndCol.Text   = Col2.ToString();
                //此处+1是为了调整为用户所看到的列数
            }
            int n;

            if (textBox_EndCol.Text.Trim() == "*")
            {
                n = 0;
            }
            else
            {
                n = Convert.ToInt32(textBox_StartCol.Text);
            }
            label_Var1.Text = Form1.S.dataGridView1.Columns[n - 1].HeaderCell.Value.ToString();
            if (textBox_EndCol.Text.Trim() == "*")
            {
                n = Form1.S.dataGridView1.ColumnCount;
            }
            else
            {
                n = Convert.ToInt32(textBox_EndCol.Text);
            }
            label_Var2.Text = Form1.S.dataGridView1.Columns[n - 1].HeaderCell.Value.ToString();
        }
Esempio n. 10
0
        /// <summary>
        /// Set section title and build field list columns
        /// </summary>
        /// <param name="section"></param>
        public void BuildSection(EformSection section)
        {
            SectionTitle.Text = section.Title;
            ShowTitle.Checked = section.ShowTitle;

            // if section is grid, all fields in col 1
            if (section.IsGrid)
            {
                Col1.BuildSectionFields(section.Fields.AsEnumerable(), false, true);
            }
            // otherwise fill fields in columns
            else
            {
                // get a list of fields for columns
                IEnumerable <EformField> col1 = GetFields(section, 0);
                IEnumerable <EformField> col2 = GetFields(section, 1);

                // bind field lists
                Col1.BuildSectionFields(col1, false, section.IsGrid);
                Col2.BuildSectionFields(col2, false, section.IsGrid);
            }
        }
Esempio n. 11
0
 public override int GetHashCode()
 {
     return(Col1.GetHashCode() ^ Col2.GetHashCode() ^ Dx1.GetHashCode()
            ^ Dx2.GetHashCode() ^ Dy1.GetHashCode() ^ Dy2.GetHashCode()
            ^ Row1.GetHashCode() ^ Row2.GetHashCode() ^ AnchorType.GetHashCode());
 }
Esempio n. 12
0
 /// <summary>
 /// Get the hashcode
 /// </summary>
 /// <returns>Hashcode for the object instance</returns>
 public override int GetHashCode()
 {
     return(unchecked (Col0.GetHashCode() + Col1.GetHashCode() + Col2.GetHashCode()));
 }
Esempio n. 13
0
 /// <summary>
 /// Set this matrix to all zeros.
 /// </summary>
 public void SetZero()
 {
     Col1.SetZero();
     Col2.SetZero();
     Col3.SetZero();
 }