3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-30 04:15:51 +00:00

more dead code

This commit is contained in:
Lev Nachmanson 2023-03-07 17:52:59 -08:00
parent 13549aff66
commit 11eab94321
17 changed files with 10 additions and 1095 deletions

View file

@ -25,20 +25,16 @@ Revision History:
#include "math/lp/indexed_vector.h"
#include "math/lp/lp_settings.h"
#include "math/lp/matrix.h"
#include "math/lp/tail_matrix.h"
namespace lp {
#ifdef Z3DEBUG
inline bool is_even(int k) { return (k/2)*2 == k; }
#endif
template <typename T, typename X>
class permutation_matrix : public tail_matrix<T, X> {
template <typename T, typename X>
class permutation_matrix
#ifdef Z3DEBUG
: public matrix<T, X>
#endif
{
vector<unsigned> m_permutation;
vector<unsigned> m_rev;
vector<unsigned> m_work_array;
vector<T> m_T_buffer;
vector<X> m_X_buffer;
class ref {
permutation_matrix & m_p;
@ -63,42 +59,15 @@ class permutation_matrix : public tail_matrix<T, X> {
// create a unit permutation of the given length
void init(unsigned length);
unsigned get_rev(unsigned i) { return m_rev[i]; }
bool is_dense() const override { return false; }
#ifdef Z3DEBUG
permutation_matrix get_inverse() const {
return permutation_matrix(size(), m_rev);
}
#ifdef Z3DEBUG
void print(std::ostream & out) const;
#endif
ref operator[](unsigned i) { return ref(*this, i); }
unsigned operator[](unsigned i) const { return m_permutation[i]; }
void apply_from_left(vector<X> & w, lp_settings &) override;
void apply_from_left_to_T(indexed_vector<T> & w, lp_settings & settings) override;
void apply_from_right(vector<T> & w) override;
void apply_from_right(indexed_vector<T> & w) override;
template <typename L>
void copy_aside(vector<L> & t, vector<unsigned> & tmp_index, indexed_vector<L> & w);
template <typename L>
void clear_data(indexed_vector<L> & w);
template <typename L>
void apply_reverse_from_left(indexed_vector<L> & w);
void apply_reverse_from_left_to_T(vector<T> & w);
void apply_reverse_from_left_to_X(vector<X> & w);
void apply_reverse_from_right_to_T(vector<T> & w);
void apply_reverse_from_right_to_T(indexed_vector<T> & w);
void apply_reverse_from_right_to_X(vector<X> & w);
void set_val(unsigned i, unsigned pi) {
lp_assert(i < size() && pi < size()); m_permutation[i] = pi; m_rev[pi] = i; }
@ -116,18 +85,6 @@ class permutation_matrix : public tail_matrix<T, X> {
void set_number_of_rows(unsigned /*m*/) override { }
void set_number_of_columns(unsigned /*n*/) override { }
#endif
void multiply_by_permutation_from_left(permutation_matrix<T, X> & p);
// this is multiplication in the matrix sense
void multiply_by_permutation_from_right(permutation_matrix<T, X> & p);
void multiply_by_reverse_from_right(permutation_matrix<T, X> & q);
void multiply_by_permutation_reverse_from_left(permutation_matrix<T, X> & r);
void shrink_by_one_identity();
bool is_identity() const;
unsigned size() const { return static_cast<unsigned>(m_rev.size()); }
@ -135,8 +92,6 @@ class permutation_matrix : public tail_matrix<T, X> {
unsigned old_size = m_permutation.size();
m_permutation.resize(size);
m_rev.resize(size);
m_T_buffer.resize(size);
m_X_buffer.resize(size);
for (unsigned i = old_size; i < size; i++) {
m_permutation[i] = m_rev[i] = i;
}