2#ifndef SPECTRAL_DECOMP_H_
3#define SPECTRAL_DECOMP_H_
7#include <RcppArmadillo.h>
57 vec one(
Z.n_rows, fill::ones);
76 void reweight(
const vec &weights,
const bool &sort =
false){
81 eig_sym(
s,
V, mat(
Zw.t() *
Zw) );
85 s = (weights.t() *
Z).t();
95 uvec idx = sort_index(
s,
"descend");
121 V_ret = eye<mat>(
U.n_cols,
U.n_cols);
ZTYPE type
Definition spectralDecomp.h:137
void reweight(const vec &weights, const bool &sort=false)
Definition spectralDecomp.h:76
spectralDecomp(const T &Z, const ZTYPE &type=GENERAL)
Definition spectralDecomp.h:51
spectralDecomp(const spectralDecomp &other)
Definition spectralDecomp.h:62
T Zw
Definition spectralDecomp.h:135
T Z
Definition spectralDecomp.h:135
mat get_V() const
Definition spectralDecomp.h:112
vec get_s() const
Definition spectralDecomp.h:107
ZTYPE get_type() const
Definition spectralDecomp.h:128
spectralDecomp(const T &U, const vec &s, const ZTYPE &type=GENERAL)
Definition spectralDecomp.h:38
T U
Definition spectralDecomp.h:133
vec s
Definition spectralDecomp.h:134
spectralDecomp()
Definition spectralDecomp.h:32
T get_U() const
Definition spectralDecomp.h:102
mat V
Definition spectralDecomp.h:136
mat scaleEachCol(const mat &X, const vec &w)
Definition misc.h:16
mat scaleEachRow(const mat &X, const vec &w)
Definition misc.h:31
T scaleRowsCols(const T &X, const vec &w1, const vec &w2)
Definition misc.h:48
Definition CleanData.h:17
ZTYPE
Definition spectralDecomp.h:18
@ CATEGORICAL
Definition spectralDecomp.h:20
@ GENERAL
Definition spectralDecomp.h:19