-
Notifications
You must be signed in to change notification settings - Fork 0
/
BigGuys.h
51 lines (48 loc) · 1.6 KB
/
BigGuys.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <iostream>
#include <stdexcept>
#include <cstring>
#include <string>
#include <iomanip>
#include <tuple>
using std::string;
template <typename T>
class BigGuys {
public:
BigGuys(size_t t=0);
BigGuys(string const);
BigGuys(BigGuys<T> const &);
~BigGuys();
T& operator[] (size_t) const;
BigGuys<T>& operator= (BigGuys<T> const &);
template<class U> friend std::ostream& operator << (std::ostream &, const BigGuys<U> &);
template<class U> friend std::istream& operator >> (std::istream &, BigGuys<U> &);
BigGuys<T> operator+ (BigGuys<T> const &);
BigGuys<T> operator- (BigGuys<T> const &);
BigGuys<T> operator* (BigGuys<T> const &);
std::tuple<BigGuys<T>, BigGuys<T>> operator/ (BigGuys<T> &);
bool operator > (BigGuys<T> const &) const;
bool operator >= (BigGuys<T> const &source) const;
bool operator == (BigGuys<T> const &source);
BigGuys<T> mul_base(T);
std::tuple<BigGuys<T>, T> div_base(T);
T mod_base(T);
size_t get_cap() const;
size_t get_len() const;
void kek();
void fill_with_random();
void gen_rand_vec(const size_t);
bool miller_rabin_is_prime(size_t);
BigGuys<T> RightShift(size_t);
BigGuys<T> MR(BigGuys<T> &);
BigGuys<T> power(const BigGuys<T>&, const BigGuys<T>&) const;
BigGuys<T> karacuba_mul(BigGuys<T> &);
BigGuys<T> prime_generator(size_t);
private:
size_t get_binary_len() const;
size_t get_binary_index(size_t) const;
void clear_insig();
T* guy;
size_t len;
size_t cap;
};