bdtcrossproduct
C++ Function Reference
1 Signature
Eigen::MatrixXd BigDataStatMeth::bdtcrossproduct(T X)2 Description
Compute matrix transposed cross-product XX’.
3 Parameters
X(T): Input matrix
4 Returns
Transposed cross-product matrix XX’
5 Details
Efficiently computes the transposed cross-product of a matrix (XX’) using optimized matrix operations.
6 Call Graph
7 Source Code
NoteImplementation
File: inst/include/memAlgebra/memOptimizedProducts.hpp • Lines 192-207
inline Eigen::MatrixXd bdtcrossproduct ( T X )
{
static_assert(std::is_same<T, Eigen::MatrixXd >::value ||
std::is_same<T, Eigen::Map< Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>> >::value ||
std::is_same<T, Eigen::Map< Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>> >::value ||
std::is_same<T, Eigen::Transpose<Eigen::Map< Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>> > >::value ||
std::is_same<T, Eigen::Transpose<Eigen::Map< Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>> > >::value,
"Error - type not allowed");
Eigen::MatrixXd Xem = X;
size_t nr(Xem.rows());
Eigen::MatrixXd XXt(Eigen::MatrixXd(nr, nr).setZero().selfadjointView<Eigen::Lower>().rankUpdate(Xem));
return(XXt);
}8 Usage Example
#include "BigDataStatMeth.hpp"
// Example usage
auto result = bdtcrossproduct(...);