3
3
* @file MetaModelAlgorithm.cxx
4
4
* @brief Interface for regression methods
6
* (C) Copyright 2005-2007 EDF-EADS-Phimeca
6
* (C) Copyright 2005-2010 EDF-EADS-Phimeca
8
8
* This library is free software; you can redistribute it and/or
9
9
* modify it under the terms of the GNU Lesser General Public
38
38
MetaModelAlgorithm::MetaModelAlgorithm(const NumericalSample & dataIn,
39
39
const NumericalMathFunction & inputFunction,
40
40
const String & name)
41
throw(InvalidArgumentException):
42
PersistentObject(name),
44
dataOut_(NumericalSample(0, inputFunction.getOutputNumericalPointDimension())),
45
inputFunction_(inputFunction)
41
/* throw(InvalidArgumentException) */
42
: PersistentObject(name),
44
dataOut_(NumericalSample(0, inputFunction.getOutputDimension())),
45
inputFunction_(inputFunction)
47
47
if (!inputFunction.getEvaluationImplementation()->isActualImplementation()) throw InvalidArgumentException(HERE) << "Error: the given function must have an actual implementation";
48
if (inputFunction.getInputNumericalPointDimension() != dataIn.getDimension()) throw InvalidArgumentException(HERE) << "Error: the input data dimension and the input dimension of the function must be the same, here input dimension=" << dataIn.getDimension() << " and input dimension of the function=" << inputFunction.getInputNumericalPointDimension();
48
if (inputFunction.getInputDimension() != dataIn.getDimension()) throw InvalidArgumentException(HERE) << "Error: the input data dimension and the input dimension of the function must be the same, here input dimension=" << dataIn.getDimension() << " and input dimension of the function=" << inputFunction.getInputDimension();
51
51
/* Constructor with parameters */
52
52
MetaModelAlgorithm::MetaModelAlgorithm(const NumericalSample & dataIn,
53
53
const NumericalSample & dataOut,
54
54
const String & name)
55
throw(InvalidArgumentException):
56
PersistentObject(name),
58
dataOut_(NumericalSample(0, dataOut.getDimension())),
59
inputFunction_(NumericalMathFunction())
55
/* throw(InvalidArgumentException) */
56
: PersistentObject(name),
58
dataOut_(NumericalSample(0, dataOut.getDimension())),
59
inputFunction_(NumericalMathFunction())
61
61
setDataOut(dataOut);
98
98
void MetaModelAlgorithm::setDataOut(const NumericalSample & dataOut)
99
throw(InvalidArgumentException)
99
/* throw(InvalidArgumentException) */
101
101
if (inputFunction_.getEvaluationImplementation()->isActualImplementation()) throw InvalidArgumentException(HERE) << "Error: cannot set the output data in a response surface defined with a function, here function=" << inputFunction_;
102
102
if (dataOut.getSize() != dataIn_.getSize()) throw InvalidArgumentException(HERE) << "Error: the output data must have the same size than the input data, here output size=" << dataOut.getSize() << " and input size=" << dataIn_.getSize();