Files
solver/OndselSolver/Integral.cpp
John Dupuy 87ed8700e2 modify code to suppress or fix warnings in gcc and clang (#41)
* first fix to start branch PR

* explicit conversion from sizet to int

* Array.h and DiagonalMatrix.h

* many sizet to int conversions

* removed some unused variables and added expl overrides

* removed many unused parameters

* more typing

* even more

* last of the easy changes
2023-12-08 10:00:00 -07:00

46 lines
1.1 KiB
C++

#include "Integral.h"
using namespace MbD;
MbD::Integral::Integral(Symsptr, Symsptr)
{
assert(false);
}
void MbD::Integral::arguments(Symsptr args)
{
auto arguments = args->getTerms();
xx = arguments->at(0);
integrand = arguments->at(1);
expression = integrand->integrateWRT(xx);
}
Symsptr MbD::Integral::expandUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
auto expand = expression->expandUntil(expression, set);
auto answer = std::make_shared<Integral>();
answer->xx = xx;
answer->expression = expand;
answer->integrand = integrand;
answer->integrationConstant = integrationConstant;
return answer;
}
Symsptr MbD::Integral::simplifyUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
auto simple = expression->simplifyUntil(expression, set);
auto answer = std::make_shared<Integral>();
answer->xx = xx;
answer->expression = simple;
answer->integrand = integrand;
answer->integrationConstant = integrationConstant;
return answer;
}
std::ostream& MbD::Integral::printOn(std::ostream& s) const
{
s << *expression << " + ";
s << *integrationConstant;
return s;
}