Skip to content

Commit

Permalink
replace expression with new var #18
Browse files Browse the repository at this point in the history
  • Loading branch information
vo-nil committed Oct 30, 2023
1 parent 78fb71c commit ab70e48
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace nil {
namespace actor {
namespace zk {
namespace snark {
namespace detail {
namespace detail {
// Interf-ace for lookup table definitions.
template<typename FieldType>
class lookup_subtable_definition{
Expand All @@ -53,7 +53,7 @@ namespace nil {

lookup_table_definition(const std::string table_name){
this->table_name = table_name;
}
}

virtual void generate() = 0;
virtual std::size_t get_columns_number() = 0;
Expand Down Expand Up @@ -89,7 +89,7 @@ namespace nil {
template<typename FieldType, typename ArithmetizationParams>
std::size_t pack_lookup_tables(
const std::map<std::string, std::size_t> &lookup_table_ids,
const std::map<std::string, std::shared_ptr<lookup_table_definition<FieldType>>> &lookup_tables,
const std::map<std::string, std::shared_ptr<lookup_table_definition<FieldType>>> &lookup_tables,
plonk_constraint_system<FieldType, ArithmetizationParams> &bp,
plonk_assignment_table<FieldType, ArithmetizationParams> &assignment,
const std::vector<std::size_t> &constant_columns_ids,
Expand Down Expand Up @@ -119,10 +119,11 @@ namespace nil {
for( const auto&[k, table]:lookup_tables ){
// Place table into constant_columns.
for( std::size_t i = 0; i < table->get_table().size(); i++ ){
if(constant_columns[i].size() < start_row + table->get_table()[i].size()){
constant_columns[i].resize(start_row + table->get_table()[i].size());
if( usable_rows_after < start_row + table->get_table()[i].size() ){
usable_rows_after = start_row + table->get_table()[i].size();
auto end = start_row + table->get_table()[i].size();
if(constant_columns[i].size() < end){
constant_columns[i].resize(end);
if( usable_rows_after < end ){
usable_rows_after = end;
}
}
for( std::size_t j = 0; j < table->get_table()[i].size(); j++ ){
Expand All @@ -142,7 +143,7 @@ namespace nil {
std::vector<plonk_variable<typename FieldType::value_type>> option;
for( const auto &column_index:subtable.column_indices ){
option.emplace_back( plonk_variable<typename FieldType::value_type>(
constant_columns_ids[column_index], 0,
constant_columns_ids[column_index], 0,
false, plonk_variable<typename FieldType::value_type>::column_type::constant
) );
}
Expand Down

0 comments on commit ab70e48

Please sign in to comment.