This examples shows how to dispatch functor instances based on a polymorphic storage instance.
#include "latbuilder/Storage.h"
#include "latbuilder/SizeParam.h"
#include <iostream>
template <LatticeType LA, EmbeddingType ET, Compress COMP>
{
std::cout << "storage name: " << storage.name() << std::endl;
std::cout << " size parameter: " << storage.sizeParam() << std::endl;
std::cout << " virtual size: " << storage.virtualSize() << std::endl;
std::cout << " actual size: " << storage.size() << std::endl;
}
int main()
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
test<LatticeType::ORDINARY, EmbeddingType::UNILEVEL, Compress::NONE>(n);
test<LatticeType::ORDINARY, EmbeddingType::MULTILEVEL, Compress::NONE>(n);
test<LatticeType::ORDINARY, EmbeddingType::UNILEVEL, Compress::SYMMETRIC>(n);
test<LatticeType::ORDINARY, EmbeddingType::MULTILEVEL, Compress::SYMMETRIC>(n);
test<LatticeType::POLYNOMIAL, EmbeddingType::UNILEVEL, Compress::NONE>(P);
test<LatticeType::POLYNOMIAL, EmbeddingType::MULTILEVEL, Compress::NONE>(P);
return 0;
}