Skip to contents

Get or set a Variable's sample_bounds – a (low, high) region used to draw random initial points in best_of NLP solves (psolve(prob, nlp = TRUE, best_of = n)). When set, it overrides the variable's value during random initialization; when NULL (the default) finite variable bounds are used instead. Supply a pair c(low, high) (scalars broadcast to the variable shape) or a list(low, high) of per-entry vectors; set NULL to clear.

Usage

sample_bounds(x, ...)

sample_bounds(x) <- value

Arguments

x

A Variable.

...

Not used.

value

A (low, high) pair, or NULL to clear.

Value

sample_bounds(x) returns the stored list(low, high) or NULL; the setter returns the modified variable.