3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
z3/lib/polynomial_factorization.h
Leonardo de Moura e9eab22e5c Z3 sources
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-02 11:35:25 -07:00

66 lines
1.8 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
polynomial_factorization.h
Abstract:
Methods for factoring polynomials.
Author:
Dejan (t-dejanj) 2011-11-29
Notes:
[1] Elwyn Ralph Berlekamp. Factoring Polynomials over Finite Fields. Bell System Technical Journal,
46(8-10):18531859, 1967.
[2] Donald Ervin Knuth. The Art of Computer Programming, volume 2: Seminumerical Algorithms. Addison Wesley, third
edition, 1997.
[3] Henri Cohen. A Course in Computational Algebraic Number Theory. Springer Verlag, 1993.
--*/
#pragma once
#if 0
// Disabled for reorg
#include "polynomial.h"
#include "upolynomial.h"
#include "bit_vector.h"
#include "z3_exception.h"
namespace polynomial {
/**
\brief Something to throw when we are in trouble.
*/
class factorization_exception : public default_exception {
public:
factorization_exception(char const * msg) : default_exception(msg) {}
};
/**
\brief Factor the polynomial f from Z[x1, ..., x_n]. Returns the index of the last factor that is completely
factored. I.e., if the method returns m, then f_1, ..., f_m are true irreducible factors, and the rest might
be further reducible.
*/
unsigned factor(polynomial_ref & f, factors & factors);
/**
\brief Factor the square-free primitive polynomial f from Z[x1, ..., x_n]. Returns true if the factorization
was sucesseful, i.e. it was completed and the result is complete. Otherwise the quarantee is that the all but
the last factor are irreducible.
*/
bool factor_square_free_primitive(polynomial_ref const & f, factors & factors);
}
inline std::ostream & operator<<(std::ostream & out, polynomial::factors & factors) {
factors.display(out);
return out;
}
#endif