本文整理了Java中org.apache.mahout.math.Vector.cross()
方法的一些代码示例,展示了Vector.cross()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.cross()
方法的具体详情如下:
包路径:org.apache.mahout.math.Vector
类名称:Vector
方法名:cross
[英]Return the cross product of the receiver and the other vector
[中]返回接收器和其他向量的叉积
代码示例来源:origin: apache/mahout
@Override
public Matrix cross(Vector other) {
return delegate.cross(other);
}
代码示例来源:origin: apache/mahout
@Override
public Matrix cross(Vector other) {
return delegate.cross(other);
}
代码示例来源:origin: apache/mahout
/**
* Test for the error reported in https://issues.apache.org/jira/browse/MAHOUT-1146
*/
@Test
public void testColumnView() {
Matrix matrix = new DenseMatrix(5, 3);
Vector column2 = matrix.viewColumn(2);
Matrix outerProduct = column2.cross(column2);
assertEquals(matrix.numRows(), outerProduct.numRows());
assertEquals(matrix.numRows(), outerProduct.numCols());
}
代码示例来源:origin: apache/mahout
@Test
public void testCrossProduct() {
Matrix result = test.cross(test);
assertEquals("row size", test.size(), result.rowSize());
assertEquals("col size", test.size(), result.columnSize());
for (int row = 0; row < result.rowSize(); row++) {
for (int col = 0; col < result.columnSize(); col++) {
assertEquals("cross[" + row + "][" + col + ']', test.getQuick(row)
* test.getQuick(col), result.getQuick(row, col), EPSILON);
}
}
}
代码示例来源:origin: apache/mahout
@Test
public void testCrossProduct() {
Matrix result = test.cross(test);
assertEquals("row size", test.size(), result.rowSize());
assertEquals("col size", test.size(), result.columnSize());
for (int row = 0; row < result.rowSize(); row++) {
for (int col = 0; col < result.columnSize(); col++) {
assertEquals("cross[" + row + "][" + col + ']', test.getQuick(row)
* test.getQuick(col), result.getQuick(row, col), EPSILON);
}
}
}
}
代码示例来源:origin: org.apache.mahout/mahout-math
@Override
public Matrix cross(Vector other) {
return delegate.cross(other);
}
代码示例来源:origin: org.apache.mahout/mahout-math
@Override
public Matrix cross(Vector other) {
return delegate.cross(other);
}
代码示例来源:origin: cloudera/mahout
@Override
public Matrix cross(Vector other) {
return delegate.cross(other);
}
代码示例来源:origin: org.apache.mahout/mahout-mr
Vector sq = SSVDHelper.loadAndSumUpVectors(sqPath, conf);
Vector sb = SSVDHelper.loadAndSumUpVectors(sbPath, conf);
Matrix mC = sq.cross(sb);
Matrix outerSq = sq.cross(sq);
outerSq.assign(Functions.mult(xisquaredlen));
bbtSquare.assign(outerSq, Functions.PLUS);
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
Vector sq = SSVDHelper.loadAndSumUpVectors(sqPath, conf);
Vector sb = SSVDHelper.loadAndSumUpVectors(sbPath, conf);
Matrix mC = sq.cross(sb);
Matrix outerSq = sq.cross(sq);
outerSq.assign(Functions.mult(xisquaredlen));
bbtSquare.assign(outerSq, Functions.PLUS);
代码示例来源:origin: org.apache.mahout/mahout-core
Vector sq = SSVDHelper.loadAndSumUpVectors(sqPath, conf);
Vector sb = SSVDHelper.loadAndSumUpVectors(sbPath, conf);
Matrix mC = sq.cross(sb);
Matrix outerSq = sq.cross(sq);
outerSq.assign(Functions.mult(xisquaredlen));
bbtSquare.assign(outerSq, Functions.PLUS);
代码示例来源:origin: cloudera/mahout
@Test
public void testCrossProduct() {
Matrix result = test.cross(test);
assertEquals("row size", test.size(), result.rowSize());
assertEquals("col size", test.size(), result.columnSize());
for (int row = 0; row < result.rowSize(); row++) {
for (int col = 0; col < result.columnSize(); col++) {
assertEquals("cross[" + row + "][" + col + ']', test.getQuick(row)
* test.getQuick(col), result.getQuick(row, col), EPSILON);
}
}
}
代码示例来源:origin: cloudera/mahout
@Test
public void testCrossProduct() {
Matrix result = test.cross(test);
assertEquals("row size", test.size(), result.rowSize());
assertEquals("col size", test.size(), result.columnSize());
for (int row = 0; row < result.rowSize(); row++) {
for (int col = 0; col < result.columnSize(); col++) {
assertEquals("cross[" + row + "][" + col + ']', test.getQuick(row)
* test.getQuick(col), result.getQuick(row, col), EPSILON);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!