Improves MultiVectorClass::is_scalar().
This commit is contained in:
parent
d73b6a253c
commit
c806f94dc1
2 changed files with 2 additions and 2 deletions
|
|
@ -147,7 +147,7 @@ impl MultiVectorClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_scalar(&self) -> bool {
|
pub fn is_scalar(&self) -> bool {
|
||||||
self.flat_basis() == vec![BasisElement { scalar: 1, index: 0 }]
|
self.grouped_basis == vec![vec![BasisElement::from_index(0)]]
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn signature(&self) -> Vec<BasisElementIndex> {
|
pub fn signature(&self) -> Vec<BasisElementIndex> {
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
for (parameter_b, pair_trait_implementations) in pair_trait_implementations.values() {
|
for (parameter_b, pair_trait_implementations) in pair_trait_implementations.values() {
|
||||||
if let Some(geometric_product) = pair_trait_implementations.get("GeometricProduct") {
|
if let Some(geometric_product) = pair_trait_implementations.get("GeometricProduct") {
|
||||||
if parameter_b.multi_vector_class().grouped_basis == vec![vec![BasisElement::from_index(0)]] {
|
if parameter_b.data_type.is_scalar() {
|
||||||
let scale = MultiVectorClass::derive_scale("Scale", geometric_product, ¶meter_a, parameter_b);
|
let scale = MultiVectorClass::derive_scale("Scale", geometric_product, ¶meter_a, parameter_b);
|
||||||
emitter.emit(&scale).unwrap();
|
emitter.emit(&scale).unwrap();
|
||||||
if let Some(magnitude) = single_trait_implementations.get("Magnitude") {
|
if let Some(magnitude) = single_trait_implementations.get("Magnitude") {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue