removeColumn
C++ Function Reference
1 Signature
void BigDataStatMeth::removeColumn(Eigen::MatrixXd &matrix, unsigned int colToRemove)2 Description
Removes a column from an Eigen matrix.
3 Parameters
matrix(Eigen::MatrixXd &): Reference to matrix to modifycolToRemove(unsigned int): Index of column to remove
4 Details
matrixReference to matrix to modify colToRemoveIndex of column to remove Implementation details:Shifts remaining columns leftResizes matrix to remove last column
5 Caller Graph
6 Source Code
NoteImplementation
File: inst/include/hdf5Utilities/hdf5Utilities.hpp • Lines 369-378
inline void removeColumn(Eigen::MatrixXd& matrix, unsigned int colToRemove)
{
unsigned int numRows = matrix.rows();
unsigned int numCols = matrix.cols()-1;
if( colToRemove < numCols )
matrix.block(0,colToRemove,numRows,numCols-colToRemove) = matrix.rightCols(numCols-colToRemove).eval();
matrix.conservativeResize(numRows,numCols);
}7 Usage Example
#include "BigDataStatMeth.hpp"
// Example usage
auto result = removeColumn(...);