Commit 51211068 authored by Bryan Berthou's avatar Bryan Berthou
Browse files

refs#16 Reverted to revision 686.

parent 9e4f7810
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>NumA++</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (1).launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<project name="NumA++">
<property name="build" location="${basedir}/build" />
<record name="${build}/build.log" loglevel="debug" action="start" />
<target name="clean">
<delete dir="${build}/CMakeFiles" />
<delete file="${build}/cmake_install.cmake" />
<delete file="${build}/Makefile" />
<delete file="${build}/CMakeCache.txt" />
</target>
<target name="cmake">
<exec executable="cmake" failonerror="true" dir="${build}">
<arg value="-GUnix Makefiles" />
<arg value="${basedir}" />
<arg value="-DCMAKE_BUILD_TYPE=Debug" />
<arg value="-DROOT_HOME=/usr" />
</exec>
</target>
<target name="build" depends="cmake">
<exec executable="make" failonerror="true" dir="${build}" />
</target>
</project>
\ No newline at end of file
#ifndef FUNCTION_TYPE_VM
#define FUNCTION_TYPE_VM
/**
* @file FunctionTypeVM.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @author Nabil CHOUIKA (SPhN / CEA Saclay)
* @date 28 April 2016
* @version 1.0
*/
#include <vector>
#include "../linear_algebra/vector/VectorD.h"
#include "../linear_algebra/matrix/MatrixD.h"
namespace NumA {
/**
* @class FunctionTypeVM
*
* @brief
*/
class FunctionTypeVM {
public:
FunctionTypeVM() {
}
virtual ~FunctionTypeVM() {
}
virtual MatrixD operator()(const VectorD & x, const std::vector<double> &parameters) = 0;
};
} // namespace NumA
#endif /* FUNCTION_TYPE_VM */
#ifndef FUNCTION_TYPE_VV
#define FUNCTION_TYPE_VV
/**
* @file FunctionTypeVV.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @author Nabil CHOUIKA (SPhN / CEA Saclay)
* @date 28 April 2016
* @version 1.0
*/
#include <vector>
#include "../linear_algebra/vector/VectorD.h"
namespace NumA {
/**
* @class FunctionTypeVV
*
* @brief
*/
class FunctionTypeVV {
public:
FunctionTypeVV() {
}
virtual ~FunctionTypeVV() {
}
virtual VectorD operator()(const VectorD & x, const std::vector<double> &parameters) = 0;
};
} // namespace NumA
#endif /* FUNCTION_TYPE_VV */
/**
* @file FunctorUtils.h
* @author Nabil CHOUIKA (SPhN / CEA Saclay)
* @date 28 April 2016
* @version 1.0
*/
#ifndef FUNCTORUTILS_H_
#define FUNCTORUTILS_H_
#include "Functor1D.h"
#include "FunctorVM.h"
#include "FunctorVV.h"
namespace NumA {
/**
* @class FunctorUtils
* @brief
*/
class FunctorUtils {
public:
template<typename PointerToObj, typename PointerToMemFn>
static Functor1D<PointerToObj, PointerToMemFn>* newFunctor1D(
PointerToObj* object, PointerToMemFn function) {
return new Functor1D<PointerToObj, PointerToMemFn>(object, function);
}
template<typename PointerToObj, typename PointerToMemFn>
static FunctorVV<PointerToObj, PointerToMemFn>* newFunctorVV(
PointerToObj* object, PointerToMemFn function) {
return new FunctorVV<PointerToObj, PointerToMemFn>(object, function);
}
template<typename PointerToObj, typename PointerToMemFn>
static FunctorVM<PointerToObj, PointerToMemFn>* newFunctorVM(
PointerToObj* object, PointerToMemFn function) {
return new FunctorVM<PointerToObj, PointerToMemFn>(object, function);
}
};
} /* namespace NumA */
#endif /* FUNCTORUTILS_H_ */
#ifndef FUNCTOR_VM
#define FUNCTOR_VM
/**
* @file FunctorVM.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @author Nabil CHOUIKA (SPhN / CEA Saclay)
* @date 28 April 2016
* @version 1.0
*/
#include <vector>
#include "FunctionTypeVM.h"
namespace NumA {
/**
* @class FunctorVM
*
* @brief
*/
template<typename PointerToObj, typename PointerToFunc>
class FunctorVM: public FunctionTypeVM {
public:
FunctorVM(PointerToObj* object, PointerToFunc function) :
m_pObject(object), m_pFunction(function) {
}
virtual ~FunctorVM() {
}
inline MatrixD operator()(const VectorD & x, const std::vector<double> &parameters) {
return ((*m_pObject).*m_pFunction)(x, parameters);
}
private:
PointerToObj* m_pObject;
PointerToFunc m_pFunction;
////////////////////////////////////////////////////////////
/// Disallow copy & comparisons
////////////////////////////////////////////////////////////
FunctorVM(const FunctorVM&); // Not implemented
FunctorVM& operator=(const FunctorVM&); // Not implemented
};
} // namespace NumA
#endif /* FUNCTOR_VM */
#ifndef FUNCTOR_VV
#define FUNCTOR_VV
/**
* @file FunctorVV.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @author Nabil CHOUIKA (SPhN / CEA Saclay)
* @date 28 April 2016
* @version 1.0
*/
#include <vector>
#include "FunctionTypeVV.h"
namespace NumA {
/**
* @class FunctorVV
*
* @brief
*/
template<typename PointerToObj, typename PointerToFunc>
class FunctorVV: public FunctionTypeVV {
public:
FunctorVV(PointerToObj* object, PointerToFunc function) :
m_pObject(object), m_pFunction(function) {
}
virtual ~FunctorVV() {
}
inline VectorD operator()(const VectorD & x, const std::vector<double> &parameters) {
return ((*m_pObject).*m_pFunction)(x, parameters);
}
private:
PointerToObj* m_pObject;
PointerToFunc m_pFunction;
////////////////////////////////////////////////////////////
/// Disallow copy & comparisons
////////////////////////////////////////////////////////////
FunctorVV(const FunctorVV&); // Not implemented
FunctorVV& operator=(const FunctorVV&); // Not implemented
};
} // namespace NumA
#endif /* FUNCTOR_VV */
#ifndef INTEGRATOR_1D_H
#define INTEGRATOR_1D_H
/**
* @file Integrator1D.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @date 15 February 2016
* @version 1.0
*/
#include <string>
#include <vector>
//#include "../../functors/Functor1D.h"
#include "../../utils/Errors.h"
#include "../../utils/Tolerances.h"
#include "IntegratorType1D.h"
namespace NumA {
class FunctionType1D;
} /* namespace NumA */
namespace ElemUtils {
class Parameters;
} /* namespace ElemUtils */
namespace NumA {
/**
* @class Integrator1D
*
* @brief Abstract class for all integration routines.
*/
class Integrator1D {
public:
static const std::string PARAM_NAME_ABSOLUTE_TOLERANCE;
static const std::string PARAM_NAME_RELATIVE_TOLERANCE;
Integrator1D();
virtual ~Integrator1D();
virtual Integrator1D* clone() const = 0;
virtual double integrate(FunctionType1D* pFunction, double a, double b,
std::vector<double> &parameters) = 0;
virtual void configure(const ElemUtils::Parameters &parameters);
static Integrator1D* newIntegrator(
const IntegratorType1D::Type &oneDimIntegratorType);
// ##### GETTERS & SETTERS #####
const Tolerances& getTolerances() const;
void setTolerances(const Tolerances& tolerances);
const Errors& getErrors() const;
void setErrors(const Errors& errors);
protected:
Tolerances m_tolerances;
Errors m_errors;
Integrator1D(const Integrator1D &other);
};
} // namespace NumA
#endif /* INTEGRATOR_1D_H */
#include "../../../../include/NumA/integration/one_dimension/QuadratureIntegrator1D.h"
//#include <ElementaryUtils/parameters/GenericType.h>
#include <ElementaryUtils/parameters/Parameters.h>
#include "../../../../include/NumA/functors/FunctionType1D.h"
namespace NumA {
const std::string QuadratureIntegrator1D::PARAM_NAME_N = "numberOfNodes";
QuadratureIntegrator1D::QuadratureIntegrator1D(unsigned int N) :
Integrator1D(), m_N(N) {
}
QuadratureIntegrator1D::QuadratureIntegrator1D(
const QuadratureIntegrator1D &other) :
Integrator1D(other) {
m_nodes = other.m_nodes;
m_weights = other.m_weights;
m_N = other.m_N;
}
QuadratureIntegrator1D::~QuadratureIntegrator1D() {
}
double QuadratureIntegrator1D::integrate(FunctionType1D* pFunction, double a,
double b, std::vector<double>& parameters) {
double result = 0., x = 0.;
// Shifting integration interval to [-1;1]
double c, d;
d = (a + b) * 0.5;
c = (b - a) * 0.5;
// Entering the loop
for (unsigned int i = 0; i < m_nodes.size(); i++) {
x = d + c * m_nodes[i];
result += ((*pFunction)(x, parameters)) * m_weights[i];
}
// Multiplying by the step at the end to save computing time
result = result * c;
return result;
}
void QuadratureIntegrator1D::configure(const ElemUtils::Parameters &parameters) {
Integrator1D::configure(parameters);
if (parameters.isAvailable(QuadratureIntegrator1D::PARAM_NAME_N)) {
setN(parameters.getLastAvailable().toUInt());
}
}
unsigned int QuadratureIntegrator1D::getN() const {
return m_N;
}
const std::vector<double>& QuadratureIntegrator1D::getNodes() const {
return m_nodes;
}
const std::vector<double>& QuadratureIntegrator1D::getWeights() const {
return m_weights;
}
} // namespace NumA
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.so.debug.268917433">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.so.debug.268917433" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/NumA++"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/NumA++/Debug"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/NumA++"/>
<entry flags="RESOLVED" kind="libraryFile" name="NumA++" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.so.debug.268917433" name="Debug" parent="cdt.managedbuild.config.gnu.so.debug">
<folderInfo id="cdt.managedbuild.config.gnu.so.debug.268917433." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.so.debug.313179161" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.so.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.so.debug.1546879730" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.so.debug"/>
<builder buildPath="${workspace_loc:/NumA++}" id="cdt.managedbuild.target.gnu.builder.so.debug.54502403" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.so.debug"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1680042854" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.716919598" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.so.debug">
<option id="gnu.cpp.compiler.so.debug.option.optimization.level.1953895208" name="Optimization Level" superClass="gnu.cpp.compiler.so.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.so.debug.option.debugging.level.48377409" name="Debug Level" superClass="gnu.cpp.compiler.so.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.other.pic.1348297619" name="Position Independent Code (-fPIC)" superClass="gnu.cpp.compiler.option.other.pic" value="true" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.include.paths.1123292064" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;../${EIGEN_INCLUDE_DIR}&quot;"/>
<listOptionValue builtIn="false" value="&quot;../${ROOT_INCLUDE_DIR}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/ElementaryUtils/include}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1517022876" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.so.debug.434667659" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.so.debug.option.optimization.level.1194413988" name="Optimization Level" superClass="gnu.c.compiler.so.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.so.debug.option.debugging.level.172208605" name="Debug Level" superClass="gnu.c.compiler.so.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1729313613" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.so.debug.1023219015" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.so.debug">
<option defaultValue="true" id="gnu.c.link.so.debug.option.shared.71651028" name="Shared (-shared)" superClass="gnu.c.link.so.debug.option.shared" valueType="boolean"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.so.debug.25565819" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.so.debug">
<option defaultValue="true" id="gnu.cpp.link.so.debug.option.shared.1044971448" name="Shared (-shared)" superClass="gnu.cpp.link.so.debug.option.shared" valueType="boolean"/>
<option id="gnu.cpp.link.option.paths.1271225687" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths"/>
<option id="gnu.cpp.link.option.libs.305271451" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1255548896" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.so.debug.605304475" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.so.debug">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.790604425" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="CMakeFiles" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="NumA++.cdt.managedbuild.target.gnu.so.890648310" name="Shared Library" projectType="cdt.managedbuild.target.gnu.so"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.debug.268917433;cdt.managedbuild.config.gnu.so.debug.268917433.;cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.716919598;cdt.managedbuild.tool.gnu.cpp.compiler.input.1517022876">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.debug.268917433;cdt.managedbuild.config.gnu.so.debug.268917433.;cdt.managedbuild.tool.gnu.c.compiler.so.debug.434667659;cdt.managedbuild.tool.gnu.c.compiler.input.1729313613">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.release.1236619972;cdt.managedbuild.config.gnu.so.release.1236619972.;cdt.managedbuild.tool.gnu.c.compiler.so.release.511618330;cdt.managedbuild.tool.gnu.c.compiler.input.1954696730">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.so.release.1236619972;cdt.managedbuild.config.gnu.so.release.1236619972.;cdt.managedbuild.tool.gnu.cpp.compiler.so.release.692453438;cdt.managedbuild.tool.gnu.cpp.compiler.input.66031832">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/NumA++"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/NumA++"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.cdt.managedbuilder.core.genmakebuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>NumA++</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (1).launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
cmake_minimum_required(VERSION 2.6)
#Configuration du projet