File: integrate_by_parts.hh

package info (click to toggle)
cadabra2 2.4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 78,732 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (45 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download | duplicates (3)
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


#pragma once

#include "Algorithm.hh"

namespace cadabra {

	/// \ingroup algorithms
	///
	/// Integrate by parts away from the indicated derivative object.


	class integrate_by_parts : public Algorithm {
		public:
			integrate_by_parts(const Kernel&, Ex&, Ex&);

			virtual bool     can_apply(iterator) override;
			virtual result_t apply(iterator&) override;

		private:
			// Integrate by parts on a single term in the integrand. First
			// argument points to the integral, second to a term in the
			// integrand.
			result_t handle_term(iterator, iterator&);

			// Are the given integral and derivative inverses of each-other?
			bool int_and_derivative_related(iterator int_it, iterator der_it) const;

			// Split one derivative from a multiple derivative.
			void split_off_single_derivative(iterator int_it, iterator der_it);

			// Wrap the indicated range of factor nodes inside the product node in
			// the derivative.
			Ex wrap(iterator, sibling_iterator, sibling_iterator) const;

			// Determine whether the indicated derivative acts on the 'away_from'
			// expression.
			bool derivative_acting_on_arg(iterator der_it) const;

			// Expression to move derivative away from.
			Ex away_from;
		};

	}