private void button4_Click(object sender, EventArgs e) { int maxColumns = 5; int numberOfColumns = 0; columnType[] matrix = new columnType[maxColumns]; for (int i = 0; i < maxColumns; ++i) { matrix[i] = new columnType(); } matrix[0].numberOfRows = 1; // pick something just to see if we can get it back matrix[0].columnName = "ABC"; // numberOfRows must be less than or equal to maxRows columnType2[] matrix2 = new columnType2[maxColumns]; for (int i = 0; i < maxColumns; ++i) { matrix2[i] = new columnType2(); } matrix2[0].numberOfRows = 1; // pick something just to see if we can get it back //uint sz = (uint)maxColumns*4; //IntPtr matrixIP = GlobalAlloc(GPTR, sz); //columnType[] matrix = matrixIP; //IntPtr pointerArr = Marshal.AllocHGlobal(maxColumns*4); //int result = getMatrixNumberOfRowsInColumnZero(maxColumns,matrix); //label1.Text = result.ToString(); numberOfColumns = getMatrix(maxColumns, maxRows, ref matrix); label1.Text = matrix[0].columnName; }
// コンストラクタ public MipProblem() { // 目的関数関係 ObjCoef = new objCoef(this); // 制約式関係 RowName = new rowName(this); RowType = new rowType(this); RowLB = new rowLb(this); RowUB = new rowUb(this); RowMatrix = new rowMatrix(this); // 変数関係 ColumnName = new columnName(this); ColumnType = new columnType(this); ColumnLB = new columnLb(this); ColumnUB = new columnUb(this); ColumnKind = new columnKind(this); LpColumnValue = new lpColumnValue(this); MipColumnValue = new mipColumnValue(this); }