Commit b8c34ae8 authored by Kristin's avatar Kristin Committed by Jesse Mapel
Browse files

Removed unused Parabola class

parent 5ff7e854
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
	echo "Please set ISISROOT";
else
	include $(ISISROOT)/make/isismake.objs
endif
 No newline at end of file
+0 −57
Original line number Diff line number Diff line
/**
 * @file
 * $Revision: 1.1.1.1 $
 * $Date: 2006/10/31 23:18:08 $
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are public
 *   domain. See individual third-party library and package descriptions for
 *   intellectual property information,user agreements, and related information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or implied,
 *   is made by the USGS as to the accuracy and functioning of such software
 *   and related material nor shall the fact of distribution constitute any such
 *   warranty, and no responsibility is assumed by the USGS in connection
 *   therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see
 *   the Privacy & Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */

#include <iostream>
#include <sstream>
#include "FileName.h"
#include "Constants.h"
#include "IException.h"
#include "Parabola.h"

namespace Isis {

  /**
   * This is the the overriding virtual function that provides the expansion into
   * the parabolic equation.
   * See BasisFunction for more information.
   *
   * @param vars A vector of double values to use for the expansion.
   */
  void Parabola::Expand(const std::vector<double> &vars) {

    if((int) vars.size() != Variables()) {
      std::ostringstream msg;
      msg << "Number of variables given (" << vars.size()
          << ") does not match expected (" << Variables() << ")!"
          << std::ends;
//      std::cout << msg.str << std::endl;
//      throw Isis::iException::Message("Isis::iException::Programmer",msg.str,
//        _FILEINFO_);
    }
    p_terms.clear();
    p_terms.push_back(1.0);
    p_terms.push_back(vars[0]);
    p_terms.push_back(vars[0] * vars[0]);
    return;
  }
} // end namespace isis
+0 −68
Original line number Diff line number Diff line

#ifndef Parabola_h
#define Parabola_h
/**
 * @file
 * $Revision: 1.1.1.1 $
 * $Date: 2006/10/31 23:18:08 $
 *
 *   Unless noted otherwise, the portions of Isis written by the USGS are public
 *   domain. See individual third-party library and package descriptions for
 *   intellectual property information,user agreements, and related information.
 *
 *   Although Isis has been used by the USGS, no warranty, expressed or implied,
 *   is made by the USGS as to the accuracy and functioning of such software
 *   and related material nor shall the fact of distribution constitute any such
 *   warranty, and no responsibility is assumed by the USGS in connection
 *   therewith.
 *
 *   For additional information, launch
 *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see
 *   the Privacy &amp; Disclaimers page on the Isis website,
 *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
 *   http://www.usgs.gov/privacy.html.
 */

#include <vector>
#include "BasisFunction.h"

namespace Isis {

  /**
   * @brief Parabola basis function
   *
   * This is a derived class from the BasisFunction class which creates a parabola
   * (second degree equation in 1 variable).  The parabolic function has the
   * following form:
   *
   * @f[
   *   x = A + B*y + C*y**2
   * @f]
   *
   * @ingroup Math
   *
   * @author  2005-06-09 Kris Becker
   *
   * @internal
   *  @history 2006-04-15 Debbie A. Cook - Imported from ISIS2 to Isis 3
   */

  class Parabola : public Isis::BasisFunction {
    public:
      //! Create a Parabola object

      // Get help to figure out why I have to pass the name in even with the
      // default set
      Parabola(const QString &bname = "Parabola") :
        Isis::BasisFunction(bname, 1, 3) { }

      //! Destroys the Parabola object
      ~Parabola() {}

      void Expand(const std::vector<double> &vars);

  };

}
#endif
+0 −16
Original line number Diff line number Diff line
Name   = Parabola
Ncoefs = 3
Vars   = 1
-6
5
1
---
8
1
2
4
---
-12
1
-2
4
+0 −39
Original line number Diff line number Diff line
#include "Parabola.h"
#include <iostream>
#include "Preference.h"

using namespace Isis;
using namespace std;

int main() {
  Preference::Preferences(true);

  Parabola b("Parabola");
  vector<double> coefs;
  coefs.push_back(-6.0);
  coefs.push_back(5.0);
  coefs.push_back(1.0);
  b.SetCoefficients(coefs);

  cout << "Name   = " << b.Name() << endl;
  cout << "Ncoefs = " << b.Coefficients() << endl;
  cout << "Vars   = " << b.Variables() << endl;
  for(int i = 0; i < b.Coefficients(); i++) {
    cout << b.Coefficient(i) << endl;
  }

  cout << "---" << endl;
  vector<double> vars;
  vars.push_back(2.0);
  cout << b.Evaluate(vars) << endl;
  for(int i = 0; i < b.Coefficients(); i++) {
    cout << b.Term(i) << endl;
  }

  cout << "---" << endl;
  vars[0] = -2.0;
  cout << b.Evaluate(vars) << endl;
  for(int i = 0; i < b.Coefficients(); i++) {
    cout << b.Term(i) << endl;
  }
}