本文整理汇总了Java中no.uib.cipr.matrix.Matrix.add方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix.add方法的具体用法?Java Matrix.add怎么用?Java Matrix.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类no.uib.cipr.matrix.Matrix
的用法示例。
在下文中一共展示了Matrix.add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: multAdd
import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Matrix multAdd(double alpha, Matrix B, Matrix C) {
checkMultAdd(B, C);
if (alpha == 0)
return C;
for (int i = 0; i < numRows; i++) {
Node row = links.startOfRow(i);
if (row != null)
for (int j = 0; j < B.numColumns(); j++) {
Node node = row;
double v = 0;
while (node != null && node.row == i) {
v += (B.get(node.col, j) * node.val);
node = node.rowTail;
}
if (v != 0)
C.add(i, j, alpha * v);
}
}
return C;
}
示例2: transBmultAdd
import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Matrix transBmultAdd(double alpha, Matrix B, Matrix C) {
checkTransBmultAdd(B, C);
if (alpha == 0)
return C;
for (int i = 0; i < numRows; i++) {
Node row = links.startOfRow(i);
if (row != null)
for (int j = 0; j < B.numRows(); j++) {
Node node = row;
double v = 0;
while (node != null && node.row == i) {
v += (B.get(j, node.col) * node.val);
node = node.rowTail;
}
if (v != 0)
C.add(i, j, alpha * v);
}
}
return C;
}
示例3: transAmultAdd
import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Matrix transAmultAdd(double alpha, Matrix B, Matrix C) {
checkTransAmultAdd(B, C);
if (alpha == 0)
return C;
for (int i = 0; i < numColumns; i++) {
Node row = links.startOfCol(i);
if (row != null)
for (int j = 0; j < B.numColumns(); j++) {
Node node = row;
double v = 0;
while (node != null && node.col == i) {
v += (B.get(node.row, j) * node.val);
node = node.colTail;
}
if (v != 0)
C.add(i, j, alpha * v);
}
}
return C;
}
示例4: transABmultAdd
import no.uib.cipr.matrix.Matrix; //导入方法依赖的package包/类
@Override
public Matrix transABmultAdd(double alpha, Matrix B, Matrix C) {
checkTransABmultAdd(B, C);
if (alpha == 0)
return C;
for (int i = 0; i < numColumns; i++) {
Node row = links.startOfCol(i);
if (row != null)
for (int j = 0; j < B.numRows(); j++) {
Node node = row;
double v = 0;
while (node != null && node.col == i) {
v += (B.get(j, node.row) * node.val);
node = node.colTail;
}
if (v != 0)
C.add(i, j, alpha * v);
}
}
return C;
}