Ignore:
Timestamp:
Sep 16, 2016, 7:16:51 PM (3 years ago)
Author:
cameron
Message:

Support for enumeration basis sets

Location:
icGREP/icgrep-devel/icgrep/UCD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.cpp

    r4818 r5158  
    7171}
    7272
     73std::vector<UnicodeSet *> EnumeratedPropertyObject::GetEnumerationBasisSets() {
     74    // Basis set i is the set of all codepoints whose numerical enumeration code e
     75    // has bit i set, i.e., (e >> i) & 1 == 1.
     76    unsigned basis_count = 1;
     77    while ((1 << basis_count) < independent_enum_limit) basis_count++;
     78    std::vector<UnicodeSet *> basis_set;
     79    for (unsigned i == 0; i < basis_count; i++) {
     80        basis_set.push_back(new UnicodeSet());
     81        for (unsigned e = 0; e < independent_enum_limit; e++) {
     82            if (((e >> i) & 1) == 0) {
     83                basis_set[i] = basis_set[i] + property_value_sets[e];
     84            }
     85        }
     86    }
     87};
     88
     89   
     90   
    7391PropertyObject::iterator ExtensionPropertyObject::begin() const {
    7492    if (const auto * obj = dyn_cast<EnumeratedPropertyObject>(property_object_table[base_property])) {
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.h

    r4818 r5158  
    8888    const UnicodeSet & GetCodepointSet(const std::string & value_spec);
    8989    const UnicodeSet & GetCodepointSet(const int property_enum_val) const;
     90    std::vector<UnicodeSet *> GetEnumerationBasisSets();
    9091    const std::string & GetValueEnumName(const int property_enum_val) const {return property_value_enum_names[property_enum_val]; }
    9192    const std::string & GetValueFullName(const int property_enum_val) const {return property_value_full_names[property_enum_val]; }
Note: See TracChangeset for help on using the changeset viewer.