File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
crates/multilinear_extensions/src/expression Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
55use super :: Expression ;
66use Expression :: * ;
77use p3:: field:: FieldAlgebra ;
8- use std:: { fmt:: Display , iter:: Sum } ;
8+ use std:: { collections :: BTreeMap , fmt:: Display , iter:: Sum } ;
99
1010impl < E : ExtensionField > Expression < E > {
1111 pub fn get_monomial_terms ( & self ) -> Vec < Term < Expression < E > , Expression < E > > > {
@@ -71,7 +71,10 @@ impl<E: ExtensionField> Expression<E> {
7171 terms
7272 . into_iter ( )
7373 . map ( |Term { scalar, product } | ( product, scalar) )
74- . into_group_map ( )
74+ . fold ( BTreeMap :: new ( ) , |mut acc, ( product, scalar) | {
75+ acc. entry ( product) . or_insert_with ( Vec :: new) . push ( scalar) ;
76+ acc
77+ } )
7578 . into_iter ( )
7679 . map ( |( product, scalar) | Term {
7780 scalar : scalar. into_iter ( ) . sum ( ) ,
You can’t perform that action at this time.
0 commit comments