-
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.
[ctc] added cpp files for CtcBox, CtcCartProd
- Loading branch information
1 parent
01a4d84
commit 5de05eb
Showing
5 changed files
with
63 additions
and
27 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* CtcBox class | ||
* ---------------------------------------------------------------------------- | ||
* \date 2022 | ||
* \author Quentin Brateau | ||
* \copyright Copyright 2022 Codac Team | ||
* \license This program is distributed under the terms of | ||
* the GNU Lesser General Public License (LGPL). | ||
*/ | ||
|
||
#include "codac_CtcBox.h" | ||
|
||
using namespace std; | ||
|
||
namespace codac | ||
{ | ||
void CtcBox::contract(IntervalVector& x) | ||
{ | ||
// Checking the dimension of the input box | ||
assert(_b.size() == x.size()); | ||
|
||
// Contracting the input box around the support box | ||
x &= _b; | ||
} | ||
} |
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,35 @@ | ||
/** | ||
* CtcCartProd class | ||
* ---------------------------------------------------------------------------- | ||
* \date 2022 | ||
* \author Quentin Brateau | ||
* \copyright Copyright 2022 Codac Team | ||
* \license This program is distributed under the terms of | ||
* the GNU Lesser General Public License (LGPL). | ||
*/ | ||
|
||
#include "codac_CtcCartProd.h" | ||
|
||
using namespace std; | ||
|
||
namespace codac | ||
{ | ||
void CtcCartProd::contract(IntervalVector& x) | ||
{ | ||
std::size_t index = 0; | ||
for (int i=0; i < m_v.size(); i++) { | ||
IntervalVector sx(m_v[i].nb_var); | ||
for (int k=0; k < m_v[i].nb_var; k++) { | ||
sx[k] = x[index + k]; | ||
} | ||
m_v[i].contract(sx); | ||
x.put(index, sx); | ||
index += m_v[i].nb_var; | ||
} | ||
} | ||
|
||
CtcCartProd cart_prod(const ibex::Array<Ctc>& array) | ||
{ | ||
return CtcCartProd(array); | ||
} | ||
} |
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