MCPcopy Create free account
hub / github.com/aff3ct/aff3ct / build

Method build

src/Factory/Module/Quantizer/Quantizer.cpp:79–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78template<typename R, typename Q>
79module::Quantizer<R, Q>*
80Quantizer ::build() const
81{
82 if (this->type == "POW2" && this->implem == "STD")
83 return new module::Quantizer_pow2<R, Q>(this->size, this->n_decimals, this->n_bits);
84 if (this->type == "POW2" && this->implem == "FAST")
85 return new module::Quantizer_pow2_fast<R, Q>(this->size, this->n_decimals, this->n_bits);
86 if (this->type == "CUSTOM" && this->implem == "STD")
87 return new module::Quantizer_custom<R, Q>(this->size, this->range, this->n_bits);
88 if (this->type == "NO") return new module::Quantizer_NO<R, Q>(this->size);
89
90 throw spu::tools::cannot_allocate(__FILE__, __LINE__, __func__);
91}
92
93// ==================================================================================== explicit template instantiation
94#include "Tools/types.h"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected