Learn R Programming

ompr (version 1.0.4)

nconstraints: Number of variables (rows) of the model

Description

Number of variables (rows) of the model

Usage

nconstraints(model)

Value

An integer equal to the number of variables. A variable is here a column in the resulting constraint matrix.

Arguments

model

the model

Examples

Run this code
library(magrittr)
model <- MIPModel() %>%
  add_variable(x) %>%
  add_variable(y[i], i = 1:10)
nconstraints(model) # 11

Run the code above in your browser using DataLab