• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daisytuner / sdfglib / 15612041688

12 Jun 2025 01:34PM UTC coverage: 60.871% (-0.9%) from 61.731%
15612041688

Pull #68

github

web-flow
Merge 373a5cce9 into 69c62fd72
Pull Request #68: refactors symbolic analysis into polynomials, extreme values and cnf

638 of 862 new or added lines in 24 files covered. (74.01%)

340 existing lines in 21 files now uncovered.

6571 of 10795 relevant lines covered (60.87%)

100.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.55
/src/symbolic/polynomials.cpp
1
#include "sdfg/symbolic/polynomials.h"
2

3
#include <symengine/polys/basic_conversions.h>
4

5
namespace sdfg {
6
namespace symbolic {
7

8
Polynomial polynomial(const Expression& expr, SymbolVec& symbols) {
157✔
9
    try {
10
        ExpressionSet gens;
157✔
11
        for (auto& symbol : symbols) {
315✔
12
            gens.insert(symbol);
158✔
13
        }
14
        return SymEngine::from_basic<SymEngine::MExprPoly>(expr, gens);
157✔
15
    } catch (SymEngine::SymEngineException& e) {
157✔
NEW
16
        return SymEngine::null;
×
NEW
17
    }
×
18
};
157✔
19

20
AffineCoeffs affine_coefficients(Polynomial& poly, SymbolVec& symbols) {
157✔
21
    AffineCoeffs coeffs;
157✔
22
    for (auto& symbol : symbols) {
315✔
23
        coeffs[symbol] = symbolic::zero();
158✔
24
    }
25
    coeffs[symbolic::symbol("__daisy_constant__")] = symbolic::zero();
157✔
26

27
    auto& D = poly->get_poly().get_dict();
157✔
28
    for (auto& [exponents, coeff] : D) {
1,414✔
29
        // Check if sum of exponents is <= 1
30
        symbolic::Symbol symbol = symbolic::symbol("__daisy_constant__");
314✔
31
        unsigned total_deg = 0;
314✔
32
        for (size_t i = 0; i < exponents.size(); i++) {
631✔
33
            auto& e = exponents[i];
317✔
34
            if (e > 0) {
317✔
35
                symbol = symbols[i];
158✔
36
            }
158✔
37
            total_deg += e;
317✔
38
        }
317✔
39
        if (total_deg > 1) {
314✔
40
            return {};
1✔
41
        }
42

43
        // Add coefficient to corresponding symbol
44
        coeffs[symbol] = symbolic::add(coeffs[symbol], coeff);
313✔
45
    }
314✔
46

47
    return coeffs;
156✔
48
}
157✔
49

50
}  // namespace symbolic
51
}  // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc