codac 2.0.0
Loading...
Searching...
No Matches
codac2_Parallelepiped_eval.h
Go to the documentation of this file.
1
9
10#pragma once
11
14#include "codac2_peibos.h"
15
16namespace codac2
17{
18 template<typename T>
19 requires std::is_base_of_v<AnalyticTypeBase,T>
20 template<typename... Args>
21 inline Parallelepiped AnalyticFunction<T>::parallelepiped_eval(const Args&... x) const
22 {
23 this->check_valid_inputs(x...);
24 assert_release(this->input_size() < this->output_size() &&
25 "Parallelepiped evaluation requires more outputs than inputs.");
26 assert_release(this->input_size() > 0 &&
27 "Parallelepiped evaluation requires at least one input.");
28
29 auto Y = this->eval(x.mid()...);
30 auto z = Y.mid();
31
32 Matrix A = this->diff(x.mid()...).mid();
33
34 // Maximum error computation
35 double rho = error(Y, z, this->diff(x...), A, cart_prod(x...));
36
37 // Inflation of the parallelepiped
38 auto A_inf = inflate_flat_parallelepiped(A, cart_prod(x...).rad(), rho);
39
40 return Parallelepiped(z, A_inf);
41 }
42}
Class representing a parallelepiped .
Definition codac2_Parallelepiped.h:30
auto rad() const
Returns a matrix containing the radii of each interval element.
Definition codac2_MatrixBase_addons_IntervalMatrixBase.h:197
std::list< Matrix< codac2::Interval, R, C > > diff(const MatrixBase< OtherDerived > &y, bool compactness=true) const
Computes the difference between this interval vector (or interval row) and another.
Definition codac2_MatrixBase_addons_IntervalVector.h:56
Definition codac2_OctaSym.h:21
Matrix inflate_flat_parallelepiped(const Matrix &A, const Vector &e_vec, double rho)
Inflate the flat parallelepiped by .
double error(const IntervalVector &Y, const Vector &z, const IntervalMatrix &Jf, const Matrix &A, const IntervalVector &X)
Compute the error term for the parallelepiped inclusion. The error is later used to inflate the flat ...
Eigen::Matrix< double,-1,-1 > Matrix
Alias for a dynamic-size matrix of doubles.
Definition codac2_Matrix.h:26