-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b40bd78
commit 43ca81d
Showing
16 changed files
with
462 additions
and
73 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
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,94 @@ | ||
// -*- C++ -*- | ||
/** | ||
* @brief SlicedInverseRegressionResult | ||
* | ||
* Copyright 2005-2024 Airbus-EDF-IMACS-ONERA-Phimeca | ||
* | ||
* This library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
#include "otsliced/SlicedInverseRegressionResult.hxx" | ||
|
||
#include <openturns/PersistentObjectFactory.hxx> | ||
#include <openturns/LinearFunction.hxx> | ||
|
||
using namespace OT; | ||
|
||
namespace OTSLICED | ||
{ | ||
|
||
CLASSNAMEINIT(SlicedInverseRegressionResult); | ||
|
||
static Factory<SlicedInverseRegressionResult> Factory_SlicedInverseRegressionResult; | ||
|
||
|
||
/* Default constructor */ | ||
SlicedInverseRegressionResult::SlicedInverseRegressionResult() | ||
: PersistentObject() | ||
{ | ||
// Nothing to do | ||
} | ||
|
||
SlicedInverseRegressionResult::SlicedInverseRegressionResult(const OT::Matrix & basis, | ||
const OT::Point & center) | ||
: PersistentObject() | ||
, basis_(basis) | ||
, center_(center) | ||
{ | ||
} | ||
|
||
/* Virtual constructor method */ | ||
SlicedInverseRegressionResult * SlicedInverseRegressionResult::clone() const | ||
{ | ||
return new SlicedInverseRegressionResult(*this); | ||
} | ||
|
||
/* String converter */ | ||
String SlicedInverseRegressionResult::__repr__() const | ||
{ | ||
OSS oss; | ||
oss << "class=" << SlicedInverseRegressionResult::GetClassName(); | ||
return oss; | ||
} | ||
|
||
Function SlicedInverseRegressionResult::getTransformation() const | ||
{ | ||
return LinearFunction(center_, Point(center_.getDimension()), basis_); | ||
} | ||
|
||
Function SlicedInverseRegressionResult::getInverseTransformation() const | ||
{ | ||
Matrix inv(basis_.solveLinearSystem(IdentityMatrix(center_.getDimension()))); | ||
return LinearFunction(-center_, Point(center_.getDimension()), inv); | ||
} | ||
|
||
/* Method save() stores the object through the StorageManager */ | ||
void SlicedInverseRegressionResult::save(Advocate & adv) const | ||
{ | ||
PersistentObject::save(adv); | ||
adv.saveAttribute( "basis_", basis_ ); | ||
adv.saveAttribute( "center_", center_ ); | ||
} | ||
|
||
/* Method load() reloads the object from the StorageManager */ | ||
void SlicedInverseRegressionResult::load(Advocate & adv) | ||
{ | ||
PersistentObject::load(adv); | ||
adv.loadAttribute( "basis_", basis_ ); | ||
adv.loadAttribute( "center_", center_ ); | ||
} | ||
|
||
|
||
} /* namespace OTSLICED */ |
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
Oops, something went wrong.