application: common

This artificial application gathers functionality shared by many "real" applications. While most users can probably do without looking into this you may find some useful functions here.


User Functions

  •  
  •  
    binomial ()
    UNDOCUMENTED
  •  
    find_permutation ()
    UNDOCUMENTED
  •  
    permutation_cycles ()
    UNDOCUMENTED
  •  
    permutation_matrix ()
    UNDOCUMENTED
  •  
  •  
    cast <Target> (object) → Object

    Change the type of the polymake object: only downcast (to a derived type) and upcast (to an ancestor type) are allowed.

    Type Parameters
    Target
    the desired new type
    Parameters
    Object object
    to be modified
    Returns
    Object
    the same object, but with modified type
  •  
    convert_to ()

    convert to different scalar type if needed

  •  
    convert_to ()

    Convert to different element type if needed.

  •  
    dense ()

    UNDOCUMENTED

  •  
    dense ()

    UNDOCUMENTED

  •  
    dense (v)

    Convert to an equivalent dense vector of the same element type

    Parameters
    SparseVector v
  •  
    dense (m)

    Convert to an equivalent dense matrix of the same element type

    Parameters
    SparseMatrix m
  •  
    dense (m)

    Convert to a dense 0/1 matrix

    Parameters
    IncidenceMatrix m
  •  
    dense (s, dim)

    Convert to a dense 0/1 vector of a given dimension

    Parameters
    Set s
    Int dim
  •  
    toMatrix ()
    UNDOCUMENTED
  •  
    toVector ()
    UNDOCUMENTED
  •  
    vector2col ()
    UNDOCUMENTED
  •  
    vector2row ()
    UNDOCUMENTED
  •  
  •  
    rows_labeled (data, row_labels, elem_labels) → Array<String>

    Prepares a matrix for printing, prepends each row with a label and a colon.

    Parameters
    Matrix data
    to be printed
    Array<String> row_labels
    labels for the rows
    Array<String> elem_labels
    optional labels for elements; if data is an IncidenceMatrix, Array<Set>, or similar, each element will be replaced by its label.
    Returns
    Array<String>
    each string ending with end-of-line
  •  
    rows_labeled (graph, elem_labels)

    Like above, but specialized for Graphs (defined for convenience: a PTL Graph is not a container)

    Parameters
    Graph graph
    to be printed
    Array<String> elem_labels
    labels for the elements
  •  
    rows_numbered (data)

    Equivalent to rows_labeled with omitted row_labels argument. Formerly called "numbered".

    Parameters
    Matrix data
    to be printed
  •  
  •  
    adjacency_matrix ()
    UNDOCUMENTED
  •  
    edges ()
    UNDOCUMENTED
  •  
    induced_subgraph ()
    UNDOCUMENTED
  •  
    nodes ()
    UNDOCUMENTED
  •  
    node_edge_incidences (graph)
    UNDOCUMENTED
    Parameters
    directed graph
    node-edge incidence matrix of an undirected graph
  •  
  •  
    anti_diag ()
    UNDOCUMENTED
  •  
  •  
    basis ()
    UNDOCUMENTED
  •  
    basis_affine ()
    UNDOCUMENTED
  •  
    basis_cols ()
    UNDOCUMENTED
  •  
    basis_rows ()
    UNDOCUMENTED
  •  
    det ()
    UNDOCUMENTED
  •  
    diag ()
    UNDOCUMENTED
  •  
    diag ()
  •  
    equal_bases ()

    Check whether both matrices are bases of the same linear subspace.

  •  
    inv ()
    UNDOCUMENTED
  •  
    lineality_space ()
    UNDOCUMENTED
  •  
    lin_solve ()
    UNDOCUMENTED
  •  
    normalized ()
    UNDOCUMENTED
  •  
    null_space ()
    UNDOCUMENTED
  •  
  •  
    ones_vector <Element> (d)

    Creates a vector with all elements equal to 1.

    Type Parameters
    Element
    type of the vector elements, defaults to Rational.
    Parameters
    Int d
    vector dimension. If omitted, a vector of dimension 0 is created, which can adjust itself when involved in a block matrix operation.
  •  
    rank ()
    UNDOCUMENTED
  •  
    reduce ()
    UNDOCUMENTED
  •  
    totally_unimodular ()
    UNDOCUMENTED
  •  
    transpose ()
    UNDOCUMENTED
  •  
  •  
    unit_matrix ()
    UNDOCUMENTED
  •  
    unit_vector ()
    UNDOCUMENTED
  •  
    zero_vector <Element> (d)

    Creates a vector with all elements equal to zero.

    Type Parameters
    Element
    type of the vector elements, defaults to Rational.
    Parameters
    Int d
    vector dimension. If omitted, a vector of dimension 0 is created, which can adjust itself when involved in a block matrix operation.
  •  
  •  
    incl ()
    UNDOCUMENTED
  •  
    range ()
    UNDOCUMENTED
  •  
    scalar2set ()
    UNDOCUMENTED
  •  
    select_subset ()
    UNDOCUMENTED
  •  
    sequence ()
    UNDOCUMENTED
  •  
  •  
    average (array)

    Returns the average value of the array elements.

    Parameters
    Array array
  •  
    bounding_box (m) → Matrix

    Compute a column-wise bounding box for the give matrix

    Parameters
    Matrix m
    Returns
    Matrix
    : row(0) contains lower bounds, row(1) contains upper bounds
  •  
    fibonacci (m)

    Returns the first m Fibonacci numbers.

    Parameters
    Int m
  •  
    histogram (data) → Map<Element, Int>

    Produce a histogram of a container: each different element value is mapped on the number of its occurences.

    Parameters
    Container<Element> data
    Returns
    Map<Element, Int>
  •  
    maximum (array)

    Returns the maximal element of an array.

    Parameters
    Array array
  •  
    minimum (array)

    Returns the minimal element of an array.

    Parameters
    Array array
  •  
  •  
    compose (vis_obj ...) → Visual::Container

    Create a composite drawing of several objects.

    Parameters
    Visual::Object vis_obj ...
    objects to be drawn together
    Options
    String Title
    name of the whole drawing; per default the name of the first Object is taken.
    any decorations
    to be applied to all components as default values.
    Returns
    Visual::Container
    if called in void context, immediately starts the preferred rendering program.
  •  
    compose (vis_container, vis_obj ...) → Visual::Container

    Add new objects to a composite drawing.

    Parameters
    Visual::Container vis_container
    drawing produced by some visualization function
    Visual::Object vis_obj ...
    objects to be added
    Options
    String Title
    new name for the drawing
    any decorations
    to be applied to all components as default values.
    Returns
    Visual::Container
    if called in void context, immediately starts the preferred rendering program.
  •  
    javaview (vis_obj ...)

    Run JavaView with the given visual objects.

    Parameters
    Visual::Object vis_obj ...
    objects to display
    Options
    String File
    "filename" or "AUTO" Store the object description in a JVX file without starting the interactive GUI. The .jvx suffix is automatically added to the file name.
    Specify AUTO if you want the filename be automatically derived from the drawing title.
    You can also use any expression allowed for the open function, including "-" for terminal output, "&HANDLE" for an already opened file handle, or "| program" for a pipe.
  •  
    jreality (vis_obj ...)

    Run jReality to display given visual objects.

    Parameters
    Visual::Object vis_obj ...
    objects to display
    Options
    String File
    "filename" or "AUTO" Store the object description in a bean shell source file without starting the interactive GUI. The .bsh suffix is automatically added to the file name.
    Specify AUTO if you want the filename be automatically derived from the drawing title.
    You can also use any expression allowed for the open function, including "-" for terminal output, "&HANDLE" for an already opened file handle, or "| program" for a pipe.
  •  
    postscript (vis_obj ...)

    Create a Postscript (tm) drawing with the given visual objects.

    Parameters
    Visual::Object vis_obj ...
    objects to draw
    Options
    String File
    "filename" or "AUTO" Store the drawing in a file without starting the viewer. The .ps suffix is automatically added to the file name.
    Specify AUTO if you want the filename be automatically derived from the drawing title.
    You can also use any expression allowed for the open function, including "-" for terminal output, "&HANDLE" for an already opened file handle, or "| program" for a pipe.
  •  
    static (vis_obj) → Visual::Object

    Suppress creation of dynamic (interactive) scenes.

    Parameters
    Visual::Object vis_obj
    drawing, e.g. created by VISUAL_GRAPH or SCHLEGEL.
    Returns
    Visual::Object
    if called in void context, immediately starts the preferred rendering program.
  • Property Types

    Common Option Lists