Skip to content

Commit

Permalink
Remove CurveFitting dependency in SINQ library.
Browse files Browse the repository at this point in the history
The constraints are now created using the factory in API rather than
linking directly.
Refs #8364
  • Loading branch information
martyngigg committed Nov 8, 2013
1 parent c50d276 commit 9a793bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/SINQ/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ set_target_properties ( SINQ PROPERTIES OUTPUT_NAME MantidSINQ
# Add to the 'Framework' group in VS
set_property ( TARGET SINQ PROPERTY FOLDER "MantidFramework" )

include_directories ( inc ../MDEvents/inc ../CurveFitting/inc ) # todo: Need to remove CurveFitting link
include_directories ( inc ../MDEvents/inc )

target_link_libraries ( SINQ ${MANTIDLIBS} MDEvents CurveFitting )
target_link_libraries ( SINQ ${MANTIDLIBS} MDEvents )

# Add the unit tests directory
add_subdirectory ( test )
Expand Down
10 changes: 5 additions & 5 deletions Code/Mantid/Framework/SINQ/src/PoldiPeakDetection2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ wiki page of [[PoldiProjectRun]].
#include "MantidAPI/TableRow.h"
#include "MantidAPI/FunctionFactory.h"
#include "MantidAPI/IPeakFunction.h"

#include "MantidCurveFitting/BoundaryConstraint.h"
#include "MantidAPI/ConstraintFactory.h"

#include <boost/shared_ptr.hpp>

Expand Down Expand Up @@ -252,12 +251,13 @@ bool PoldiPeakDetection2::doFitGaussianPeak(DataObjects::Workspace2D_sptr dataws
// 3. Constraint
double centerleftend = center-sigma*0.5;
double centerrightend = center+sigma*0.5;
auto * centerbound = new CurveFitting::BoundaryConstraint(gaussianpeak.get(), "PeakCentre", centerleftend, centerrightend, false);
std::ostringstream os;
os << centerleftend << " < PeakCentre < " << centerrightend;
auto * centerbound = API::ConstraintFactory::Instance().createInitialized(gaussianpeak.get(), os.str(), false);
gaussianpeak->addConstraint(centerbound);

// 4. Fit
API::IAlgorithm_sptr fitalg = createChildAlgorithm("Fit", -1, -1, true);
// API::IAlgorithm_sptr fitalg = createSubAlgorithm("Fit", -1, -1, true);
API::IAlgorithm_sptr fitalg = createChildAlgorithm("Fit", -1, -1, true);
fitalg->initialize();

fitalg->setProperty("Function", boost::dynamic_pointer_cast<API::IFunction>(gaussianpeak));
Expand Down

0 comments on commit 9a793bf

Please sign in to comment.