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

API Reference

Raphael Sonabend edited this page Aug 8, 2019 · 8 revisions
  1. Classes and Methods
  2. S3 Methods
  3. Assertions

We use X -> Y to denote that class X inherits from class Y, we therefore only include methods and variables from the parent-class (super) unless the child-class (sub) overloads this.

NOTE: This package is very much in development. The entire API is considered experimental. The list below reflects the current state of the package not the future desired state.

Classes and Methods

SetInterval

Public Methods

  • type() - Getter .type
  • dimension() - Getter .dimension
  • max() - Returns .upper if type (] or []. Otherwise .upper - 1.1e-15
  • min() - Returns .lower if type [) or []. Otherwise .lower + 1.1e-15
  • sup() - Getter .lower
  • inf() - Getter .upper
  • print() - Prints strprint
  • strprint() - String representation of set (usually getter .setSymbol)
  • class() - Getter .class
  • liesInSetInterval(x, all = FALSE, bound = FALSE) - Tests if x lies within the setInterval, i.e. if within bounds and same class. If all returns TRUE iff all x TRUE. If !all returns a vector of logicals corresponding to each x
  • isEmpty() - Is the setInterval empty?
  • equals(x) - Tests if x is mathematically equal to self

Private Variables

  • .lower - Lower bound
  • .upper - Upper bound
  • .type - One of [], [), (), (]
  • .class - One of numeric, integer
  • .dimension - Dimension
  • .setSymbol - ASCII representation

Interval -> SetInterval

Public Methods

  • as.numeric() - If interval is of class 'integer' then converts to a numeric vector (error if infinite)
  • length() - If class 'numeric' or bounds are non-finite returns Inf otherwise length of vector after coercion
  • range() - sup - inf
  • equals(x) - x == self iff both have same sup, inf, class

Set -> SetInterval

Public Methods

  • length() - Length of set (count of elements)
  • elements() - Getter .elements
  • isEmpty() - TRUE iff length == 0
  • liesInSetInterval(x, all = FALSE, bound = NULL) - Tests if x is an element in self
  • equals(x) - Tests if sets self and x mathematically equal (==.Set)
  • strprint(n = 2) - String representation of elements in set, n determines when to truncate
  • powerSet() - Returns the power set of self
  • isSubset(x, proper = FALSE) - Tests if x is a subset (<=.Set) of x, tests if proper set if proper == TRUE (<.Set).
  • intersection(x) - Returns intersection of x and self

Private Variables

  • .class - "integer"
  • .type - "{}"
  • .elements - Elements in the set

S3 Generics and Methods

  • as.Set - as.Set.list, as.Set.matrix

Tuple -> Set

Public Methods

  • equals(x) - x == self if elements of both are identical and in same order

Private Variables

  • .type - "()"

FuzzySet -> Set

Public Methods

  • members() - Getter .members
  • isEmpty() - True iff length(members())==0
  • alphaCut(alpha, strong = FALSE) - Returns all elements with membership degree greater than alpha, greater than or equal to iff !strong
  • support() - Returns elements with a positive membership
  • core() - Returns elements with unit membership
  • inclusion(x) - Returns the inclusion degree (Not, Partially, Fully Included) of a given element x
  • equals(x) - x == self iff the same element-membership pairs are in both
  • complement(x) - Sets .members <- 1 - .members

Private Variables

  • .type - "{}"
  • .members - Ordered membership degree for each element

SpecialSet -> Set

Abstract class. All methods and variables inherited without overloading from set.

Classes inheriting from SpecialSet: Empty, Naturals, PosNaturals, Integers, PosIntegers, NegIntegers, Rationals, PosRationals, NegRationals, Reals, PosReals, NegReals, ExtendedReals, Complex

S3 Methods

  • union.SetInterval(..., dim = 1) (+.SetInterval) - Union of two or more SetIntervals
  • complement.SetInterval(x, y = NULL) (-.SetInterval) - If y = NULL then complement of x in a given universe, otherwise elements of x not found in y
  • complement.Set(x, y = NULL) (-.Set)
  • power.SetInterval(x, power) (^.SetInterval) - Raise dimension of SetInterval
  • product.SetInterval(...) (*.SetInterval) - Cartesian product of two or more SetIntervals

Assertions

  • assert/check/testSetInterval
  • assert/check/testSet
  • assert/check/testTuple
  • assert/check/testFuzzySet
  • assert/check/testInterval
  • assert/check/testBoundedAbove
  • assert/check/testBoundedBelow