-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix.h
77 lines (55 loc) · 4.15 KB
/
matrix.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* ============================================================================
File : matrix.h
Author : Sylvie Putot, Ecole Polytechnique (France)
Part of the RINO package for Inner and Outer Reachability Analysis.
This file defines rather standard vector/matrix operations over intervals and affine forms (AAF)
============================================================================ */
#ifndef MATRIX_H
#define MATRIX_H
#include "filib_interval.h"
#include "ode_def.h"
#include "fadbad_aa.h"
using namespace std;
bool subseteq (vector<vector<AAF>> &M1, vector<vector<AAF>> &M2);
bool subseteq(vector<interval> &x, vector<interval> &y);
bool subseteq(vector<AAF> &x, vector<AAF> &y);
vector<AAF> hull(vector<AAF> &x, vector<AAF> &y);
void hull(vector<interval> &res, vector<interval> &x, vector<interval> &y);
void hull(vector<AAF> &res, vector<AAF> &x, vector<AAF> &y);
void multMiMi(vector<vector<AAF>> &z, const vector<vector<AAF>> x, const vector<vector<AAF>> y);
void multMiMi(vector<vector<interval>> &z, const vector<vector<double>> x, const vector<vector<interval>> y);
void multMiMi(vector<vector<AAF>> &z, const vector<vector<double>> x, const vector<vector<AAF>> y);
void multMiMi(vector<vector<double>> &z, const vector<vector<double>> x, const vector<vector<double>> y);
void multJacfzJaczz0(vector<vector<AAF>> &z, vector<vector<AAF>> &x, vector<vector<AAF>> &y);
void multJacfzuJaczz0Jacuz0(vector<vector<AAF>> &z, vector<vector<AAF>> &x, vector<vector<AAF>> &aux2, vector<vector<AAF>> &y,double offset);
void multMiVi(vector<interval> &y, vector<vector<interval>> &A, vector<interval> &x) ;
ostream& operator<<(ostream& os, const vector<vector<interval>> &M);
ostream& operator<<(ostream& os, const vector<interval> &z);
void scaleM(vector<vector<AAF>> &x, double d);
void scaleJacfz(vector<vector<AAF>> &x, double d);
void addMiMi(vector<vector<AAF>> &x, vector<vector<AAF>> &y);
void addJacfzJacfz(vector<vector<AAF>> &x, vector<vector<AAF>> &y);
void scalarproduct(vector<interval> &z, vector<interval> &x, vector<interval> &y);
void addViVi(vector<interval> &x, vector<interval> &y);
void addViVi(vector<AAF> &x, vector<double> &y);
void addViVi(vector<AAF> &x, vector<interval> &y);
void intersectViVi(vector<interval> &x, vector<interval> &y);
void intersectViVi(vector<interval> &x, vector<AAF> &y);
void emptyVi(vector<interval> &x);
void setVi(vector<interval> &x,vector<AAF> &y);
void setVi(vector<interval> &x,vector<AAF> &y, vector<AAF> &constraints);
void setId(vector<vector<AAF>> &J);
void compute_print_skewbox(interval &temp_inner_x, interval &temp_inner_y, vector<vector<double>> &A, int varx, int vary, const char *approxtype);
vector<vector<double>> compute_skewbox_3d(vector<interval> &temp_inner, vector<vector<double>> &A, int varx, int vary, int varz);
void multMiMi(vector<vector<vector<interval>>> &CHessf, vector<vector<double>> &C, vector<vector<vector<interval>>> &Hessf, int varx, int vary, int varz, bool skew);
void multMiVi(vector<interval> &f0, vector<vector<double>> &C, vector<interval> z0, int varx, int vary, int varz, bool skew);
void multMiVi(vector <F<F<AAF>>> &f0, vector<vector<double>> &C, vector <F<F<AAF>>> z0, int varx, int vary, int varz, bool skew);
void multMiVi(vector <F<interval>> &f0, vector<vector<double>> &C, vector <F<interval>> z0, int varx, int vary, int varz, bool skew);
void multMiVi(vector <F<AAF>> &f0, vector<vector<double>> &C, vector <F<AAF>> z0, int varx, int vary, int varz, bool skew);
//template <class Cl> void multMiVi(vector <Cl> &f0, vector<vector<double>> &C, vector <Cl> z0, int varx, int vary, int varz, bool skew);
// builds conditionner for skewbox computation
// A is center of Jaux on components i and k (otherwise diagonal), C is inverse of A
void build_2dpreconditionner(vector<vector<double>> &A, vector<vector<double>> &C, vector<vector<interval>> Jaux, int i, int k);
void build_2dpreconditionner_frominit(vector<vector<double>> &A, vector<vector<double>> &C, vector<AAF> xp1, int i, int k);
void build_3dpreconditionner(vector<vector<double>> &A, vector<vector<double>> &C, vector<vector<interval>> J, int i, int k, int l);
#endif