spy_dulmage_mendelsohn
(函数来自 pyomo.contrib.incidence_analysis.visualize)
- pyomo.contrib.incidence_analysis.visualize.spy_dulmage_mendelsohn(model, *, incidence_kwds=None, order=IncidenceOrder.dulmage_mendelsohn_upper, highlight_coarse=True, highlight_fine=True, skip_wellconstrained=False, ax=None, linewidth=2, spy_kwds=None)[source]
在Matplotlib轴上以Dulmage-Mendelsohn顺序绘制稀疏结构
这是围绕Matplotlib
Axes.spy方法的一个封装,用于绘制Dulmage-Mendelsohn顺序的关联矩阵,并突出显示粗粒度和/或细粒度的分区。粗粒度分区指的是欠约束、过约束和良好约束的子系统,而细粒度分区指的是这些子系统的块对角或块三角分区。- Parameters:
模型 (
ConcreteModel) – 输入模型以绘制稀疏结构incidence_kwds (dict, optional) –
IncidenceGraphInterface的配置选项order (
IncidenceOrder, 可选) – 绘制稀疏结构的顺序。默认是IncidenceOrder.dulmage_mendelsohn_upper用于块上三角 矩阵。设置为IncidenceOrder.dulmage_mendelsohn_lower用于 块下三角矩阵。highlight_coarse (bool, optional) – 是否在粗略分区周围绘制矩形。默认值为 True
highlight_fine (bool, optional) – 是否在精细分区周围绘制矩形。默认值为 True
skip_wellconstrained (bool, optional) – 是否跳过突出显示粗分区中的良好约束子系统。默认值为 False
ax (
matplotlib.pyplot.Axes, 可选) – 用于绘图的Axes对象。如果未提供,将创建新的图形和轴。linewidth (int, optional) – 用于高亮的矩形的线宽。默认值为2
spy_kwds (dict, optional) – 用于
Axes.spy的关键字参数
- Returns:
fig (
matplotlib.pyplot.Figure或None) – 用于绘制稀疏结构的图形。如果提供了轴,则为Noneax (
matplotlib.pyplot.Axes) – 用于绘制稀疏结构的轴