📄 tcovar.hpp
字号:
// $masm\tcovar.hpp 1.5 milbo$// Warning: this is raw research code -- expect it to be quite messy.// milbo jul06 Gardens#if !defined(tcovar_hpp)#define tcovar_hpp// Row layout is:// 1st row: nrows, ncols, SPARSE_SYMMETRIC// N following rows: all diag entries// remaining rows: upper triangle entries//// Note that the lower triangular entries aren't stored (that's// unneeded because the matrix is symmetric).//// In tSparseElem, we use shorts and floats rather than// ints and doubles for a small speed improvement// (TODO does this actually improve speed?)typedef struct tSparseElem // an element in a sparse array { short iRow, iCol; float Val; }tSparseElem;// special value for A(0,2) to mark an array as sparse symmetricstatic const double SPARSE_SYMMETRIC = -9999;// we use a define not a typedef here so we don't have to// include the STL header files everywhere#define SparseMat cvec<tSparseElem>double Trimmed_xAx(const Vec &x, const Mat &A, unsigned SubProfSpec, int nTrimCovar);bool fIterativeTrimMat(Mat &Covar, int nTrimCovar, unsigned ProfSpec);void ConvertSymmetricMatToSparseFormat(Mat &A, double MinVal=0);double Sparse_xAx(const Vec &x, const SparseMat &A);void CopyMatToSparseMat(SparseMat &S, const Mat &M);bool fSparseMat(const Mat &A);#endif // tcovar_hpp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -