Array {rminizinc}R Documentation

create an array

Description

Create an array in MiniZinc

Super class

rminizinc::Expression -> Array

Public fields

.exprVec

vector of value expressions

.dims

vector of dimension expressions

.delete_flag

used to delete items

Active bindings

.exprVec

vector of value expressions

.dims

vector of dimension expressions

.delete_flag

used to delete items

Methods

Public methods

Inherited methods

Method new()

constructor for an int literal

Usage
Array$new(exprVec, dimranges = NULL)
Arguments
exprVec

list of expressions in the array

dimranges

list of min and max index of each dimension


Method ndims()

get the number of dimensions

Usage
Array$ndims()

Method getMinIndex()

get the minimum index of dimension i

Usage
Array$getMinIndex(i)
Arguments
i

ith dimension


Method getMaxIndex()

get the maximum index of dimension i

Usage
Array$getMaxIndex(i)
Arguments
i

ith dimension


Method setMinIndex()

set the minimum index of dimension i

Usage
Array$setMinIndex(i, minIndex)
Arguments
i

dimension number

minIndex

integer for min index


Method setMaxIndex()

set the maximum index of dimension i

Usage
Array$setMaxIndex(i, maxIndex)
Arguments
i

dimension number

maxIndex

integer for max index


Method getVal()

get the ith element from vector

Usage
Array$getVal(i)
Arguments
i

index


Method setVal()

set the ith element from vector

Usage
Array$setVal(i, val)
Arguments
i

index

val

value of expression to be set


Method c_str()

return the MiniZinc representation

Usage
Array$c_str()

Method getDeleteFlag()

delete flag for internal use

Usage
Array$getDeleteFlag()

Method delete()

delete the assignment item

Usage
Array$delete()

Method clone()

The objects of this class are cloneable with this method.

Usage
Array$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

newArray = Array$new(exprVec = c(Int$new(1), Int$new(2)))
newArray$c_str()

[Package rminizinc version 0.0.8 Index]