Commit 1570e7f1 authored by Ken Edmundson's avatar Ken Edmundson
Browse files

piecewise polynomial bundle updates

parent cca628eb
Loading
Loading
Loading
Loading
+72 −50
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ namespace Isis {
   * @param matrix The matrix to check. Automatically returns false if not 
   *               square.
   * 
   * @return @b bool Returns true if the matrix is a square identity matrix 
   * @return bool Returns true if the matrix is a square identity matrix
   *                 (i.e. there are ones down the diagonal and zeroes elsewhere).
   */
  bool LinearAlgebra::isIdentity(const Matrix &matrix) {
@@ -96,7 +96,7 @@ namespace Isis {
   * @param matrix The matrix to check. Automatically returns false 
   *               if not square.
   * 
   * @return @b bool Returns true if the matrix is orthogonal.
   * @return bool Returns true if the matrix is orthogonal.
   */
  bool LinearAlgebra::isOrthogonal(const Matrix &matrix) {
    if (matrix.size1() != matrix.size2()) return false;
@@ -115,7 +115,7 @@ namespace Isis {
   * @param matrix The matrix to check. Automatically returns false if not 2x2 
   *               or 3x3.
   *  
   * @return @b bool Returns true if the given matrix represents a rotation. 
   * @return bool Returns true if the given matrix represents a rotation.
   *  
   * @throw IException::Programmer "Unable to determine whether 
   *                                the given matrix is a rotation matrix."
@@ -218,7 +218,7 @@ namespace Isis {
   *  
   * @param vector The matrix to check.
   * 
   * @return @b bool Returns true if the matrix is all zereos.
   * @return bool Returns true if the matrix is all zereos.
   */
  bool LinearAlgebra::isZero(const Matrix &matrix) {
    for (unsigned int i = 0; i < matrix.size1(); i++) {
@@ -238,7 +238,7 @@ namespace Isis {
   *  
   * @param vector The vector to check.
   * 
   * @return @b bool Returns true if the vector is all zereos.
   * @return bool Returns true if the vector is all zereos.
   */
  bool LinearAlgebra::isZero(const Vector &vector) {
    for (unsigned int i = 0; i < vector.size(); i++) {
@@ -256,7 +256,7 @@ namespace Isis {
   *  
   * @param vector The vector to check.
   * 
   * @return @b bool Returns true if the size of the given vector is zero.
   * @return bool Returns true if the size of the given vector is zero.
   * 
   */
  bool LinearAlgebra::isEmpty(const LinearAlgebra::Vector &vector) {
@@ -269,7 +269,7 @@ namespace Isis {
   *  
   * @param vector The vector to check.
   * 
   * @return @b bool Returns true if the vector is a unit vector.
   * @return bool Returns true if the vector is a unit vector.
   */
  bool LinearAlgebra::isUnit(const Vector &vector) {
    if (qFuzzyCompare(dotProduct(vector, vector), 1.0)) {
@@ -285,7 +285,7 @@ namespace Isis {
   * 
   * @param matrix The matrix to inverse.
   * 
   * @return @b LinearAlgebra::Matrix The inverse matrix.
   * @return LinearAlgebra::Matrix The inverse matrix.
   *  
   * @throw IException::Programmer "The given matrix is not invertible. 
   *                                The determinant is 0.0."
@@ -346,7 +346,7 @@ namespace Isis {
   * 
   * @param matrix The matrix to transpose.
   * 
   * @return @b LinearAlgebra::Matrix The transposed matrix.
   * @return LinearAlgebra::Matrix The transposed matrix.
   */
  LinearAlgebra::Matrix LinearAlgebra::transpose(const Matrix &matrix) {
    // no error testing required so call the boost transpose function
@@ -359,7 +359,7 @@ namespace Isis {
   * 
   * @param int The size of the square matrix.
   *  
   * @return @b LinearAlgebra::Matrix The NxN square matrix.
   * @return LinearAlgebra::Matrix The NxN square matrix.
   * 
   * @throw IException::Programmer "Can not create identity matrix of negative size."
   */
@@ -385,7 +385,7 @@ namespace Isis {
   * @param rows The number of rows in the returned matrix.
   * @param columns The number of colums in the returned matrix.
   * 
   * @return @b LinearAlgebra::Matrix A zero-filled matrix.
   * @return LinearAlgebra::Matrix A zero-filled matrix.
   */
  LinearAlgebra::Matrix LinearAlgebra::zeroMatrix(int rows, int columns) {
    boost::numeric::ublas::zero_matrix<double> m(rows, columns);
@@ -398,7 +398,7 @@ namespace Isis {
   * 
   * @param size Size of the vector.
   * 
   * @return @b LinearAlgebra::Vector A zero-filled vector.
   * @return LinearAlgebra::Vector A zero-filled vector.
   */
  LinearAlgebra::Vector LinearAlgebra::zeroVector(int size) {
    boost::numeric::ublas::zero_vector<double> v(size);
@@ -412,7 +412,7 @@ namespace Isis {
   * @param LinearAlgebra::Matrix The 3x3 matrix whose determinant will be 
   *                     calculated.
   *  
   * @return @b double The determinant of the given matrix.
   * @return double The determinant of the given matrix.
   *  
   * @throw IException::Programmer "Unable to calculate the determinant for the 
   *                                given matrix. This method only calculates the
@@ -452,7 +452,7 @@ namespace Isis {
   *  
   * @param vector The vector to be normalized.
   *  
   * @return @b LinearAlgebra::Vector A unit vector from the given vector.
   * @return LinearAlgebra::Vector A unit vector from the given vector.
   *  
   * @throw IException::Programmer "Unable to normalize the zero vector."
   */
@@ -481,7 +481,7 @@ namespace Isis {
   *  
   * @param vector The vector whose magnitude will be computed.
   * 
   * @return @b double The magnitude (length) of the given vector.
   * @return double The magnitude (length) of the given vector.
   */
  double LinearAlgebra::magnitude(const Vector &vector) {
    double magnitude;
@@ -508,7 +508,7 @@ namespace Isis {
   * 
   * @param vector The vector whose absolute maximum will be returned.
   * 
   * @return @b double The maximum of the absolute values of the vector components.
   * @return double The maximum of the absolute values of the vector components.
   */
  double LinearAlgebra::absoluteMaximum(const Vector &vector) {
    return boost::numeric::ublas::norm_inf(vector);
@@ -523,7 +523,7 @@ namespace Isis {
   * @param matrix1 The left matrix.
   * @param matrix2 The right matrix.
   *  
   * @return @b LinearAlgebra::Matrix The resultant matrix product.
   * @return LinearAlgebra::Matrix The resultant matrix product.
   *  
   * @throw IException::Programmer "Unable to multiply matrices 
   *                                with mismatched dimensions."
@@ -554,7 +554,7 @@ namespace Isis {
   * @param vector The column vector to be multiplied on the right side of 
   *               the matrix.
   *  
   * @return @b LinearAlgebra::Vector The resultant vector.
   * @return LinearAlgebra::Vector The resultant vector.
   *  
   * @throw IException::Programmer "Unable to multiply matrix and vector 
   *                                with mismatched dimensions."
@@ -580,7 +580,7 @@ namespace Isis {
   * @param scalar The scalar to be multiplied by each component of the vector.
   * @param vector The vector to be scaled.
   * 
   * @return @b LinearAlgebra::Vector The resultant scaled vector.
   * @return LinearAlgebra::Vector The resultant scaled vector.
   */
  LinearAlgebra::Vector LinearAlgebra::multiply(double scalar, const Vector &vector) {
    // no error checks necessary (use the boost operator* method)
@@ -594,7 +594,7 @@ namespace Isis {
   * @param scalar The scalar to be multiplied by each element of the matrix.
   * @param matrix The matrix to be scaled.
   * 
   * @return @b LinearAlgebra::Matrix The resultant scaled matrix.
   * @return LinearAlgebra::Matrix The resultant scaled matrix.
   */
  LinearAlgebra::Matrix LinearAlgebra::multiply(double scalar, const Matrix &matrix) {
    // no error checks necessary
@@ -608,7 +608,7 @@ namespace Isis {
   * @param vector1 The first vector.
   * @param vector2 The second vector.
   *  
   * @return @b LinearAlgebra::Vector The sum of the vectors.
   * @return LinearAlgebra::Vector The sum of the vectors.
   *  
   * @throw IException::Programmer "Unable to add vectors 
   *                                with mismatched sizes."
@@ -633,7 +633,7 @@ namespace Isis {
   * @param vector1 The vector to the left of the subtraction operator.
   * @param vector2 The vector to the right of the subtraction operator.
   *  
   * @return @b LinearAlgebra::Vector The difference of the vectors 
   * @return LinearAlgebra::Vector The difference of the vectors
   *                                  (i.e. vector1 - vector2).
   *  
   * @throw IException::Programmer "Unable to subtract vectors 
@@ -660,7 +660,7 @@ namespace Isis {
   * @param vector1 The vector to the left of the cross product operator.
   * @param vector2 The vector to the right of the cross product operator.
   *  
   * @return @b LinearAlgebra::Vector The cross product of the given 
   * @return LinearAlgebra::Vector The cross product of the given
   *                                  vectors (i.e. vector1 x vector2).
   *  
   * @throw IException::Programmer "Unable to calculate the cross 
@@ -695,7 +695,7 @@ namespace Isis {
   * @param vector1 The vector to the left of the cross product operator.
   * @param vector2 The vector to the right of the cross product operator.
   *  
   * @return @b LinearAlgebra::Vector The normalized cross product of the given vectors 
   * @return LinearAlgebra::Vector The normalized cross product of the given vectors
   *                                  (i.e. normalize(vector1/absoluteMaximum(vector1) x 
   *                                   vector2/absoluteMaximum(vector2))). 
   */
@@ -731,7 +731,7 @@ namespace Isis {
   * @param vector1 The vector to the left side of the outer product operator.
   * @param vector2 The vector to the right side of the outer product operator.
   *  
   * @return @b LinearAlgebra::Matrix The outer product matrix of the given vectors.
   * @return LinearAlgebra::Matrix The outer product matrix of the given vectors.
   *  
   * @throw IException::Programmer "Unable to compute the outer product for 
   *                                vectors with mismatched sizes."
@@ -757,7 +757,7 @@ namespace Isis {
   * @param vector1 The first vector.
   * @param vector2 The second vector.
   * 
   * @return @b double The dot product of the vectors.
   * @return double The dot product of the vectors.
   * 
   */
  double LinearAlgebra::dotProduct(const Vector &vector1, const Vector &vector2) {
@@ -775,7 +775,7 @@ namespace Isis {
   * @param vector1 The first vector.
   * @param vector2 The second vector.
   * 
   * @return @b double The inner product of the vectors.
   * @return double The inner product of the vectors.
   * 
   * @throw IException::Programmer "Unable to compute the dot product for vectors 
   *                                with mismatched sizes."
@@ -804,7 +804,7 @@ namespace Isis {
   * @param vector1 The vector to the left of the project operator.
   * @param vector2 The vector to the right of the project operator.
   *  
   * @return @b LinearAlgebra::Vector The resultant vector that is 
   * @return LinearAlgebra::Vector The resultant vector that is
   *                                  the orthogonal projection of
   *                                  vector1 onto vector2.
   *  
@@ -844,7 +844,7 @@ namespace Isis {
   * @param axis  A vector defining the axis, which must also have three components.
   * @param angle The angle to rotate.
   * 
   * @return @b LinearAlgebra::Vector The rotated vector.
   * @return LinearAlgebra::Vector The rotated vector.
   *  
   * @throw IException::Programmer "Unable to rotate vector about the 
   *                                given axis and angle. Vectors must
@@ -903,7 +903,7 @@ namespace Isis {
  * @param vector1 The first vector, denoted A in the description.
  * @param vector2 The second vector, denoted B in the description.
  * 
  * @return @b LinearAlgebra::Vector A vector perpendicular to vector2 and
  * @return LinearAlgebra::Vector A vector perpendicular to vector2 and
  *                                  equal to vector1-parallel2 (where
  *                                  parallel2 is some vector that is
  *                                  parallel to vector2).
@@ -941,7 +941,7 @@ namespace Isis {
   * 
   * @param rotationMatrix A matrix representing a rotation.
   * 
   * @return @b LinearAlgebra::AxisAngle The axis-angle pair representing the rotation.
   * @return LinearAlgebra::AxisAngle The axis-angle pair representing the rotation.
   * 
   * @throw IException::Programmer "Unable to convert the given matrix to an 
   *                                axis of rotation and a rotation angle. A
@@ -1014,7 +1014,7 @@ namespace Isis {
   * @param rotationMatrix A matrix representing a rotation.
   * @param axes A list containing the order of axes.
   *  
   * @return @b QList< LinearAlgebra::EulerAngle> The list of 3 Euler angles 
   * @return QList< LinearAlgebra::EulerAngle> The list of 3 Euler angles
   *                                              with their axes representing the rotation.
   * 
   * @throw IException::Programmer "Unable to convert the given matrix to Euler angles. 
@@ -1181,7 +1181,7 @@ namespace Isis {
   * 
   * @param rotationMatrix A matrix representing a rotation.
   *  
   * @return @b LinearAlgebra::Vector A unit quaternion representing the rotation. 
   * @return LinearAlgebra::Vector A unit quaternion representing the rotation.
   *  
   * @throw IException::Programmer "Unable to convert the given matrix to a quaternion.
                                    A 3x3 matrix is required.
@@ -1377,7 +1377,7 @@ namespace Isis {
   * @param axis The axis of rotation for a rotation.
   * @param angle The rotation angle.
   * 
   * @return @b LinearAlgebra::Matrix The matrix representing the rotation.
   * @return LinearAlgebra::Matrix The matrix representing the rotation.
   * 
   * @throw IException::Programmer "Unable to convert the given vector and 
   *                                angle to a rotation matrix. The given
@@ -1418,7 +1418,7 @@ namespace Isis {
   * 
   * @param axisAngle The axis-angle pair representation of a rotation
   * 
   * @return @b LinearAlgebra::Matrix The matrix representation of the rotation.
   * @return LinearAlgebra::Matrix The matrix representation of the rotation.
   * 
   */
  LinearAlgebra::Matrix LinearAlgebra::toMatrix(const AxisAngle &axisAngle) {
@@ -1434,7 +1434,7 @@ namespace Isis {
   * @param angle2 The second angle and its axis.
   * @param angle1 The first angle and its axis.
   * 
   * @return @b LinearAlgebra::Matrix The matrix representation of the rotation.
   * @return LinearAlgebra::Matrix The matrix representation of the rotation.
   * 
   * @throw IException::Programmer "Unable to convert the given Euler angles to 
   *                                a matrix using the given axis codes. Axis
@@ -1518,7 +1518,7 @@ namespace Isis {
   * 
   * @param eulerAngles The Euler angle representation of a rotation.
   *  
   * @return @b LinearAlgebra::Matrix The matrix representation of the rotation.
   * @return LinearAlgebra::Matrix The matrix representation of the rotation.
   * 
   * @throw IException::Programmer "Unable to convert the given Euler angles to 
   *                                a matrix. Exactly 3 Euler angles are
@@ -1544,7 +1544,7 @@ namespace Isis {
   * 
   * @param quaternion   A unit quaternion representation of a rotation.
   *  
   * @return @b LinearAlgebra::Matrix The matrix representation of the rotation.
   * @return LinearAlgebra::Matrix The matrix representation of the rotation.
   *  
   * @throw IException::Programmer "Unable to convert the given vector to a 
   *                                rotation matrix. The given vector is not
@@ -1643,7 +1643,7 @@ namespace Isis {
   * @param matrix The matrix to pull values from.
   * @param rowIndex The index of the matrix row to grab.
   * 
   * @return @b LinearAlgebra::Vector A vector whose values match the given row 
   * @return LinearAlgebra::Vector A vector whose values match the given row
   *                                  of the given matrix.
   * 
   * @throw IException::Programmer "Unable to get the matrix row to the given 
@@ -1666,7 +1666,7 @@ namespace Isis {
   * @param matrix The matrix to pull values from.
   * @param columnIndex The index of the matrix column to grab.
   * 
   * @return @b LinearAlgebra::Vector A vector whose values match the given 
   * @return LinearAlgebra::Vector A vector whose values match the given
   *                                  column of the given matrix.
   * 
   * @throw IException::Programmer "Unable to get the matrix column to the given 
@@ -1690,7 +1690,7 @@ namespace Isis {
   * @param v1 The second component of the vector. 
   * @param v2 The third component of the vector.
   * 
   * @return @b LinearAlgebra::Vector A vector containing the given values.
   * @return LinearAlgebra::Vector A vector containing the given values.
   * 
   */
  LinearAlgebra::Vector LinearAlgebra::vector(double v0, double v1, double v2) {
@@ -1710,7 +1710,7 @@ namespace Isis {
   * @param v2 The third component of the vector.
   * @param v3 The fourth component of the vector.
   * 
   * @return @b LinearAlgebra::Vector A vector containing the given values.
   * @return LinearAlgebra::Vector A vector containing the given values.
   * 
   */
  LinearAlgebra::Vector LinearAlgebra::vector(double v0, double v1, double v2, double v3) {
@@ -1765,7 +1765,7 @@ namespace Isis {
   * @param size The number of elements from the original vector to copy 
   *             to the new vector.
   * 
   * @return @b LinearAlgebra::Vector A sub-vector containing values from 
   * @return LinearAlgebra::Vector A sub-vector containing values from
   *                                  the original vector.
   */
  LinearAlgebra::Vector LinearAlgebra::subVector(const Vector &v, int startIndex, int size) {
@@ -1786,7 +1786,7 @@ namespace Isis {
   * @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.
   * @return QDebug The stream with the QString-formatted vector.
   * 
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::Vector &vector) {
@@ -1805,7 +1805,7 @@ namespace Isis {
   * @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.
   * @return QDebug The stream with the QString-formatted vector.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::VectorCompressed &vectorCompressed) {
@@ -1823,7 +1823,7 @@ namespace Isis {
   * @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.
   * @return QDebug The stream with the QString-formatted matrix.
   * 
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::Matrix &matrix) {
@@ -1847,7 +1847,7 @@ namespace Isis {
   * @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.
   * @return QDebug The stream with the QString-formatted matrix.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixCompressed &matrix) {
@@ -1871,7 +1871,7 @@ namespace Isis {
   * @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.
   * @return QDebug The stream with the QString-formatted matrix.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixUpperTriangular &matrix) {
@@ -1895,7 +1895,7 @@ namespace Isis {
   * @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.
   * @return QDebug The stream with the QString-formatted matrix.
   *
   */
  QDebug operator<<(QDebug dbg, const LinearAlgebra::MatrixLowerTriangular &matrix) {
@@ -1919,7 +1919,7 @@ namespace Isis {
   * @param vector The vector to be converted.
   * @param precision Number of significant figures to convert.
   * 
   * @return @b QString The string-formatted vector.
   * @return QString The string-formatted vector.
   * 
   */
  QString toString(const LinearAlgebra::Vector &vector, int precision) {
@@ -1931,4 +1931,26 @@ namespace Isis {
    result += " )";
    return result;
  }

       
  /**
   * A global function to format LinearAlgebra::VectorCompressed as a QString
   * with the given precision. The string will be comma-separated entries
   * encased by parentheses. 
   *  
   * @param vectorCompressed The compressed vector to be converted.
   * @param precision Number of significant figures to convert.
   * 
   * @return QString The string-formatted vector.
   * 
   */
  QString toString(const LinearAlgebra::VectorCompressed &vectorCompressed, int precision) {
    QString result = "( ";
    for (unsigned int i = 0; i < vectorCompressed.size(); i++) {
      result += toString(vectorCompressed(i), precision);
      if (i != vectorCompressed.size() - 1) result += ", ";
    }
    result += " )";
    return result;
  }       
}
+4 −1
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ namespace Isis {
   *   @history 2016-08-16 Jesse Mapel - Added BOOST_UBLAS_NO_STD_CERR definition to
   *                           prevent Boost from outputing debug information to standard out
   *                           when throwing exceptions.  Fixes #2302.
   *   @history 2017-11-01 Ken Edmundson - Added support for Boost compressed matrix and vector
   *                                       types, including QDebug operators.
   *
   *  
   *   @todo document methods (a) add naif routine names to documentation where appropriate,
@@ -241,6 +243,7 @@ namespace Isis {
  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);
  QString toString(const LinearAlgebra::VectorCompressed &vectorCompressed, int precision=15);
};

#endif
+874 −859
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ namespace Isis {
     */
    SparseBlockColumnMatrix::SparseBlockColumnMatrix() {
      m_startColumn = 0;
      m_observationIndex = -1;
    }


@@ -81,6 +82,7 @@ namespace Isis {
      }

      m_startColumn = src.startColumn();
      m_observationIndex = src.observationIndex();
    }


@@ -136,7 +138,7 @@ namespace Isis {
    /**
     * Sets starting column for block in full matrix.
     *
   * @param nStartColumn value for starting column in full matrix for this block columns
     * @param n StartColumn value for starting column in full matrix for this block column.
     */
    void SparseBlockColumnMatrix::setStartColumn(int nStartColumn) {
      m_startColumn = nStartColumn;
@@ -144,7 +146,17 @@ namespace Isis {


    /**
   * Sets starting column for block in full matrix.
     * Sets BundleObservation index for block.
     *
     * @param n observationIndex BundleObservation index for this column.
     */
    void SparseBlockColumnMatrix::setObservationIndex(int observationIndex) {
      m_observationIndex = observationIndex;
    }


    /**
     * Accessor for starting column for block in full matrix.
     *
     * @return int returns the starting column in the full matrix
     */
@@ -153,6 +165,16 @@ namespace Isis {
    }


    /**
     * Accessor for BundleObservation index for this column.
     *
     * @return int returns BundleObservation index for this column.
     */
    int SparseBlockColumnMatrix::observationIndex() const {
      return m_observationIndex;
    }


    /**
     * Returns total number of matrix elements in map (NOTE: NOT the number of matrix blocks). The sum
     *  of all the elements in all of the matrix blocks.
@@ -380,7 +402,7 @@ namespace Isis {
     * @param sbcm SparseBlockColumnMatrix to write to debug stream
     */
    QDebug operator<<(QDebug dbg, const SparseBlockColumnMatrix &sbcm) {
    dbg.space() << "New Block" << endl;
      dbg.space() << "New Column" << "Start Column = " << sbcm.startColumn() << endl;

      QMapIterator<int, LinearAlgebra::Matrix *> it(sbcm);
      while ( it.hasNext() ) {
@@ -392,6 +414,8 @@ namespace Isis {
        // get matrix
        LinearAlgebra::Matrix *matrix = it.value();

        dbg.space() << "key = " << it.key() << endl;

        // matrix rows, columns
        int nRows = matrix->size1();
        int nCols = matrix->size2();
@@ -492,15 +516,12 @@ namespace Isis {
     * @param nRows number of rows in matrix to be inserted
     * @param nCols number of columns in matrix to be inserted
     *
   * @return bool Returns true if insertion successful
   *              Returns false if block already exists at nRowBlock or if allocation of new block
   *              fails
   *              TODO: we return true in the SparseBlockColumnMatrix if the block already exists,
   *                    why is it different here?
     * @return bool Returns true if insertion successful or if there is already a block at nRowBlock
     *              Returns false if allocation of new block fails
     */
    bool SparseBlockRowMatrix::insertMatrixBlock(int nRowBlock, int nRows, int nCols) {
      if ( this->contains(nRowBlock) )
      return false;
        return true;

      LinearAlgebra::Matrix *m = new LinearAlgebra::Matrix(nRows,nCols);

@@ -860,16 +881,10 @@ namespace Isis {
     * Initializes number of columns (SparseBlockColumnMatrix).
     *
     * @param n number of columns to insert
   *
   * @return bool Always returns true
   *              TODO: why bother returning bool? should there be a false condition?
     */
  bool SparseBlockMatrix::setNumberOfColumns( int n ) {

    void SparseBlockMatrix::setNumberOfColumns( int n ) {
      for( int i = 0; i < n; i++ )
        append( new SparseBlockColumnMatrix() );

    return true;
    }


+12 −3

File changed.

Preview size limit exceeded, changes collapsed.

+13 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading