org.apache.mahout.math.Vector.isSequentialAccess()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.apache.mahout.math.Vector.isSequentialAccess()方法的一些代码示例,展示了Vector.isSequentialAccess()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.isSequentialAccess()方法的具体详情如下:
包路径:org.apache.mahout.math.Vector
类名称:Vector
方法名:isSequentialAccess

Vector.isSequentialAccess介绍

[英]true if this implementation should be considered to be iterable in index order in an efficient way. In particular this implies that #all() and #nonZeroes() ()} return elements in ascending order by index.
[中]如果此实现应被视为可以以有效的方式按索引顺序执行,则为true。这尤其意味着#all()和#nonzeres()()}按索引升序返回元素。

代码示例

代码示例来源:origin: apache/mahout

@Override
public boolean isSequentialAccess() {
 return delegate.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isSequentialAccess() {
 return vector.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isSequentialAccess() {
 return delegate.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

public static byte flags(Vector vector, boolean laxPrecision) {
 boolean dense = vector.isDense();
 boolean sequential = vector.isSequentialAccess();
 boolean named = vector instanceof NamedVector;
 return (byte) ((dense ? FLAG_DENSE : 0)
     | (sequential ? FLAG_SEQUENTIAL : 0)
     | (named ? FLAG_NAMED : 0)
     | (laxPrecision ? FLAG_LAX_PRECISION : 0));
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return fa.isLikeRightPlus() && !fc.isDensifying()
   && x.isSequentialAccess() && y.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return fa.isLikeRightPlus() && fc.isLikeMult() && x.isSequentialAccess() && y.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction f) {
 return !f.isDensifying() && x.isSequentialAccess() && y.isSequentialAccess() && x.isAddConstantTime();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return x.isSequentialAccess() && y.isSequentialAccess() && !x.isDense() && !y.isDense();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction f) {
 return f.isLikeLeftMult() && f.isLikeRightPlus() && x.isSequentialAccess() && y.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction f) {
 return x.isSequentialAccess() && y.isSequentialAccess() && x.isAddConstantTime()
   && !x.isDense() && !y.isDense();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return fa.isLikeRightPlus() && !fc.isDensifying()
   && (fa.isAssociativeAndCommutative() || (x.isSequentialAccess() && y.isSequentialAccess()));
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction f) {
 return x.isSequentialAccess() && y.isSequentialAccess() && !x.isAddConstantTime() && !x.isDense() && !y.isDense();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return (fa.isAssociativeAndCommutative() || x.isSequentialAccess())
   && !x.isDense();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction f) {
 return f.isLikeRightPlus() && y.isSequentialAccess() && !x.isAddConstantTime();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction f) {
 return !f.isDensifying() && !x.isAddConstantTime() && y.isSequentialAccess();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return (fa.isAssociativeAndCommutative() || y.isSequentialAccess())
   && !y.isDense();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return fa.isLikeRightPlus() && (fa.isAssociativeAndCommutative() || x.isSequentialAccess())
   && fc.isLikeLeftMult();
}

代码示例来源:origin: apache/mahout

@Override
public boolean isValid(Vector x, Vector y, DoubleDoubleFunction fa, DoubleDoubleFunction fc) {
 return fa.isLikeRightPlus() && (fa.isAssociativeAndCommutative() || y.isSequentialAccess())
   && fc.isLikeRightMult();
}

代码示例来源:origin: apache/mahout

static Matrix createRiIiMaybeTransposed(Vector ratingVector) {
  Preconditions.checkArgument(ratingVector.isSequentialAccess(), "Ratings should be iterable in Index or Sequential Order");

  double[][] RiIiMaybeTransposed = new double[ratingVector.getNumNondefaultElements()][1];
  int index = 0;
  for (Vector.Element elem : ratingVector.nonZeroes()) {
   RiIiMaybeTransposed[index++][0] = elem.get();
  }
  return new DenseMatrix(RiIiMaybeTransposed, true);
 }
}

代码示例来源:origin: apache/mahout

/** Y' Cu p(u) */
private Matrix getYtransponseCuPu(Vector userRatings) {
 Preconditions.checkArgument(userRatings.isSequentialAccess(), "need sequential access to ratings!");
 Vector YtransponseCuPu = new DenseVector(numFeatures);
 for (Element e : userRatings.nonZeroes()) {
  YtransponseCuPu.assign(Y.get(e.index()).times(confidence(e.get())), Functions.PLUS);
 }
 return columnVectorAsMatrix(YtransponseCuPu);
}

相关文章