Skip to content

Commit

Permalink
Add new test vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaimueller committed Jan 4, 2024
1 parent 3d4252f commit a0815c8
Show file tree
Hide file tree
Showing 2 changed files with 462 additions and 3 deletions.
34 changes: 34 additions & 0 deletions src/Hardware/Probing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,31 @@ size_t ProbingSet<ExtensionContainer>::GetNumberOfStandardProbes() const {
template <class ExtensionContainer>
size_t ProbingSet<ExtensionContainer>::GetStandardProbeIndex(
size_t standard_probe_index) {
if (standard_probe_indices_.empty()) {
throw std::out_of_range(
"Tried to access a standard probe index from an empty vector!");
}

if (standard_probe_index >= standard_probe_indices_.size()) {
throw std::out_of_range("Tried to access an invalid standard probe index!");
}

return standard_probe_indices_[standard_probe_index];
}

template <class ExtensionContainer>
ExtensionContainer ProbingSet<ExtensionContainer>::GetExtendedProbeIndex(
size_t extended_probe_index) {
if (probe_extension_indices_.empty()) {
throw std::out_of_range(
"Tried to access a probe-extension index from an empty vector!");
}

if (extended_probe_index >= probe_extension_indices_.size()) {
throw std::out_of_range(
"Tried to access an invalid probe-extension index!");
}

return probe_extension_indices_[extended_probe_index];
}

Expand All @@ -154,6 +173,9 @@ size_t ProbingSet<ExtensionContainer>::GetNumberOfProbeExtensions() const {
return probe_extension_indices_.size();
}

template size_t ProbingSet<GlitchExtendedProbe>::GetNumberOfProbeExtensions()
const;

template <class ExtensionContainer>
ExtensionContainer ProbingSet<ExtensionContainer>::GetFirstProbeExtension()
const {
Expand Down Expand Up @@ -182,6 +204,9 @@ ProbingSet<ExtensionContainer>::GetAllProbeExtensions() const {
return probe_extension_indices_;
}

template std::vector<GlitchExtendedProbe>
ProbingSet<GlitchExtendedProbe>::GetAllProbeExtensions() const;

template <class ExtensionContainer>
bool ProbingSet<ExtensionContainer>::IsRemovable() const {
return contingency_table_.IsRemovable();
Expand Down Expand Up @@ -285,18 +310,27 @@ bool ProbingSet<ExtensionContainer>::operator<(
return (probe_extension_indices_ < other.probe_extension_indices_);
}

template bool ProbingSet<GlitchExtendedProbe>::operator<(
const ProbingSet<GlitchExtendedProbe>&) const;

template <class ExtensionContainer>
bool ProbingSet<ExtensionContainer>::operator==(
const ProbingSet<ExtensionContainer>& other) const {
return (probe_extension_indices_ == other.probe_extension_indices_);
}

template bool ProbingSet<GlitchExtendedProbe>::operator==(
const ProbingSet<GlitchExtendedProbe>&) const;

template <class ExtensionContainer>
bool ProbingSet<ExtensionContainer>::operator!=(
const ProbingSet<ExtensionContainer>& other) const {
return (probe_extension_indices_ != other.probe_extension_indices_);
}

template bool ProbingSet<GlitchExtendedProbe>::operator!=(
const ProbingSet<GlitchExtendedProbe>&) const;

template <class ExtensionContainer>
bool ProbingSet<ExtensionContainer>::Includes(
const ProbingSet<ExtensionContainer>& other) const {
Expand Down
Loading

0 comments on commit a0815c8

Please sign in to comment.