Scippy

    SCIP

    Solving Constraint Integer Programs

    pattern.h File Reference

    Detailed Description

    pattern data for ringpacking problem

    Author
    Benjamin Mueller

    Definition in file pattern.h.

    #include "scip/scip.h"

    Go to the source code of this file.

    Data Structures

    struct  SCIP_Pattern
     

    Typedefs

    typedef enum SCIP_Packable SCIP_PACKABLE
     
    typedef enum SCIP_Patterntype SCIP_PATTERNTYPE
     
    typedef struct SCIP_Pattern SCIP_PATTERN
     

    Enumerations

    enum  SCIP_Packable {
      SCIP_PACKABLE_NO = 0 ,
      SCIP_PACKABLE_YES = 1 ,
      SCIP_PACKABLE_UNKNOWN = 2
    }
     
    enum  SCIP_Patterntype {
      SCIP_PATTERNTYPE_CIRCULAR = 0 ,
      SCIP_PATTERNTYPE_RECTANGULAR = 1
    }
     

    Functions

    SCIP_RETCODE SCIPpatternCreateCircular (SCIP *scip, SCIP_PATTERN **pattern, int type)
     
    SCIP_RETCODE SCIPpatternCreateRectangular (SCIP *scip, SCIP_PATTERN **pattern)
     
    void SCIPpatternCapture (SCIP_PATTERN *pattern)
     
    void SCIPpatternRelease (SCIP *scip, SCIP_PATTERN **pattern)
     
    SCIP_RETCODE SCIPpatternCopy (SCIP *scip, SCIP_PATTERN *pattern, SCIP_PATTERN **copy)
     
    SCIP_RETCODE SCIPpatternAddElement (SCIP_PATTERN *pattern, int type, SCIP_Real x, SCIP_Real y)
     
    void SCIPpatternRemoveLastElements (SCIP_PATTERN *pattern, int k)
     
    int SCIPpatternGetNElemens (SCIP_PATTERN *pattern)
     
    int SCIPpatternGetElementType (SCIP_PATTERN *pattern, int i)
     
    int SCIPpatternCountElements (SCIP_PATTERN *pattern, int type)
     
    SCIP_Real SCIPpatternGetElementPosX (SCIP_PATTERN *pattern, int elem)
     
    SCIP_Real SCIPpatternGetElementPosY (SCIP_PATTERN *pattern, int elem)
     
    void SCIPpatternSetElementPos (SCIP_PATTERN *pattern, int elem, SCIP_Real x, SCIP_Real y)
     
    SCIP_PATTERNTYPE SCIPpatternGetPatternType (SCIP_PATTERN *pattern)
     
    int SCIPpatternGetCircleType (SCIP_PATTERN *pattern)
     
    void SCIPpatternSetType (SCIP_PATTERN *pattern, int type)
     
    SCIP_PACKABLE SCIPpatternGetPackableStatus (SCIP_PATTERN *pattern)
     
    void SCIPpatternSetPackableStatus (SCIP_PATTERN *pattern, SCIP_PACKABLE packable)
     

    Typedef Documentation

    ◆ SCIP_PACKABLE

    Definition at line 47 of file pattern.h.

    ◆ SCIP_PATTERNTYPE

    Definition at line 54 of file pattern.h.

    ◆ SCIP_PATTERN

    typedef struct SCIP_Pattern SCIP_PATTERN

    Definition at line 69 of file pattern.h.

    Enumeration Type Documentation

    ◆ SCIP_Packable

    Enumerator
    SCIP_PACKABLE_NO 

    pattern is definitely packable

    SCIP_PACKABLE_YES 

    pattern is definitely not packable

    SCIP_PACKABLE_UNKNOWN 

    it is unknown whether pattern is packable

    Definition at line 41 of file pattern.h.

    ◆ SCIP_Patterntype

    Enumerator
    SCIP_PATTERNTYPE_CIRCULAR 

    circular pattern

    SCIP_PATTERNTYPE_RECTANGULAR 

    rectangular pattern

    Definition at line 49 of file pattern.h.

    Function Documentation

    ◆ SCIPpatternCreateCircular()

    SCIP_RETCODE SCIPpatternCreateCircular ( SCIP scip,
    SCIP_PATTERN **  pattern,
    int  type 
    )

    creates an empty circular pattern

    Parameters
    scipSCIP data structure
    patternpointer to store pattern
    typecircle type (not needed for rectangular patterns)

    Definition at line 97 of file pattern.c.

    References createPattern(), and SCIP_PATTERNTYPE_CIRCULAR.

    Referenced by SCIPprobdataEnumeratePatterns().

    ◆ SCIPpatternCreateRectangular()

    SCIP_RETCODE SCIPpatternCreateRectangular ( SCIP scip,
    SCIP_PATTERN **  pattern 
    )

    creates an empty rectangular pattern

    Parameters
    scipSCIP data structure
    patternpointer to store pattern

    Definition at line 107 of file pattern.c.

    References createPattern(), and SCIP_PATTERNTYPE_RECTANGULAR.

    Referenced by addVariable(), and setupProblem().

    ◆ SCIPpatternCapture()

    void SCIPpatternCapture ( SCIP_PATTERN pattern)

    captures a pattern

    Parameters
    patternpattern

    Definition at line 116 of file pattern.c.

    References SCIP_Pattern::nlocks, and NULL.

    Referenced by createPattern(), and probdataCreate().

    ◆ SCIPpatternRelease()

    void SCIPpatternRelease ( SCIP scip,
    SCIP_PATTERN **  pattern 
    )
    Parameters
    scipSCIP data structure
    patternpointer to free pattern

    Definition at line 126 of file pattern.c.

    References NULL, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.

    Referenced by addVariable(), filterPatterns(), probdataFree(), SCIPprobdataEnumeratePatterns(), and setupProblem().

    ◆ SCIPpatternCopy()

    SCIP_RETCODE SCIPpatternCopy ( SCIP scip,
    SCIP_PATTERN pattern,
    SCIP_PATTERN **  copy 
    )

    copies a pattern

    Parameters
    scipSCIP data structure
    patternpattern to copy
    copypointer to store the copy

    Definition at line 152 of file pattern.c.

    References createPattern(), ensureElemSize(), SCIP_Pattern::nelems, NULL, SCIP_Pattern::packable, SCIP_Pattern::patterntype, SCIP_CALL, SCIP_OKAY, SCIPpatternAddElement(), SCIP_Pattern::type, SCIP_Pattern::types, SCIP_Pattern::xs, and SCIP_Pattern::ys.

    Referenced by SCIPprobdataAddVar().

    ◆ SCIPpatternAddElement()

    SCIP_RETCODE SCIPpatternAddElement ( SCIP_PATTERN pattern,
    int  type,
    SCIP_Real  x,
    SCIP_Real  y 
    )

    adds an element of a given type to a pattern; packable status does not change

    Parameters
    patternpattern
    typeelement of a given type
    xx-coordinate (SCIP_INVALID: unknown)
    yy-coordinate (SCIP_INVALID: unknown)

    Definition at line 182 of file pattern.c.

    References ensureElemSize(), SCIP_Pattern::nelems, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Pattern::types, x, SCIP_Pattern::xs, y, and SCIP_Pattern::ys.

    Referenced by addVariable(), enumeratePatterns(), SCIPpatternCopy(), and setupProblem().

    ◆ SCIPpatternRemoveLastElements()

    void SCIPpatternRemoveLastElements ( SCIP_PATTERN pattern,
    int  k 
    )

    removes the last k elements

    Parameters
    patternpattern
    knumber of elements to remove

    Definition at line 203 of file pattern.c.

    References SCIP_Pattern::nelems, and NULL.

    Referenced by enumeratePatterns().

    ◆ SCIPpatternGetNElemens()

    int SCIPpatternGetNElemens ( SCIP_PATTERN pattern)

    returns the total number of elements of a given type in the pattern

    returns the total number of elements

    Parameters
    patternpattern

    Definition at line 215 of file pattern.c.

    References SCIP_Pattern::nelems, and NULL.

    Referenced by createPatternVars(), enumeratePatterns(), isPatternDominating(), SCIP_DECL_EVENTEXEC(), SCIPcheckPattern(), SCIPverifyCircularPatternHeuristic(), and SCIPverifyCircularPatternNLP().

    ◆ SCIPpatternGetElementType()

    int SCIPpatternGetElementType ( SCIP_PATTERN pattern,
    int  i 
    )

    returns the type of the i-th element

    Parameters
    patternpattern
    iindex

    Definition at line 225 of file pattern.c.

    References NULL, and SCIP_Pattern::types.

    Referenced by createPatternVars(), enumeratePatterns(), isPatternDominating(), SCIP_DECL_EVENTEXEC(), SCIPcheckPattern(), SCIPverifyCircularPatternHeuristic(), and SCIPverifyCircularPatternNLP().

    ◆ SCIPpatternCountElements()

    int SCIPpatternCountElements ( SCIP_PATTERN pattern,
    int  type 
    )

    returns the total number of elements of a given type

    Parameters
    patternpattern
    typetype

    Definition at line 237 of file pattern.c.

    References SCIP_Pattern::nelems, NULL, and SCIP_Pattern::types.

    Referenced by setupProblem().

    ◆ SCIPpatternGetElementPosX()

    SCIP_Real SCIPpatternGetElementPosX ( SCIP_PATTERN pattern,
    int  elem 
    )

    returns the x-coordinate of an element

    Parameters
    patternpattern
    elemindex of the element

    Definition at line 257 of file pattern.c.

    References NULL, and SCIP_Pattern::xs.

    Referenced by SCIP_DECL_EVENTEXEC(), and SCIPcheckPattern().

    ◆ SCIPpatternGetElementPosY()

    SCIP_Real SCIPpatternGetElementPosY ( SCIP_PATTERN pattern,
    int  elem 
    )

    returns the y-coordinate of an element

    Parameters
    patternpattern
    elemindex of the element

    Definition at line 269 of file pattern.c.

    References NULL, and SCIP_Pattern::ys.

    Referenced by SCIP_DECL_EVENTEXEC(), and SCIPcheckPattern().

    ◆ SCIPpatternSetElementPos()

    void SCIPpatternSetElementPos ( SCIP_PATTERN pattern,
    int  elem,
    SCIP_Real  x,
    SCIP_Real  y 
    )

    sets the (x,y) position of an element

    Parameters
    patternpattern
    elemindex of the element
    xx-coordinate
    yy-coordinate

    Definition at line 281 of file pattern.c.

    References NULL, x, SCIP_Pattern::xs, y, and SCIP_Pattern::ys.

    Referenced by SCIPverifyCircularPatternHeuristic(), and SCIPverifyCircularPatternNLP().

    ◆ SCIPpatternGetPatternType()

    SCIP_PATTERNTYPE SCIPpatternGetPatternType ( SCIP_PATTERN pattern)

    returns the type of a pattern

    Parameters
    patternpattern

    Definition at line 296 of file pattern.c.

    References NULL, and SCIP_Pattern::patterntype.

    Referenced by SCIPcheckPattern(), SCIPprobdataAddVar(), SCIPverifyCircularPatternHeuristic(), SCIPverifyCircularPatternNLP(), setupProblem(), and verifyCircularPattern().

    ◆ SCIPpatternGetCircleType()

    int SCIPpatternGetCircleType ( SCIP_PATTERN pattern)

    returns the type of the boundary circle

    Note
    this function can only be called for circular patterns
    Parameters
    patternpattern

    Definition at line 309 of file pattern.c.

    References NULL, SCIP_Pattern::patterntype, SCIP_PATTERNTYPE_CIRCULAR, and SCIP_Pattern::type.

    Referenced by createPatternVars(), enumeratePatterns(), isPatternDominating(), SCIP_DECL_EVENTEXEC(), SCIPcheckPattern(), SCIPverifyCircularPatternHeuristic(), SCIPverifyCircularPatternNLP(), and setupProblem().

    ◆ SCIPpatternSetType()

    void SCIPpatternSetType ( SCIP_PATTERN pattern,
    int  type 
    )

    sets the type of the boundary circle

    Note
    this function can only be called for circular patterns
    Parameters
    patternpattern
    typetype

    Definition at line 323 of file pattern.c.

    References NULL, SCIP_Pattern::patterntype, SCIP_PATTERNTYPE_CIRCULAR, and SCIP_Pattern::type.

    Referenced by SCIPprobdataEnumeratePatterns().

    ◆ SCIPpatternGetPackableStatus()

    ◆ SCIPpatternSetPackableStatus()

    void SCIPpatternSetPackableStatus ( SCIP_PATTERN pattern,
    SCIP_PACKABLE  packable 
    )

    sets the packable status of a pattern

    Parameters
    patternpattern
    packablepackable status

    Definition at line 345 of file pattern.c.

    References NULL, and SCIP_Pattern::packable.

    Referenced by addVariable(), enumeratePatterns(), SCIPverifyCircularPatternHeuristic(), SCIPverifyCircularPatternNLP(), and setupProblem().