private void RateRefreshButton_Click(object sender, EventArgs e)
        {
            CVector vector = new CVector();
            OkButton.Enabled = true;
            RateRefreshButton.Enabled = false;

            vector.a = CStringUtil.SzVectorToDoubleArray(RateVectorTextBox.Text);
            m_refreshing = true;
            RateVectorTextBox.Text = vector.ConvertToString();
            m_refreshing = false;
            UpdateVectorModel();
        }
        // Class Methods
        public CVector GetCopy()
        {
            int i;
            CVector cpy = new CVector();
            cpy.m_a = new double[m_a.Length];

            for(i=0; i<columnCount; i++)
                cpy.m_a[i] = m_a[i];
            return cpy;
        }
        private void DurRefreshButton_Click(object sender, EventArgs e)
        {
            CVector v = new CVector();
            RefreshButton.Enabled = false;
            OkButton.Enabled = true;

            v.a = CStringUtil.SzVectorToDoubleArray(DurTextBox.Text);
            m_refreshing = true;
            DurTextBox.Text = v.ConvertToString();
            m_refreshing = false;


            v.a = CStringUtil.SzVectorToDoubleArray(CountVectorTextBox.Text);
            m_refreshing = true;
            CountVectorTextBox.Text = v.ConvertToString();
            m_refreshing = false;

            UpdateVectorModel();
        }
        private void RefreshButton_Click(object sender, EventArgs e)
        {
            CVector v = new CVector();
            CMatrix m = new CMatrix();
            int ccnt;
            string szTemp;

            szTemp = CStringUtil.SzForceSquareMatrixFormatDouble(BiasTextBox.Text);
            m.a = CStringUtil.SzMatrixToDouble2DArray(szTemp);
            BiasTextBox.Text = m.ConvertToStringA();
            UdateBiasMatrixModeling();

            // Make matrix m into a square matix
            m.a = CStringUtil.SzMatrixToDouble2DArray(BiasTextBox.Text);

            // Determin minimum nuber of columns
            ccnt = m.ColumnCount;
            if(ccnt < m.RowCount)
                ccnt = m.RowCount;
            v.a = CStringUtil.SzVectorToDoubleArray(ProbTurnVectorTextBox.Text);
            if(m_r.type == DIRECTIONMODELTYPE.VECTOR_DIRBIAS && v.columnCount > ccnt)
                ccnt = v.columnCount;

            while(m.RowCount > ccnt)
                m.DeleteRow(m.RowCount-1);
            while(m.RowCount < ccnt)
                m.AddRow();
            while(m.ColumnCount > ccnt)
                m.DeleteColumn(m.ColumnCount-1);
            while(m.ColumnCount < ccnt)
                m.AddColumn();
            BiasTextBox.Text = m.ConvertToStringA();
            UdateBiasMatrixModeling();



            while(v.columnCount > ccnt)
                v.DeleteColumn(v.columnCount-1);
            while(v.columnCount < ccnt)
                v.AddColumn();
            ProbTurnVectorTextBox.Text = v.ConvertToString();
            UpdateProbTurnVectorModeling();


            RefreshButton.Enabled = false;
            OkButton.Enabled = true;
        }
        private void RefreshButton_Click(object sender, EventArgs e)
        {
            int i;
            CVector v = new CVector();
            string sz;

            for(i=0; i<m_spe.BehaviorCount && i<NUM_NRML_BUTTONS; i++)
            {
                sz = CStringUtil.SzForceIntoVectorDoubleFormat(m_vectorTextBoxArray[i].Text);
                v.a = CStringUtil.SzVectorToDoubleArray(sz);
                while(v.columnCount > m_behaviorCnt+1)
                    v.DeleteColumn(v.columnCount-1);
                while(v.columnCount < m_behaviorCnt+1)
                    v.AddColumn();

                m_vectorTextBoxArray[i].Text = v.ConvertToString();
            }
            DoneButton.Enabled = true;
            RefreshButton.Enabled = false;
            UpdateVectorModel();
        }