Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael committed May 18, 2020
1 parent 7452ccc commit 0a3b1e5
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 13 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: set6
Title: R6 Mathematical Sets Interface
Version: 0.1.3.9000
Version: 0.1.4
Authors@R:
c(person(given = "Raphael",
family = "Sonabend",
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ S3method(as.Set,FuzzySet)
S3method(as.Set,Interval)
S3method(as.Set,Set)
S3method(as.Set,data.frame)
S3method(as.Set,default)
S3method(as.Set,list)
S3method(as.Set,matrix)
S3method(as.Set,numeric)
S3method(as.Tuple,ConditionalSet)
S3method(as.Tuple,FuzzySet)
S3method(as.Tuple,Interval)
S3method(as.Tuple,Set)
S3method(as.Tuple,data.frame)
S3method(as.Tuple,default)
S3method(as.Tuple,list)
S3method(as.Tuple,matrix)
S3method(as.Tuple,numeric)
S3method(as.character,Set)
S3method(as.double,Set)
S3method(setcomplement,ComplementSet)
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# set6 0.1.3.9000
# set6 0.1.4

* Speed performance improvements for `$contains` method for `Interval` and `Set`. `Rcpp` now used for `Interval`.
* Now for any `Interval` if not bounded above and `upper` is $Inf$ then `max = .Machine$double.xmax`, analogously for `lower`.
* Default universe of `Interval` is now `ExtendedReals`
* Added default `as.Set` and `as.Interval` S3 methods

# set6 0.1.3

Expand Down
1 change: 1 addition & 0 deletions R/Set_Interval.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Interval <- R6Class("Interval", inherit = Set,
#' c(Tuple$new(2,1), Tuple$new(1,7), 2) %inset% s2
contains = function(x, all = FALSE, bound = FALSE){
x = suppressWarnings(as(unlist(x), "numeric"))
x[is.na(x)] = NaN
if (is.null(x)) {
return(TRUE)
} else {
Expand Down
5 changes: 3 additions & 2 deletions R/asSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#' @templateVar class1 Set
#' @templateVar class2 Tuple
#' @details
#' * `as.Set.default` - Creates a [Set] using the object as the elements.
#' * `as.Set.list` - Creates a [Set] for each element in `list`.
#' * `as.Set.matrix/as.Set.data.frame` - Creates a [Set] for each column in `matrix/data.frame`.
#' * `as.Set.FuzzySet` - Creates a [Set] from the support of the [FuzzySet].
Expand All @@ -12,7 +13,7 @@ as.Set <- function(object){
}
#' @rdname as.Set
#' @export
as.Set.numeric <- function(object){
as.Set.default <- function(object){
Set$new(elements = object)
}
#' @rdname as.Set
Expand Down Expand Up @@ -63,7 +64,7 @@ as.Tuple <- function(object){
}
#' @rdname as.Set
#' @export
as.Tuple.numeric <- function(object){
as.Tuple.default <- function(object){
Tuple$new(elements = object)
}
#' @rdname as.Set
Expand Down
2 changes: 1 addition & 1 deletion R/operation_cleaner.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ operation_cleaner <- function(sets, operation_class, nest, simplify = TRUE){
# try converting all intervals to sets
if(any(sapply(sets[interval], function(x) x$properties$countability == "uncountable"))) {
sets[set] = lapply(sets[set], function(el){
return(ifnerror(as.Interval(el), error = el))
suppressWarnings(return(ifnerror(as.Interval(el), error = el)))
})
return(sets)
}
Expand Down
2 changes: 1 addition & 1 deletion man/Interval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/as.Set.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/set6-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions set6.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace

0 comments on commit 0a3b1e5

Please sign in to comment.