mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
Partial cleanup of util/lp/*
This commit is contained in:
parent
00651f8f21
commit
d61b722b68
109 changed files with 3503 additions and 2023 deletions
|
@ -1,7 +1,22 @@
|
|||
/*
|
||||
Copyright (c) 2017 Microsoft Corporation
|
||||
Author: Lev Nachmanson
|
||||
*/
|
||||
/*++
|
||||
Copyright (c) 2017 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
<name>
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Lev Nachmanson (levnach)
|
||||
|
||||
Revision History:
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
#include "util/vector.h"
|
||||
|
@ -9,7 +24,7 @@
|
|||
#include "util/debug.h"
|
||||
#include "util/lp/lp_utils.h"
|
||||
#include "util/lp/lp_settings.h"
|
||||
namespace lean {
|
||||
namespace lp {
|
||||
|
||||
template <typename T>
|
||||
class sparse_vector {
|
||||
|
@ -18,7 +33,7 @@ public:
|
|||
void push_back(unsigned index, T val) {
|
||||
m_data.push_back(std::make_pair(index, val));
|
||||
}
|
||||
#ifdef LEAN_DEBUG
|
||||
#ifdef Z3DEBUG
|
||||
T operator[] (unsigned i) const {
|
||||
for (auto &t : m_data) {
|
||||
if (t.first == i) return t.second;
|
||||
|
@ -27,7 +42,7 @@ public:
|
|||
}
|
||||
#endif
|
||||
void divide(T const & a) {
|
||||
lean_assert(!lp_settings::is_eps_small_general(a, 1e-12));
|
||||
SASSERT(!lp_settings::is_eps_small_general(a, 1e-12));
|
||||
for (auto & t : m_data) { t.second /= a; }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue