Changeset 890 for trunk/src/SDFitter.cc


Ignore:
Timestamp:
03/08/06 13:32:27 (18 years ago)
Author:
mar637
Message:

asap2 naming changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDFitter.cc

    r612 r890  
    11//#---------------------------------------------------------------------------
    2 //# SDFitter.cc: A Fitter class for spectra
     2//# Fitter.cc: A Fitter class for spectra
    33//#--------------------------------------------------------------------------
    44//# Copyright (C) 2004
     
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:
     29//# $Id:$
    3030//#---------------------------------------------------------------------------
    3131#include <casa/aips.h>
     
    4747using namespace casa;
    4848
    49 SDFitter::SDFitter()
    50 {
    51 }
    52 
    53 SDFitter::~SDFitter()
     49Fitter::Fitter()
     50{
     51}
     52
     53Fitter::~Fitter()
    5454{
    5555  reset();
    5656}
    5757
    58 void SDFitter::clear()
     58void Fitter::clear()
    5959{
    6060  for (uInt i=0;i< funcs_.nelements();++i) {
     
    6969}
    7070
    71 void SDFitter::reset()
     71void Fitter::reset()
    7272{
    7373  clear();
     
    7878
    7979
    80 bool SDFitter::computeEstimate() {
     80bool Fitter::computeEstimate() {
    8181  if (x_.nelements() == 0 || y_.nelements() == 0)
    8282    throw (AipsError("No x/y data specified."));
     
    122122}
    123123
    124 std::vector<float> SDFitter::getEstimate() const
     124std::vector<float> Fitter::getEstimate() const
    125125{
    126126  if (estimate_.nelements() == 0)
     
    132132
    133133
    134 bool SDFitter::setExpression(const std::string& expr, int ncomp)
     134bool Fitter::setExpression(const std::string& expr, int ncomp)
    135135{
    136136  clear();
     
    154154}
    155155
    156 bool SDFitter::setData(std::vector<float> absc, std::vector<float> spec,
     156bool Fitter::setData(std::vector<float> absc, std::vector<float> spec,
    157157                       std::vector<bool> mask)
    158158{
     
    171171}
    172172
    173 std::vector<float> SDFitter::getResidual() const
     173std::vector<float> Fitter::getResidual() const
    174174{
    175175    if (residual_.nelements() == 0)
     
    180180}
    181181
    182 std::vector<float> SDFitter::getFit() const
     182std::vector<float> Fitter::getFit() const
    183183{
    184184    Vector<Float> out = thefit_;
     
    189189}
    190190
    191 std::vector<float> SDFitter::getErrors() const
     191std::vector<float> Fitter::getErrors() const
    192192{
    193193    Vector<Float> out = error_;
     
    197197}
    198198
    199 bool SDFitter::setParameters(std::vector<float> params)
     199bool Fitter::setParameters(std::vector<float> params)
    200200{
    201201    Vector<Float> tmppar(params);
     
    226226}
    227227
    228 bool SDFitter::setFixedParameters(std::vector<bool> fixed)
     228bool Fitter::setFixedParameters(std::vector<bool> fixed)
    229229{
    230230    Vector<Bool> tmp(fixed);
     
    252252}
    253253
    254 std::vector<float> SDFitter::getParameters() const {
     254std::vector<float> Fitter::getParameters() const {
    255255    Vector<Float> out = parameters_;
    256256    std::vector<float> stlout;
     
    259259}
    260260
    261 std::vector<bool> SDFitter::getFixedParameters() const {
     261std::vector<bool> Fitter::getFixedParameters() const {
    262262  Vector<Bool> out(parameters_.nelements());
    263263  if (fixedpar_.nelements() == 0) {
     
    272272}
    273273
    274 float SDFitter::getChisquared() const {
     274float Fitter::getChisquared() const {
    275275    return chisquared_;
    276276}
    277277
    278 bool SDFitter::fit() {
     278bool Fitter::fit() {
    279279  NonLinearFitLM<Float> fitter;
    280280  CompoundFunction<Float> func;
     
    293293  Vector<Float> sigma(x_.nelements());
    294294  sigma = 1.0;
    295  
     295
    296296  parameters_.resize();
    297297  parameters_ = fitter.fit(x_, y_, sigma, &m_);
     
    304304
    305305  chisquared_ = fitter.getChi2();
    306  
     306
    307307  residual_.resize();
    308308  residual_ =  y_;
     
    316316
    317317
    318 std::vector<float> SDFitter::evaluate(int whichComp) const
    319 { 
     318std::vector<float> Fitter::evaluate(int whichComp) const
     319{
    320320  std::vector<float> stlout;
    321   uInt idx = uInt(whichComp); 
     321  uInt idx = uInt(whichComp);
    322322  Float y;
    323323  if ( idx < funcs_.nelements() ) {
Note: See TracChangeset for help on using the changeset viewer.