Skip to content

Commit

Permalink
Change most assert_except into assert.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebfull committed Feb 9, 2017
1 parent 8b422be commit 9ada3f8
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 585 deletions.
3 changes: 1 addition & 2 deletions src/algebra/curves/alt_bn128/alt_bn128_g1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_g1.hpp"
#include "common/assert_except.hpp"

namespace libsnark {

Expand Down Expand Up @@ -257,7 +256,7 @@ alt_bn128_G1 alt_bn128_G1::add(const alt_bn128_G1 &other) const
alt_bn128_G1 alt_bn128_G1::mixed_add(const alt_bn128_G1 &other) const
{
#ifdef DEBUG
assert_except(other.is_special());
assert(other.is_special());
#endif

// handle special cases having to do with O
Expand Down
3 changes: 1 addition & 2 deletions src/algebra/curves/alt_bn128/alt_bn128_g2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*****************************************************************************/

#include "algebra/curves/alt_bn128/alt_bn128_g2.hpp"
#include "common/assert_except.hpp"

namespace libsnark {

Expand Down Expand Up @@ -267,7 +266,7 @@ alt_bn128_G2 alt_bn128_G2::add(const alt_bn128_G2 &other) const
alt_bn128_G2 alt_bn128_G2::mixed_add(const alt_bn128_G2 &other) const
{
#ifdef DEBUG
assert_except(other.is_special());
assert(other.is_special());
#endif

// handle special cases having to do with O
Expand Down
11 changes: 5 additions & 6 deletions src/algebra/evaluation_domain/domains/basic_radix2_domain.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@
#define BASIC_RADIX2_DOMAIN_TCC_

#include "algebra/evaluation_domain/domains/basic_radix2_domain_aux.hpp"
#include "common/assert_except.hpp"

namespace libsnark {

template<typename FieldT>
basic_radix2_domain<FieldT>::basic_radix2_domain(const size_t m) : evaluation_domain<FieldT>(m)
{
assert_except(m > 1);
assert(m > 1);
const size_t logm = log2(m);
assert_except(logm <= (FieldT::s));
assert(logm <= (FieldT::s));

omega = get_root_of_unity<FieldT>(m);
}
Expand All @@ -33,7 +32,7 @@ template<typename FieldT>
void basic_radix2_domain<FieldT>::FFT(std::vector<FieldT> &a)
{
enter_block("Execute FFT");
assert_except(a.size() == this->m);
assert(a.size() == this->m);
_basic_radix2_FFT(a, omega);
leave_block("Execute FFT");
}
Expand All @@ -42,7 +41,7 @@ template<typename FieldT>
void basic_radix2_domain<FieldT>::iFFT(std::vector<FieldT> &a)
{
enter_block("Execute inverse FFT");
assert_except(a.size() == this->m);
assert(a.size() == this->m);
_basic_radix2_FFT(a, omega.inverse());

const FieldT sconst = FieldT(a.size()).inverse();
Expand Down Expand Up @@ -92,7 +91,7 @@ FieldT basic_radix2_domain<FieldT>::compute_Z(const FieldT &t)
template<typename FieldT>
void basic_radix2_domain<FieldT>::add_poly_Z(const FieldT &coeff, std::vector<FieldT> &H)
{
assert_except(H.size() == this->m+1);
assert(H.size() == this->m+1);
H[this->m] += coeff;
H[0] -= coeff;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "algebra/fields/field_utils.hpp"
#include "common/profiling.hpp"
#include "common/utils.hpp"
#include "common/assert_except.hpp"

namespace libsnark {

Expand All @@ -39,7 +38,7 @@ template<typename FieldT>
void _basic_serial_radix2_FFT(std::vector<FieldT> &a, const FieldT &omega)
{
const size_t n = a.size(), logn = log2(n);
assert_except(n == (1u << logn));
assert(n == (1u << logn));

/* swapping in place (from Storer's book) */
for (size_t k = 0; k < n; ++k)
Expand Down Expand Up @@ -79,7 +78,7 @@ void _basic_parallel_radix2_FFT_inner(std::vector<FieldT> &a, const FieldT &omeg

const size_t m = a.size();
const size_t log_m = log2(m);
assert_except(m == 1ul<<log_m);
assert(m == 1ul<<log_m);

if (log_m < log_cpus)
{
Expand Down Expand Up @@ -190,7 +189,7 @@ std::vector<FieldT> _basic_radix2_lagrange_coeffs(const size_t m, const FieldT &
return std::vector<FieldT>(1, FieldT::one());
}

assert_except(m == (1u << log2(m)));
assert(m == (1u << log2(m)));

const FieldT omega = get_root_of_unity<FieldT>(m);

Expand Down
48 changes: 0 additions & 48 deletions src/algebra/evaluation_domain/domains/extended_radix2_domain.hpp

This file was deleted.

181 changes: 0 additions & 181 deletions src/algebra/evaluation_domain/domains/extended_radix2_domain.tcc

This file was deleted.

50 changes: 0 additions & 50 deletions src/algebra/evaluation_domain/domains/step_radix2_domain.hpp

This file was deleted.

Loading

0 comments on commit 9ada3f8

Please sign in to comment.