Alexandria
2.14.1
Please provide a description of the project.
|
Go to the documentation of this file.
44 for (
size_t i = 0; i < c1.
size(); ++i)
45 for (
size_t j = 0; j < c2.
size(); ++j)
46 resultCoef[i + j] += c1[i] * c2[j];
64 auto p1Iter = knots1.
begin();
65 auto p2Iter = knots2.
begin();
67 while (p1Iter != knots1.
end() && p2Iter != knots2.
end()) {
69 if (*p1Iter < *p2Iter) {
70 if (*(++p1Iter) > *p2Iter) {
74 if (*p1Iter < *(++p2Iter)) {
80 if (*p1Iter < *p2Iter) {
81 knotSet.insert(*p1Iter);
84 knotSet.insert(*p2Iter);
107 for (
double knot : knots) {
108 if (knot == knots.back()) {
111 while (p1.
getKnots()[i1+1] <= knot) {
114 while (p2.
getKnots()[i2+1] <= knot) {
std::unique_ptr< Function > multiplyPiecewises(const Function &f1, const Function &f2)
std::unique_ptr< Function > multiplyPiecewiseWithGeneric(const Function &f1, const Function &f2)
Interface class representing a function.
Represents a piecewise function.
ELEMENTS_API std::map< std::pair< std::type_index, std::type_index >, MultiplyFunction > multiplySpecificSpecificMap
std::unique_ptr< Function > multiplyPolynomials(const Function &f1, const Function &f2)
Function for multiplying two Polynomials. It multiplies their coefficients.
Represents a polynomial function.
ELEMENTS_API std::map< std::type_index, MultiplyFunction > multiplySpecificGenericMap
std::vector< double > overlappingKnots(const std::vector< double > &knots1, const std::vector< double > &knots2)
Returns a vector of the overlapping knots from the given vectors.
const std::vector< double > & getCoefficients() const
Returns the coefficients of the polynomial.
const std::vector< std::shared_ptr< Function > > & getFunctions() const
Returns the functions in the ranges between the knots.
ELEMENTS_API std::unique_ptr< Function > multiply(const Function &f1, const Function &f2)
std::unique_ptr< Function >(* MultiplyFunction)(const Function &, const Function &)
Alias of a function which multiplies Function objects.
const std::vector< double > & getKnots() const
Returns the knots of the piecewise function.