Commit be1b799c authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #15702. Fix clang format.

parent e8575498
......@@ -776,7 +776,8 @@ size_t CompositeFunction::getNumberDomains() const {
/// working on (== getNumberDomains()). The result of evaluation of the
/// created functions on their domains must be the same as if this function
/// was evaluated on the composition of those domains.
std::vector<IFunction_sptr> CompositeFunction::createEquivalentFunctions() const {
std::vector<IFunction_sptr>
CompositeFunction::createEquivalentFunctions() const {
auto nd = getNumberDomains();
if (nd == 1) {
return std::vector<IFunction_sptr>(
......@@ -786,16 +787,16 @@ std::vector<IFunction_sptr> CompositeFunction::createEquivalentFunctions() const
auto nf = nFunctions();
std::vector<std::vector<IFunction_sptr>> equiv;
equiv.reserve(nf);
for(size_t i = 0; i < nf; ++i) {
for (size_t i = 0; i < nf; ++i) {
equiv.push_back(getFunction(i)->createEquivalentFunctions());
}
std::vector<IFunction_sptr> funs;
funs.reserve(nd);
for(size_t i = 0; i < nd; ++i) {
for (size_t i = 0; i < nd; ++i) {
auto comp = new CompositeFunction;
funs.push_back(IFunction_sptr(comp));
for(size_t j = 0; j < nf; ++j) {
for (size_t j = 0; j < nf; ++j) {
comp->addFunction(equiv[j][i]);
}
}
......
......@@ -48,11 +48,13 @@ private:
/// Build a function for a single spectrum.
API::IFunction_sptr buildSpectrum(int nre, const DoubleFortranVector &en,
const ComplexFortranMatrix &wf,
double temperature, double fwhm, size_t i) const;
double temperature, double fwhm,
size_t i) const;
/// Update a function for a single spectrum.
void updateSpectrum(API::IFunction &spectrum, int nre,
const DoubleFortranVector &en,
const ComplexFortranMatrix &wf, double temperature, size_t i) const;
const ComplexFortranMatrix &wf, double temperature,
size_t i) const;
/// Calculate excitations at given temperature
void calcExcitations(int nre, const DoubleFortranVector &en,
const ComplexFortranMatrix &wf, double temperature,
......
......@@ -90,7 +90,7 @@ void CrystalFieldMultiSpectrum::setAttribute(const std::string &name,
if (name == "Temperatures") {
// Define (declare) the parameters for intensity scaling.
auto nSpec = attr.asVector().size();
dynamic_cast<Peaks&>(*m_source).declareIntensityScaling(nSpec);
dynamic_cast<Peaks &>(*m_source).declareIntensityScaling(nSpec);
m_nOwnParams = m_source->nParams();
}
FunctionGenerator::setAttribute(name, attr);
......
......@@ -233,9 +233,8 @@ public:
private:
bool run(int nre, const std::map<std::string, double> &bkq,
const std::map<std::string, double> &bme,
GSLVector &evalues, ComplexMatrix &evectors,
ComplexMatrix &hamiltonian) {
const std::map<std::string, double> &bme, GSLVector &evalues,
ComplexMatrix &evectors, ComplexMatrix &hamiltonian) {
CrystalFieldEnergies alg;
alg.setChild(true);
TS_ASSERT_THROWS_NOTHING(alg.initialize())
......
......@@ -54,7 +54,8 @@ public:
/// Get a named attribute value
static PyObject *getAttributeValue(IFunction &self, const std::string &name);
/// Returns the attribute's value as a Python object
static PyObject *getAttributeValue(IFunction &self, const API::IFunction::Attribute &attr);
static PyObject *getAttributeValue(IFunction &self,
const API::IFunction::Attribute &attr);
/// Called by the framework when an attribute has been set
void setAttribute(const std::string &attName,
const API::IFunction::Attribute &attr) override;
......
......@@ -13,10 +13,10 @@ void export_CompositeFunction() {
"Get the number of member functions.")
.def("__len__", &CompositeFunction::nFunctions, arg("self"),
"Get the number of member functions.")
.def("getFunction", &CompositeFunction::getFunction, (arg("self"), arg("i")),
"Get the i-th function.")
.def("__getitem__", &CompositeFunction::getFunction, (arg("self"), arg("i")),
"Get the i-th function.")
.def("add", &CompositeFunction::addFunction, (arg("self"), arg("function")),
"Add a member function.");
.def("getFunction", &CompositeFunction::getFunction,
(arg("self"), arg("i")), "Get the i-th function.")
.def("__getitem__", &CompositeFunction::getFunction,
(arg("self"), arg("i")), "Get the i-th function.")
.def("add", &CompositeFunction::addFunction,
(arg("self"), arg("function")), "Add a member function.");
}
......@@ -117,7 +117,8 @@ void export_IFunction() {
"Declare an attribute with an initial value")
.def("getAttributeValue",
(PyObject* (*)(IFunction&,const std::string&))IFunctionAdapter::getAttributeValue,
(PyObject * (*)(IFunction &, const std::string &))
IFunctionAdapter::getAttributeValue,
(arg("self"), arg("name")),
"Return the value of the named attribute")
......
......@@ -98,7 +98,8 @@ void IFunctionAdapter::declareAttribute(const std::string &name,
* @param name :: The name of the new attribute
* @returns The value of the attribute
*/
PyObject *IFunctionAdapter::getAttributeValue(IFunction &self, const std::string &name) {
PyObject *IFunctionAdapter::getAttributeValue(IFunction &self,
const std::string &name) {
auto attr = self.getAttribute(name);
return getAttributeValue(self, attr);
}
......@@ -109,7 +110,8 @@ PyObject *IFunctionAdapter::getAttributeValue(IFunction &self, const std::string
* @returns The value of the attribute
*/
PyObject *
IFunctionAdapter::getAttributeValue(IFunction &self, const API::IFunction::Attribute &attr) {
IFunctionAdapter::getAttributeValue(IFunction &self,
const API::IFunction::Attribute &attr) {
std::string type = attr.type();
PyObject *result(nullptr);
if (type == "int")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment