removeRow

C++ Function Reference

1 Signature

void BigDataStatMeth::removeRow(Eigen::MatrixXd &matrix, unsigned int rowToRemove)

2 Description

Removes a row from an Eigen matrix.

3 Parameters

  • matrix (Eigen::MatrixXd &): Reference to matrix to modify
  • rowToRemove (unsigned int): Index of row to remove

4 Details

matrixReference to matrix to modify rowToRemoveIndex of row to remove Implementation details:Shifts remaining rows upResizes matrix to remove last row

5 Caller Graph

Function dependencies

6 Source Code

File: inst/include/hdf5Utilities/hdf5Utilities.hppLines 345-354

inline void removeRow(Eigen::MatrixXd& matrix, unsigned int rowToRemove)
    {
        unsigned int numRows = matrix.rows()-1;
        unsigned int numCols = matrix.cols();
        
        if( rowToRemove < numRows )
            matrix.block(rowToRemove,0,numRows-rowToRemove,numCols) = matrix.bottomRows(numRows-rowToRemove).eval();
        
        matrix.conservativeResize(numRows,numCols);
    }

7 Usage Example

#include "BigDataStatMeth.hpp"

// Example usage
auto result = removeRow(...);