Ejemplo n.º 1
0
void KeyFile::init() {
  KeyFileHeader header;
  readHead(header, false);
  header.checkFileVersion(getName());
  SETCONST(m_keydef, header.m_keydef, KeyFileDefinition);
  ((KeyPageInfo&)m_pageInfo).init(m_keydef.getSize());
}
Ejemplo n.º 2
0
Object Alloc_Object (int size, int type, int konst) {
    register char *p = Hp;
    Object ret;

    if (GC_Debug) {
        (void)P_Collect ();
        p = Hp;
    }
    ELK_ALIGN(p);
    if (p + size > Heap_End) {
        (void)P_Collect ();
        p = Hp;
        ELK_ALIGN(p);
        if (p + size > Heap_End - HEAP_MARGIN)
            Uncatchable_Error ("Out of heap space");
    }
    Hp = p + size;
    *(Object *)p = Null;
    SET(ret, type, p);
    if (konst)
        SETCONST(ret);
    return ret;
}
Ejemplo n.º 3
0
Archivo: lp.c Proyecto: kleptog/pyglpk
int LPX_InitType(PyObject *module) {
  int retval;
  if ((retval=util_add_type(module, &LPXType))!=0) return retval;

  // Add in constant flag terms used in this class.
  // The following macro helps set constants.
#define SETCONST(A) PyDict_SetIntString(LPXType.tp_dict, #A, GLP_ ## A)
#if GLPK_VERSION(4, 31)
  // These are used in the LPX.scale method.
  SETCONST(SF_GM);
  SETCONST(SF_EQ);
  SETCONST(SF_2N);
  SETCONST(SF_SKIP);
  SETCONST(SF_AUTO);
#endif
  // These are used in control parameters for solvers.
  SETCONST(MSG_OFF);
  SETCONST(MSG_ERR);
  SETCONST(MSG_ON);
  SETCONST(MSG_ALL);
  
  SETCONST(PRIMAL);
#if GLPK_VERSION(4, 31)
  SETCONST(DUAL);
#endif
  SETCONST(DUALP);
  
  SETCONST(PT_STD);
  SETCONST(PT_PSE);
  
  SETCONST(RT_STD);
  SETCONST(RT_HAR);

#if GLPK_VERSION(4, 20)
  SETCONST(BR_FFV);
  SETCONST(BR_LFV);
  SETCONST(BR_MFV);
  SETCONST(BR_DTH);

  SETCONST(BT_DFS);
  SETCONST(BT_BFS);
  SETCONST(BT_BLB);
  SETCONST(BT_BPH);
#endif
#if GLPK_VERSION(4, 21)
  SETCONST(PP_NONE);
  SETCONST(PP_ROOT);
  SETCONST(PP_ALL);
#endif
#undef SETCONST
  // Add in the calls to the other objects.
  if ((retval=Obj_InitType(module))!=0) return retval;
#ifdef USEPARAMS
  if ((retval=Params_InitType(module))!=0) return retval;
#endif
  if ((retval=BarCol_InitType(module))!=0) return retval;
  if ((retval=KKT_InitType(module))!=0) return retval;
#if GLPK_VERSION(4, 20)
  if ((retval=Tree_InitType(module))!=0) return retval;
#endif
  return 0;
}