-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[py] binding of IntervalMatrix + doc
- Loading branch information
1 parent
c0e13ef
commit 044ba87
Showing
4 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Arithmetic operations on matrices | ||
* ---------------------------------------------------------------------------- | ||
* \date 2022 | ||
* \author Simon Rohou | ||
* \copyright Copyright 2022 Codac Team | ||
* \license This program is distributed under the terms of | ||
* the GNU Lesser General Public License (LGPL). | ||
*/ | ||
|
||
#include "codac_matrix_arithmetic.h" | ||
|
||
using namespace std; | ||
using namespace ibex; | ||
|
||
namespace codac | ||
{ | ||
const IntervalMatrix operator&(const IntervalMatrix& m1, const IntervalMatrix& m2) | ||
{ | ||
assert(m1.nb_cols() == m2.nb_cols() && m1.nb_rows() == m2.nb_rows()); | ||
IntervalMatrix m3(m1); | ||
|
||
for(int i = 0; i < m1.nb_rows(); i++) | ||
for(int j = 0; j < m2.nb_cols(); j++) | ||
m3[i][j] &= m2[i][j]; | ||
|
||
return m3; | ||
} | ||
|
||
const IntervalMatrix operator|(const IntervalMatrix& m1, const IntervalMatrix& m2) | ||
{ | ||
assert(m1.nb_cols() == m2.nb_cols() && m1.nb_rows() == m2.nb_rows()); | ||
IntervalMatrix m3(m1); | ||
|
||
for(int i = 0; i < m1.nb_rows(); i++) | ||
for(int j = 0; j < m2.nb_cols(); j++) | ||
m3[i][j] |= m2[i][j]; | ||
|
||
return m3; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* \file | ||
* Arithmetic operations on matrices | ||
* ---------------------------------------------------------------------------- | ||
* \date 2022 | ||
* \author Simon Rohou | ||
* \copyright Copyright 2022 Codac Team | ||
* \license This program is distributed under the terms of | ||
* the GNU Lesser General Public License (LGPL). | ||
*/ | ||
|
||
#ifndef __CODAC_MATRIX_ARITHMETIC_H__ | ||
#define __CODAC_MATRIX_ARITHMETIC_H__ | ||
|
||
#include "codac_IntervalMatrix.h" | ||
|
||
namespace codac | ||
{ | ||
/** \brief \f$[\mathbf{X}]\sqcup[\mathbf{Y}]\f$ | ||
* \param x | ||
* \param y | ||
* \return IntervalMatrix output | ||
*/ | ||
const IntervalMatrix operator|(const IntervalMatrix& x, const IntervalMatrix& y); | ||
|
||
/** \brief \f$[\mathbf{X}]\cap[\mathbf{Y}]\f$ | ||
* \param x | ||
* \param y | ||
* \return IntervalMatrix output | ||
*/ | ||
const IntervalMatrix operator&(const IntervalMatrix& x, const IntervalMatrix& y); | ||
} | ||
|
||
#endif |