Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

equal

Compare two Objects


Description

The utility function equal can be used to compare two ROI objects and is mainly used for testing purposes.

Usage

equal(x, y, ...)

## S3 method for class ''NULL''
equal(x, y, ...)

## S3 method for class 'logical'
equal(x, y, ...)

## S3 method for class 'integer'
equal(x, y, ...)

## S3 method for class 'numeric'
equal(x, y, ...)

## S3 method for class 'character'
equal(x, y, ...)

## S3 method for class 'list'
equal(x, y, ...)

## S3 method for class 'simple_triplet_matrix'
equal(x, y, ...)

## S3 method for class 'L_constraint'
equal(x, y, ...)

## S3 method for class 'Q_constraint'
equal(x, y, ...)

## S3 method for class 'V_bound'
equal(x, y, ...)

Arguments

x

an R object to be compared with object y.

y

an R object to be compared with object x.

...

optional arguments to equal.

Value

TRUE if x and y are equal FALSE otherwise.

Examples

## compare numeric values
equal(1e-4, 1e-5, tol=1e-3)
## L_constraint
lc1 <- L_constraint(diag(1), dir=c("=="), rhs=1)
lc2 <- L_constraint(diag(2), dir=c("==", "<="), rhs=1:2)
equal(lc1, lc1)
equal(lc1, lc2)

ROI

R Optimization Infrastructure

v1.0-0
GPL-3
Authors
Kurt Hornik [aut], David Meyer [aut], Florian Schwendinger [aut], Stefan Theussl [aut, cre], Diethelm Wuertz [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.