ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
Polynomial.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*--------------------------- File Polynomial.h ----------------------------*/
3
/*--------------------------------------------------------------------------*/
42
/*--------------------------------------------------------------------------*/
43
/*----------------------------- DEFINITIONS --------------------------------*/
44
/*--------------------------------------------------------------------------*/
45
46
#ifndef __ADS_Polynomial
47
#define __ADS_Polynomial
48
/* self-identification: #endif constant */
49
50
/*--------------------------------------------------------------------------*/
51
/*------------------------------ INCLUDES ----------------------------------*/
52
/*--------------------------------------------------------------------------*/
53
54
#include "
ADS/Contract.h
"
55
56
#include <algorithm>
57
#include <cstddef>
58
#include <vector>
59
60
/*--------------------------------------------------------------------------*/
61
/*--------------------------- NAMESPACE ------------------------------------*/
62
/*--------------------------------------------------------------------------*/
63
64
namespace
ADS
65
{
66
81
template
<
class
T >
82
std::vector< T >
multiplyNaive
(
const
std::vector< T > & p ,
83
const
std::vector< T > & q ,
84
long
* mults =
nullptr
);
85
86
namespace
detail
87
{
88
90
template
<
class
T >
91
void
addShifted( std::vector< T > & r ,
const
std::vector< T > & a ,
92
std::size_t s , T sign = T( 1 ) );
93
96
template
<
class
T >
97
std::vector< T > multiplyRec(
const
std::vector< T > & p ,
98
const
std::vector< T > & q ,
bool
three ,
99
long
* mults );
100
103
template
<
class
T >
104
std::vector< T > multiplySame( std::vector< T > p , std::vector< T > q ,
105
bool
three ,
long
* mults );
106
107
}
// end( namespace detail )
108
130
template
<
class
T >
131
std::vector< T >
multiplyFour
(
const
std::vector< T > & p ,
132
const
std::vector< T > & q ,
133
long
* mults =
nullptr
);
134
155
template
<
class
T >
156
std::vector< T >
multiplyKaratsuba
(
const
std::vector< T > & p ,
157
const
std::vector< T > & q ,
158
long
* mults =
nullptr
);
159
160
/*--------------------------------------------------------------------------*/
161
162
}
// end( namespace ADS )
163
164
/*--------------------------------------------------------------------------*/
165
/*-------------------------- IMPLEMENTATION --------------------------------*/
166
/*--------------------------------------------------------------------------*/
167
168
#include "ADS/numeric/impl/Polynomial.tpp"
169
170
/*--------------------------------------------------------------------------*/
171
172
#endif
/* Polynomial.h included */
173
174
/*--------------------------------------------------------------------------*/
175
/*------------------------- End File Polynomial.h --------------------------*/
176
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::multiplyNaive
Matrix< T > multiplyNaive(const Matrix< T > &A, const Matrix< T > &B, long *mults=nullptr)
the product of two matrices by the definition, (the moltiplicaMatrici() of the book); the products...
ADS::multiplyKaratsuba
std::vector< T > multiplyKaratsuba(const std::vector< T > &p, const std::vector< T > &q, long *mults=nullptr)
the product by the three recursive products of Karatsuba, (the moltiplicaPolinomiD&I() of the book)...
ADS::multiplyFour
std::vector< T > multiplyFour(const std::vector< T > &p, const std::vector< T > &q, long *mults=nullptr)
the product by four recursive products of half size, (the Prodotto4() of the book on polynomials); ...
ADS
Definition
ADT.h:96
ADS
numeric
Polynomial.h
Generated by
1.17.0