Skip to content
Snippets Groups Projects
Commit ca9e79bf authored by Nabil Chouika's avatar Nabil Chouika
Browse files

refs#16

- Fixed Gauss-Legendre
parent e3307878
Branches
Tags
No related merge requests found
......@@ -32,8 +32,8 @@ double QuadratureIntegrator1D::integrate(FunctionType1D* pFunction, double a,
for (unsigned int i = 0; i < m_nodes.size(); i++) {
x1 = m_a + m_b * m_nodes[i];
x2 = m_a - m_b * m_nodes[i];
result += (*pFunction)(x1, parameters)
+ (*pFunction)(x2, parameters) * m_weights[i];
result += ((*pFunction)(x1, parameters) + (*pFunction)(x2, parameters))
* m_weights[i];
}
// Multiplying by the step at the end to save computing time
result = result * m_b;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment