This class implements the data structure and methods for fuzzy sets.
Creator for objects of class
SparseSet$new(attributes, M = NULL)
(character vector) Names of the attributes that will be available in the fuzzy set.
(numeric vector or column
Matrix) Values (grades) to be assigned to the attributes.
M is omitted, the fuzzy set is the empty set. Later, one can use the
assign method to assign grades to any of its attributes.
An object of class
Assign grades to attributes in the set
SparseSet$assign(attributes = c(), values = c(), ...)
(character vector) Names of the attributes to assign a grade to.
(numeric vector) Grades to be assigned to the previous
value pairs, where the value
value is assigned to the
key attribute name.
One can use both of:
S$assign(A = 1, B = 0.3)
S$assign(attributes = c(A, B), values = c(1, 0.3)).
Get elements by index
(numeric, logical or character vector) The indices of the elements to return. It can be a vector of logicals where
TRUE elements are to be retained.
SparseSet but with only the required elements.
Cardinal of the SparseSet
the cardinal of the
as the sum of the degrees of each element.
The internal sparse
Matrix representation of the set.
Attributes defined for the set
A character vector with the names of the attributes.
Number of attributes
The number of attributes that are defined for this fuzzy set.
Prints the set to console
A string with the elements of the set and their grades between brackets .
Write the set in LaTeX format
SparseSet$to_latex(print = TRUE)
(logical) Print to output?
The fuzzy set in LaTeX.
The objects of this class are cloneable with this method.
SparseSet$clone(deep = FALSE)
Whether to make a deep clone.
1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.