本文整理汇总了C++中UpperTriangularMatrix::sum_square_columns方法的典型用法代码示例。如果您正苦于以下问题:C++ UpperTriangularMatrix::sum_square_columns方法的具体用法?C++ UpperTriangularMatrix::sum_square_columns怎么用?C++ UpperTriangularMatrix::sum_square_columns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UpperTriangularMatrix
的用法示例。
在下文中一共展示了UpperTriangularMatrix::sum_square_columns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trymatc
//.........这里部分代码省略.........
Matrix M1 = M;
M.Release();
Matrix M2 = M;
Matrix X = M; Print(X);
X = M1 - M2; Print(X);
#ifndef DONT_DO_NRIC
nricMatrix N = M1;
nricMatrix N1 = N;
N.Release();
nricMatrix N2 = N;
nricMatrix Y = N; Print(Y);
Y = N1 - N2; Print(Y);
N = M1 / 2; N1 = N * 2; N.Release(); N2 = N * 2; Y = N; Print(N);
Y = (N1 - M1) | (N2 - M1); Print(Y);
#endif
}
{
Tracer et("Stage 13");
// test sum of squares of rows or columns
MultWithCarry mwc;
DiagonalMatrix DM; Matrix X;
// rectangular matrix
Matrix A(20, 15);
FillWithValues(mwc, A);
// sum of squares of rows
DM << A * A.t();
ColumnVector CV = A.sum_square_rows();
X = CV - DM.AsColumn(); Clean(X, 0.000000001); Print(X);
DM << A.t() * A;
RowVector RV = A.sum_square_columns();
X = RV - DM.AsRow(); Clean(X, 0.000000001); Print(X);
X = RV - A.t().sum_square_rows().t(); Clean(X, 0.000000001); Print(X);
X = CV - A.t().sum_square_columns().t(); Clean(X, 0.000000001); Print(X);
// UpperTriangularMatrix
A.ReSize(17,17); FillWithValues(mwc, A);
UpperTriangularMatrix UT; UT << A;
Matrix A1 = UT;
X = UT.sum_square_rows() - A1.sum_square_rows(); Print(X);
X = UT.sum_square_columns() - A1.sum_square_columns(); Print(X);
// LowerTriangularMatrix
LowerTriangularMatrix LT; LT << A;
A1 = LT;
X = LT.sum_square_rows() - A1.sum_square_rows(); Print(X);
X = LT.sum_square_columns() - A1.sum_square_columns(); Print(X);
// SymmetricMatrix
SymmetricMatrix SM; SM << A;
A1 = SM;
X = SM.sum_square_rows() - A1.sum_square_rows(); Print(X);
X = SM.sum_square_columns() - A1.sum_square_columns(); Print(X);
// DiagonalMatrix
DM << A;
A1 = DM;
X = DM.sum_square_rows() - A1.sum_square_rows(); Print(X);
X = DM.sum_square_columns() - A1.sum_square_columns(); Print(X);
// BandMatrix
BandMatrix BM(17, 3, 5); BM.Inject(A);
A1 = BM;
X = BM.sum_square_rows() - A1.sum_square_rows(); Print(X);
X = BM.sum_square_columns() - A1.sum_square_columns(); Print(X);
// SymmetricBandMatrix
SymmetricBandMatrix SBM(17, 4); SBM.Inject(A);
A1 = SBM;