X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpolynomial%2Foptimal_vars_finder.cpp;h=9873004c8edd074a69f20136d926f1769af83253;hp=09b9590b07de3eb5ee97cae3a8f9040f10fccf70;hb=38129d5d3880156f6f217f94855553bf4549a960;hpb=1b8bcb068171ce9d5c8202ae3c76647b65c9a06d diff --git a/ginac/polynomial/optimal_vars_finder.cpp b/ginac/polynomial/optimal_vars_finder.cpp index 09b9590b..9873004c 100644 --- a/ginac/polynomial/optimal_vars_finder.cpp +++ b/ginac/polynomial/optimal_vars_finder.cpp @@ -3,7 +3,7 @@ * Functions to optimize the choice of variable for multivariate GCD. */ /* - * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2021 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,6 +46,11 @@ namespace { * @see get_symbol_stats */ struct sym_desc { + /** Initialize symbol, leave other variables uninitialized */ + sym_desc(const ex& s) + : sym(s), deg_a(0), deg_b(0), ldeg_a(0), ldeg_b(0), max_deg(0), max_lcnops(0) + { } + /** Reference to symbol */ ex sym; @@ -67,7 +72,7 @@ struct sym_desc /** Maximum number of terms of leading coefficient of symbol in both polynomials */ std::size_t max_lcnops; - /** Commparison operator for sorting */ + /** Comparison operator for sorting */ bool operator<(const sym_desc &x) const { if (max_deg == x.max_deg) @@ -87,9 +92,7 @@ static void add_symbol(const ex &s, sym_desc_vec &v) if (it.sym.is_equal(s)) // If it's already in there, don't add it a second time return; } - sym_desc d; - d.sym = s; - v.push_back(d); + v.push_back(sym_desc(s)); } // Collect all symbols of an expression (used internally by get_symbol_stats())