修复 Arc::make_mut 遗留问题

增加 基础数据对比方法
This commit is contained in:
YuWuKunCheng
2026-06-05 16:35:31 +08:00
parent 823a24d364
commit e33b1f0744
17 changed files with 1809 additions and 24 deletions
+46
View File
@@ -316,6 +316,52 @@ impl 线段特征 {
}
}
/// 结构化相等校验 — 逐项递归校验基础序列中的虚线,返回 (是否相等, 差异描述)
pub fn (&self, other: &Self, : f64) -> (bool, String) {
if self. != other. {
return (
false,
format!("线段特征: [序号] 不等 A={},B={}", self., other.),
);
}
if *self..read().unwrap() != *other..read().unwrap() {
return (
false,
format!(
"线段特征: [标识] 不等 A={},B={}",
self..read().unwrap(),
other..read().unwrap()
),
);
}
if self.线 != other.线 {
return (
false,
format!(
"线段特征: [线段方向] 不等 A={},B={}",
self.线, other.线
),
);
}
if self..len() != other..len() {
return (
false,
format!(
"线段特征: [基础序列] 长度不一致 A={},B={}",
self..len(),
other..len()
),
);
}
for (idx, (a, b)) in self..iter().zip(other..iter()).enumerate() {
let (eq, msg) = a.(b, );
if !eq {
return (false, format!("线段特征: 基础序列[{idx}]虚线异常 >> {msg}"));
}
}
(true, "线段特征: 全部字段一致".into())
}
}
impl crate::types::fractal:: for 线 {