Skip to content

Commit

Permalink
add gudhi_check for column push_back
Browse files Browse the repository at this point in the history
  • Loading branch information
hschreiber committed Oct 23, 2024
1 parent 48d4d66 commit e1b4634
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <utility> //std::swap, std::move & std::exchange

#include <boost/iterator/indirect_iterator.hpp>
#include "gudhi/Debug_utils.h"

#include <gudhi/Persistence_matrix/allocators/entry_constructors.h>

Expand Down Expand Up @@ -875,6 +876,8 @@ inline void Heap_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

Entry* newEntry = entryPool_->construct(entry.get_row_index());
if constexpr (!Master_matrix::Option_list::is_z2) {
newEntry->set_element(operators_->get_value(entry.get_element()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@ inline void Intrusive_list_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index(), column_.end());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@ inline void Intrusive_set_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index(), column_.end());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ inline void List_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index(), column_.end());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,8 @@ inline void Naive_vector_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index(), column_);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ inline void Set_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index(), column_.end());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ inline void Unordered_set_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@ inline void Vector_column<Master_matrix>::push_back(const Entry& entry)
{
static_assert(Master_matrix::Option_list::is_of_boundary_type, "`push_back` is not available for Chain matrices.");

GUDHI_CHECK(entry.get_row_index() > get_pivot(), "The new row index has to be higher than the current pivot.");

if constexpr (Master_matrix::Option_list::is_z2) {
_insert_entry(entry.get_row_index(), column_);
} else {
Expand Down

0 comments on commit e1b4634

Please sign in to comment.