ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::base::math::get_prime_factorization_t::result_t< T >::unique_t类 参考

Public 成员函数

constexpr unique_t (T m) noexcept
 
template<class container_t >
requires able<container_t>
constexpr container_t to () const noexcept
 
template<class container_t >
constexpr operator container_t () const noexcept
 

详细描述

template<class T>
class elc::defs::base::math::get_prime_factorization_t::result_t< T >::unique_t

在文件 all_defs.cpp4971 行定义.

构造及析构函数说明

◆ unique_t()

template<class T >
constexpr elc::defs::base::math::get_prime_factorization_t::result_t< T >::unique_t::unique_t ( m)
inlineconstexprnoexcept

在文件 all_defs.cpp4974 行定义.

4974:_m(m){}
constexpr T down_cast(U a) noexcept
向下转型至

成员函数说明

◆ operator container_t()

template<class T >
template<class container_t >
constexpr elc::defs::base::math::get_prime_factorization_t::result_t< T >::unique_t::operator container_t ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp4995 行定义.

4995 {
4996 return to<container_t>();
4997 }

◆ to()

template<class T >
template<class container_t >
requires able<container_t>
constexpr container_t elc::defs::base::math::get_prime_factorization_t::result_t< T >::unique_t::to ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp4977 行定义.

4977 {
4978 container_t aret{};
4979 //思路:获取小于等于m的所有素数,依次除以m,若能整除则将素数加入结果,否则跳过,直到m为1.
4980 T i=T{2u},m=abs(_m);
4981 while(m!=1){
4982 if(!(m%i)){
4983 aret.push_back(i);
4984 do m/=i;while(!(m%i));
4985 }
4987 }
4988 if constexpr(signed_type<T>)
4989 if(is_negative(_m))
4990 aret.push_back(T{-1});
4991 return aret;
4992 }
constexpr auto abs(const T &v) noexcept
constexpr bool is_negative(const T &x) noexcept
constexpr auto get_prime_num_big_than(T a) noexcept
求大于某数的素数
函数调用图:

该类的文档由以下文件生成: