Feature for the rank-width graph decomposition

class sage.features.rankwidth.RankWidth(*args, **kwds)[source]

Bases: BuildModule

A Feature indicating whether or not the rank-width graph decomposition is available.

This is a proxy for the build-time availability of the rankwidth (librw) library from the “rw” package; the associated module sage.graphs.graph_decompositions.rankwidth is built if and only if the library is detected, usable, and enabled.

EXAMPLES:

sage: from sage.features.rankwidth import RankWidth
sage: RankWidth().is_present()  # needs rankwidth
FeatureTestResult('rankwidth', True)
sage: RankWidth().is_present()  # needs !rankwidth
FeatureTestResult('rankwidth', False)
>>> from sage.all import *
>>> from sage.features.rankwidth import RankWidth
>>> RankWidth().is_present()  # needs rankwidth
FeatureTestResult('rankwidth', True)
>>> RankWidth().is_present()  # needs !rankwidth
FeatureTestResult('rankwidth', False)
from sage.features.rankwidth import RankWidth
RankWidth().is_present()  # needs rankwidth
RankWidth().is_present()  # needs !rankwidth

A runtime check. We only check the “present” case because, if feature checks are _not_ deferred, the needs !rankwidth can be satisfied (disabled at build time) at the same time we are able to import a module that was installed for a previous build of sage:

sage: from sage.features.rankwidth import RankWidth
sage: RankWidth().is_present_at_runtime()  # needs rankwidth
FeatureTestResult('rankwidth', True)
>>> from sage.all import *
>>> from sage.features.rankwidth import RankWidth
>>> RankWidth().is_present_at_runtime()  # needs rankwidth
FeatureTestResult('rankwidth', True)
from sage.features.rankwidth import RankWidth
RankWidth().is_present_at_runtime()  # needs rankwidth
sage.features.rankwidth.all_features()[source]