-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace usage of array_list with standard_array_list #132
fix sparse_vector Removed print from tests #132
- Loading branch information
Showing
30 changed files
with
284 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
// Copyright (c) 2017-2021 Mikhail Komarov <[email protected]> | ||
// Copyright (c) 2020-2021 Nikita Kaskov <[email protected]> | ||
// Copyright (c) 2021 Ilias Khairullin <[email protected]> | ||
// Copyright (c) 2024 Vasiliy Olekhov <[email protected]> | ||
// | ||
// MIT License | ||
// | ||
|
@@ -355,27 +356,21 @@ namespace nil { | |
return field; | ||
} | ||
|
||
template<typename CurveGroupType, typename TTypeBase> | ||
using curve_element_vector = nil::marshalling::types::standard_array_list< | ||
TTypeBase, | ||
curve_element<TTypeBase, CurveGroupType>>; | ||
|
||
template<typename CurveGroupType, typename Endianness> | ||
nil::marshalling::types::array_list< | ||
nil::marshalling::field_type<Endianness>, | ||
curve_element<nil::marshalling::field_type<Endianness>, CurveGroupType>, | ||
nil::marshalling::option::sequence_size_field_prefix< | ||
nil::marshalling::types::integral<nil::marshalling::field_type<Endianness>, std::size_t>>> | ||
curve_element_vector<CurveGroupType, nil::marshalling::field_type<Endianness>> | ||
fill_curve_element_vector( | ||
const std::vector<typename CurveGroupType::value_type> &curve_elem_vector) { | ||
|
||
using TTypeBase = nil::marshalling::field_type<Endianness>; | ||
|
||
using curve_element_type = curve_element<TTypeBase, CurveGroupType>; | ||
|
||
using curve_element_vector_type = nil::marshalling::types::array_list< | ||
TTypeBase, | ||
curve_element_type, | ||
nil::marshalling::option::sequence_size_field_prefix< | ||
nil::marshalling::types::integral<nil::marshalling::field_type<Endianness>, std::size_t>>>; | ||
|
||
curve_element_vector_type result; | ||
|
||
curve_element_vector<CurveGroupType, TTypeBase> result; | ||
std::vector<curve_element_type> &val = result.value(); | ||
for (std::size_t i = 0; i < curve_elem_vector.size(); i++) { | ||
val.push_back(curve_element_type(curve_elem_vector[i])); | ||
|
@@ -385,11 +380,7 @@ namespace nil { | |
|
||
template<typename CurveGroupType, typename Endianness> | ||
std::vector<typename CurveGroupType::value_type> make_curve_element_vector( | ||
const nil::marshalling::types::array_list< | ||
nil::marshalling::field_type<Endianness>, | ||
curve_element<nil::marshalling::field_type<Endianness>, CurveGroupType>, | ||
nil::marshalling::option::sequence_size_field_prefix< | ||
nil::marshalling::types::integral<nil::marshalling::field_type<Endianness>, std::size_t>>> | ||
const curve_element_vector<CurveGroupType, nil::marshalling::field_type<Endianness>> | ||
&curve_elem_vector) { | ||
|
||
std::vector<typename CurveGroupType::value_type> result; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
// Copyright (c) 2017-2021 Mikhail Komarov <[email protected]> | ||
// Copyright (c) 2020-2021 Nikita Kaskov <[email protected]> | ||
// Copyright (c) 2021 Ilias Khairullin <[email protected]> | ||
// Copyright (c) 2024 Vasiliy Olekhov <[email protected]> | ||
// | ||
// MIT License | ||
// | ||
|
@@ -686,27 +687,20 @@ namespace nil { | |
// return field; | ||
// } | ||
|
||
|
||
template<typename FieldValueType, typename TTypeBase> | ||
using field_element_vector = nil::marshalling::types::array_list< | ||
using field_element_vector = nil::marshalling::types::standard_array_list< | ||
TTypeBase, | ||
field_element<TTypeBase, FieldValueType>, | ||
nil::marshalling::option::sequence_size_field_prefix< | ||
nil::marshalling::types::integral<TTypeBase, std::size_t>>>; | ||
field_element<TTypeBase, FieldValueType>>; | ||
|
||
template<typename FieldValueType, typename Endianness> | ||
field_element_vector<FieldValueType, nil::marshalling::field_type<Endianness>> | ||
fill_field_element_vector(const std::vector<FieldValueType> &field_elem_vector) { | ||
|
||
using TTypeBase = nil::marshalling::field_type<Endianness>; | ||
using field_element_type = field_element<TTypeBase, FieldValueType>; | ||
using field_element_vector_type = nil::marshalling::types::array_list< | ||
TTypeBase, | ||
field_element_type, | ||
nil::marshalling::option::sequence_size_field_prefix< | ||
nil::marshalling::types::integral<TTypeBase, std::size_t>>>; | ||
|
||
field_element_vector_type result; | ||
field_element_vector<FieldValueType, TTypeBase> result; | ||
for (std::size_t i = 0; i < field_elem_vector.size(); i++) { | ||
result.value().push_back(field_element_type(field_elem_vector[i])); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.