Implementation tests for a sparse_vector object. More...
#include <iostream>
#include <algorithm>
#include <string>
#include <utility>
#include <sstream>
#include <stdexcept>
#include "lardataobj/Utilities/sparse_vector.h"
Go to the source code of this file.
Classes | |
class | actions::BaseAction< T > |
Base class for testing actions. More... | |
class | TestManagerClass< T > |
Test manager class. More... | |
struct | TestManagerClass< T >::FailureInfo_t |
Data structure to document failure of a single action. More... | |
class | actions::BaseAction< T > |
Base class for testing actions. More... | |
class | actions::Print< T > |
class | actions::PrintSparseVector< T > |
class | actions::PrintRange< T > |
class | actions::PrintNonVoid< T > |
class | actions::Clear< T > |
class | actions::Resize< T > |
class | actions::Truncate< T > |
class | actions::ResizeWith< T > |
class | actions::Assign< T > |
class | actions::AssignMove< T > |
class | actions::Insert< T > |
class | actions::Add< T > |
class | actions::Erase< T > |
class | actions::EraseRangeAt< T > |
class | actions::Scale< T > |
class | actions::ScaleAll< T > |
class | actions::SetElement< T > |
class | actions::UnsetElement< T > |
class | actions::PushBack< T > |
class | actions::SetValue< T > |
class | actions::FlipSign< T > |
class | actions::Optimize< T > |
class | actions::FailTest< T > |
Namespaces | |
actions | |
Namespace containing all the test actions. | |
Functions | |
template<typename T > | |
T | abs (T value) |
template<typename CONT > | |
std::ostream & | PrintVector (const CONT &sv, std::ostream &out=std::cout) |
Prints a container into a stream. More... | |
template<typename CONT > | |
std::string | VectorToString (const CONT &sv) |
Converts a container into a string. More... | |
template<typename T > | |
std::ostream & | PrintVectorRanges (const lar::sparse_vector< T > &sv, std::ostream &out=std::cout) |
Prints a sparse vector highlighting the ranges. More... | |
template<typename T > | |
actions::Scale (size_t pos, T factor) -> Scale< T > | |
template<typename T > | |
actions::ScaleAll (T factor) -> ScaleAll< T > | |
int | main () |
A simple test suite. More... | |
Implementation tests for a sparse_vector object.
The test program is made of some infrastucture (mostly the TestManagerClass class) and some test operations.
The test operations are derived by actions::BaseAction class; while they are not documented, their content is a good showcase of features of the sparse_vector class.
Definition in file sparse_vector_test.cc.
T abs | ( | T | value | ) |
Definition at line 30 of file sparse_vector_test.cc.
int main | ( | ) |
A simple test suite.
Definition at line 1103 of file sparse_vector_test.cc.
std::ostream& PrintVector | ( | const CONT & | sv, |
std::ostream & | out = std::cout |
||
) |
std::ostream& PrintVectorRanges | ( | const lar::sparse_vector< T > & | sv, |
std::ostream & | out = std::cout |
||
) |
Prints a sparse vector highlighting the ranges.
Definition at line 54 of file sparse_vector_test.cc.
std::string VectorToString | ( | const CONT & | sv | ) |
Converts a container into a string.
Definition at line 44 of file sparse_vector_test.cc.