RcppNormalize_Data_R_hdf5

C++ Function Reference

1 Signature

Eigen::MatrixXd BigDataStatMeth::RcppNormalize_Data_R_hdf5(Eigen::MatrixXd X, bool bc, bool bs, bool btransp, Eigen::MatrixXd normdata)

2 Parameters

  • X (Eigen::MatrixXd)
  • bc (bool)
  • bs (bool)
  • btransp (bool)
  • normdata (Eigen::MatrixXd)

3 Returns

Type: Eigen::MatrixXd

4 Caller Graph

Function dependencies

5 Source Code

File: inst/include/hdf5Algebra/matrixNormalization.hppLines 251-275

inline Eigen::MatrixXd RcppNormalize_Data_R_hdf5( Eigen::MatrixXd  X, bool bc, bool bs,
                                               bool btransp, Eigen::MatrixXd normdata)
    {
        Eigen::MatrixXd rX;

        if( btransp == true) {
            if( bc==true && bs==true )  {
                rX = (X.colwise() - normdata.row(0).transpose() ).array().colwise() / normdata.row(1).transpose().array();
            }   else if (bc == true  && bs==false)   {
                rX = (X.colwise() - normdata.row(0).transpose());
            }  else if ( bc == false && bs == true)   {
                rX = X.array().colwise() / normdata.row(1).transpose().array();
            }
        } else {
            if( bc==true && bs==true )  {
                rX = (X.rowwise() - normdata.row(0)).array().rowwise() / normdata.row(1).array();
            } else if (bc == true  && bs==false) {
                rX = (X.rowwise() - normdata.row(0));
            }  else if ( bc == false && bs == true)   {
                rX = X.array().rowwise() / normdata.row(1).array();
            }
        }

        return(rX);
    }

6 Usage Example

#include "BigDataStatMeth.hpp"

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