Commit 497126e9 authored by Ken Edmundson's avatar Ken Edmundson
Browse files

check-in in prep for Fedora 25 upgrade

parent ec41ad97
Loading
Loading
Loading
Loading
+91 −0
Original line number Diff line number Diff line
@@ -1796,6 +1796,25 @@ namespace Isis {
  }


  /**
   * A global function to format a LinearAlgebra::VectorCompressed as a QString and writes
   * it to a QDebug stream.
   *
   * @see toString(LinearAlgebra::VectorCompressed)
   *
   * @param dbg The stream where the vector will be written.
   * @param vector The vector to be written.
   *
   * @return @b QDebug The stream with the QString-formatted vector.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::VectorCompressed &vectorCompressed) {
    QDebugStateSaver saver(dbg);
    dbg.noquote() << toString(vectorCompressed);
    return dbg;
  }


  /**
   * A global function to format a LinearAlgebra::Matrix as a QString and 
   * write it to a QDebug stream. There will be 4 spaces between each matrix 
@@ -1820,6 +1839,78 @@ namespace Isis {
  }


  /**
   * A global function to format a LinearAlgebra::MatrixCompressed as a QString and
   * write it to a QDebug stream. There will be 4 spaces between each matrix
   * entry and each row is written on a new line.
   *
   * @param dbg The stream where the vector will be written.
   * @param matrix The matrix to be written.
   *
   * @return @b QDebug The stream with the QString-formatted matrix.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixCompressed &matrix) {
    QDebugStateSaver saver(dbg);
    for (unsigned int i = 0; i < matrix.size1(); i++) {
      dbg.noquote() << "    ";
      for (unsigned int j = 0; j < matrix.size2(); j++) {
        dbg.noquote() << toString(matrix(i, j), 15) << "     ";
      }
      dbg.noquote() << endl;
    }
    return dbg;
  }


  /**
   * A global function to format a LinearAlgebra::MatrixUpperTriangular as a QString and
   * write it to a QDebug stream. There will be 4 spaces between each matrix
   * entry and each row is written on a new line.
   *
   * @param dbg The stream where the vector will be written.
   * @param matrix The matrix to be written.
   *
   * @return @b QDebug The stream with the QString-formatted matrix.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixUpperTriangular &matrix) {
    QDebugStateSaver saver(dbg);
    for (unsigned int i = 0; i < matrix.size1(); i++) {
      dbg.noquote() << "    ";
      for (unsigned int j = 0; j < matrix.size2(); j++) {
        dbg.noquote() << toString(matrix(i, j), 15) << "     ";
      }
      dbg.noquote() << endl;
    }
    return dbg;
  }


  /**
   * A global function to format a LinearAlgebra::MatrixLowerTriangular as a QString and
   * write it to a QDebug stream. There will be 4 spaces between each matrix
   * entry and each row is written on a new line.
   *
   * @param dbg The stream where the vector will be written.
   * @param matrix The matrix to be written.
   *
   * @return @b QDebug The stream with the QString-formatted matrix.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixLowerTriangular &matrix) {
    QDebugStateSaver saver(dbg);
    for (unsigned int i = 0; i < matrix.size1(); i++) {
      dbg.noquote() << "    ";
      for (unsigned int j = 0; j < matrix.size2(); j++) {
        dbg.noquote() << toString(matrix(i, j), 15) << "     ";
      }
      dbg.noquote() << endl;
    }
    return dbg;
  }


  /**
   * A global function to format LinearAlgebra::Vector as a QString with the 
   * given precision. The string will be comma-separated entries encased by 
+19 −7
Original line number Diff line number Diff line
@@ -26,8 +26,9 @@
#include <iostream>

// boost library
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/symmetric.hpp>

// Qt Library
#include <QDebug>
@@ -103,25 +104,32 @@ namespace Isis {
  class LinearAlgebra {
    public:
      /**
       * Definition for an Isis::LinearAlgebra::Matrix of doubles. This is a 
       * typedef for a boost matrix. 
       * Definitions for various Isis::LinearAlgebra::Matrix of doubles. These are
       * typedefs for boost matrices.
       *  
       * Note: This typedef is used so that we can add functionality to an 
       * Note: These typedefs are used so that we can add functionality to an
       * existing matrix type and/or change which third party library's matrix
       * we are using without changing all references to this type in the ISIS
       * API. 
       */
      typedef boost::numeric::ublas::matrix<double> Matrix;
      typedef boost::numeric::ublas::compressed_matrix<double> MatrixCompressed;
      typedef boost::numeric::ublas::symmetric_matrix<double, boost::numeric::ublas::upper>
          MatrixUpperTriangular;
      typedef boost::numeric::ublas::symmetric_matrix<double, boost::numeric::ublas::lower>
          MatrixLowerTriangular;

      /**
       * Definition for an Isis::LinearAlgebra::Vector of doubles. This is a 
       * typedef for a boost vector. 
       * Definitions for various Isis::LinearAlgebra::Vector of doubles. These are
       * typedefs for boost vectors.
       *  
       * Note: This typedef is used so that we can add functionality to an 
       * Note: These typedefs are used so that we can add functionality to an
       * existing vector type and/or change which third party library's vector
       * we are using without changing all references to this type in the ISIS
       * API. 
       */
      typedef boost::numeric::ublas::vector<double> Vector;
      typedef boost::numeric::ublas::compressed_vector<double> VectorCompressed;

      // define AxisAngle and EulerAngle
      /**
@@ -227,7 +235,11 @@ namespace Isis {
  // these must be declared outside of the class (at the end since they must be
  // declared after the typedefs)
  QDebug operator<<(QDebug dbg, const LinearAlgebra::Vector &vector);
  QDebug operator<<(QDebug dbg, const LinearAlgebra::VectorCompressed &vector);
  QDebug operator<<(QDebug dbg, const LinearAlgebra::Matrix &matrix);
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixCompressed &matrix);
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixUpperTriangular &matrix);
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixLowerTriangular &matrix);
  QString toString(const LinearAlgebra::Vector &vector, int precision=15);
};

+3 −0
Original line number Diff line number Diff line
@@ -381,6 +381,9 @@ namespace Isis {
      bool   m_swapObserverTarget;  ///!< Swap traditional order
      double m_lt;                 ///!<  Light time correction
  };

  //! Typdef for SpicePosition QSharedPointer.
  typedef QSharedPointer<SpicePosition> SpicePositionQsp;
};

#endif
+3 −1
Original line number Diff line number Diff line
@@ -1527,6 +1527,7 @@ namespace Isis {
    QString msg;
    switch (m_frameType) {
     case CK:
     case DYN:
       dpoly = DPolynomial(coeffIndex);
       break;
     case PCK:
@@ -2168,8 +2169,9 @@ namespace Isis {
    // Get the derivative of the polynomial with respect to partialVar
    double dpoly = 0.;
    switch (m_frameType) {
     case UNKNOWN:  // For now let everything go through for backward compatability
     case UNKNOWN:  // For now let everything go through for backward compatibility
     case CK:
     case DYN:
       dpoly = DPolynomial(coeffIndex);
       break;
     case PCK:
+2 −0
Original line number Diff line number Diff line
@@ -602,6 +602,8 @@ namespace Isis {
      //! Seconds per day for scaling time in seconds to get target body w
      static const double m_dayScale;
  };
  //! Typdef for SpiceRotation QSharedPointer.
  typedef QSharedPointer<SpiceRotation> SpiceRotationQsp;
};

#endif
Loading