zsolve: Solve a linear system over the integers

View source: R/zsolve.R

zsolveR Documentation

Solve a linear system over the integers

Description

zsolve runs 4ti2's zsolve program to compute the configuration matrix A corresponding to graphical statistical models given by a simplicial complex and levels on the nodes.

Usage

zsolve(
  mat,
  rel,
  rhs,
  sign,
  lat,
  lb,
  ub,
  dir = tempdir(),
  quiet = TRUE,
  shell = FALSE,
  ...
)

Arguments

mat

The A matrix (see the 4ti2 documentation or examples)

rel

A vector of "<" or ">" relations

rhs

The right hand side b

sign

The signs of the individual

lat

A lattice basis (instead of a matrix)

lb

Lower bounds on columns

ub

Upper bounds on columns

dir

Directory to place the files in, without an ending /

quiet

If FALSE, messages the 4ti2 output

shell

Messages the shell code used to do the computation

...

Additional arguments to pass to the function

Value

The configuration matrix of the model provided

Examples


if (has_4ti2()) {

mat <- rbind(
  c( 1, -1),
  c(-3,  1),
  c( 1,  1)
)
rel <- c("<", "<", ">")
rhs <- c(2, 1, 1)
sign <- c(0, 1)

zsolve(mat, rel, rhs, sign)
zsolve(mat, rel, rhs, sign, quiet = FALSE)
zsolve(mat, rel, rhs, sign, shell = TRUE)

zsolve(mat, rel, rhs, sign, p = "gmp", quiet = FALSE)

}



dkahle/latter documentation built on March 22, 2023, 9:05 p.m.