本文整理汇总了C++中DoubleMatrix::displayCols方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleMatrix::displayCols方法的具体用法?C++ DoubleMatrix::displayCols怎么用?C++ DoubleMatrix::displayCols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoubleMatrix
的用法示例。
在下文中一共展示了DoubleMatrix::displayCols方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: threecheck
void Tensor::threecheck(const DoubleMatrix &B1, const DoubleMatrix &B2,
const DoubleMatrix &B3) {
if (B1.displayRows() != 3 || B1.displayCols() != 3 ||
B2.displayRows() != 3 || B2.displayCols() != 3 ||
B3.displayRows() != 3 || B3.displayCols() != 3) {
ostringstream ii;
ii << "Incorrect tensor initialisation with \n" << B1 << B2 << B3;
throw ii.str();
}
}
示例2:
// T^ijk = T^ijl M_lk
Tensor Tensor::operator*(const DoubleMatrix & M) const {
if (M.displayRows() != 3 || M.displayCols() !=3) {
ostringstream ii;
ii << "Tensor " << *this << " * matrix" << M << "of wrong size.\n";
throw ii.str();
}
Tensor T;
int i;
for (i=1; i<=3; i++) T(i) = display(i) * M;
return T;
}
示例3: temp
// T^kij = M_il T^klj
Tensor operator*(const DoubleMatrix &M, const Tensor &T) {
if (M.displayRows() !=3 || M.displayCols() != 3) {
ostringstream ii;
ii << "DoubleMatrix " << M << " * Tensor" << T << "of wrong size\n";
throw ii.str();
}
Tensor temp;
int i,j,k,l;
for(k=1; k<=3; k++)
for(i=1; i<=3; i++)
for(j=1; j<=3; j++)
for(l=1; l<=3; l++)
temp(k, i, j) += M.display(i, l) * T.display(k, l, j);
return temp;
}
示例4: product
// Does T^ijk = T^ljk M_li
Tensor Tensor::product(const DoubleMatrix & M) const {
if (M.displayRows() != 3 || M.displayCols() !=3) {
ostringstream ii;
ii << "Tensor " << *this << " * matrix" << M << "of wrong size.\n";
throw ii.str();
}
Tensor T;
int i,j,k,l;
for (i=1; i<=3; i++)
for (j=1; j<=3; j++)
for (k=1; k<=3; k++)
for (l=1; l<=3; l++)
T(i, j, k) = T(i, j, k) + display(l, j, k) * M.display(l, i);
return T;
}