本文整理汇总了C++中SpdMatrix::nrow方法的典型用法代码示例。如果您正苦于以下问题:C++ SpdMatrix::nrow方法的具体用法?C++ SpdMatrix::nrow怎么用?C++ SpdMatrix::nrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpdMatrix
的用法示例。
在下文中一共展示了SpdMatrix::nrow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sandwich_inplace
void DM::sandwich_inplace(SpdMatrix &m) const {
assert((nrow() == m.nrow()) && (m.ncol() == ncol()));
for (int i = 0; i < nrow(); ++i) {
m.row(i) *= diagonal_elements_[i];
m.col(i) *= diagonal_elements_[i];
}
}
示例2: set_initial_state_variance
//======================================================================
void ArStateModel::set_initial_state_variance(const SpdMatrix &Sigma){
if(Sigma.nrow() != state_dimension()){
report_error("attempt to set Sigma to the wrong size in "
"ArStateModel::set_initial_state_mean");
}
initial_state_variance_ = Sigma;
}
示例3: chol
WM::WishartModel(double pri_df, const SpdMatrix &PriVarEst)
: ParamPolicy(new UnivParams(pri_df), new SpdParams(PriVarEst*pri_df)),
DataPolicy(new WS(PriVarEst.nrow())),
PriorPolicy()
{
Chol chol(sumsq());
if (!chol.is_pos_def()) {
report_error("Sum of squares matrix must be positive definite in "
"WishartModel constructor");
}
}
示例4: rmvn_robust_mt
Vector rmvn_robust_mt(RNG &rng, const Vector &mu, const SpdMatrix &V) {
uint n = V.nrow();
Matrix eigenvectors(n, n);
Vector eigenvalues = eigen(V, eigenvectors);
for (uint i = 0; i < n; ++i) {
// We're guaranteed that eigenvalues[i] is real and non-negative. We
// can take the absolute value of eigenvalues[i] to guard against
// spurious negative numbers close to zero.
eigenvalues[i] = sqrt(fabs(eigenvalues[i])) * rnorm_mt(rng, 0, 1);
}
Vector ans(eigenvectors * eigenvalues);
ans += mu;
return ans;
}
示例5: sandwich
SpdMatrix sandwich(const Matrix &A, const SpdMatrix &V){ // AVA^T
Matrix tmp(A.nrow(), V.ncol());
cblas_dsymm(CblasColMajor, CblasRight, CblasUpper,
tmp.nrow(),
tmp.ncol(),
1.0,
V.data(),
V.nrow(),
A.data(),
A.nrow(),
0.0,
tmp.data(),
tmp.nrow());
return matmultT(tmp, A);
}
示例6: local_add_outer
void local_add_outer(SpdMatrix &S, const V &v, double w){
assert(v.size()==S.nrow());
cblas_dsyr(CblasColMajor, CblasUpper, v.size(), w, v.data(), v.stride(),
S.data(), S.nrow());
}
示例7: zero_upper
inline void zero_upper(SpdMatrix &V){
uint n = V.nrow();
for(uint i=0; i<n; ++i){
dVector::iterator b = V.col_begin(i);
dVector::iterator e = b+i;
std::fill(b,e,0.0);}}
示例8: set_initial_state_variance
void DRSM::set_initial_state_variance(const SpdMatrix &V) {
check_size(V.nrow());
initial_state_variance_ = V;
}