gov.sandia.cognition.math.matrix.Vector.setElement()方法的使用及代码示例

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

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

Vector.setElement介绍

[英]Sets the zero-based indexed element in the Vector from the specified value
[中]从指定值设置向量中基于零的索引元素

代码示例

代码示例来源:origin: openimaj/openimaj

/**
 * Bring each element to the power d
 * 
 * @param degree
 * @param d
 * @return the input
 */
public static <T extends Vector> T powInplace(T degree, double d) {
  for (final VectorEntry ent : degree) {
    degree.setElement(ent.getIndex(), Math.pow(ent.getValue(), d));
  }
  return degree;
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-common-core

/**
 * Sets the entry value to the first underlying vector.
 *
 * @param value Entry value to the first underlying vector.
 */
public void setFirstValue(
  double value)
{
  this.getFirstVector().setElement(this.getIndex(), value);
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-common-core

/**
   * Sets the entry value for the second underlying vector.
   *
   * @param value Entry value for the second underlying vector.
   */
  public void setSecondValue(
    double value)
  {
    this.getSecondVector().setElement(this.getIndex(), value);
  }
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-learning-core

@Override
public Vector convertToVector()
{
  final int dim = this.getInputDimensionality() + 1;
  Vector p = VectorFactory.getDefault().createVector(dim);
  for( int i = 0; i < dim-1; i++ )
  {
    p.setElement(i, this.weightVector.getElement(i) );
  }
  p.setElement(dim-1, this.bias);
  return p;
}

代码示例来源:origin: algorithmfoundry/Foundry

/**
   * Sets the entry value for the second underlying vector.
   *
   * @param value Entry value for the second underlying vector.
   */
  public void setSecondValue(
    double value)
  {
    this.getSecondVector().setElement(this.getIndex(), value);
  }
}

代码示例来源:origin: algorithmfoundry/Foundry

@Override
public Vector convertToVector()
{
  final int dim = this.getInputDimensionality() + 1;
  Vector p = VectorFactory.getDefault().createVector(dim);
  for( int i = 0; i < dim-1; i++ )
  {
    p.setElement(i, this.weightVector.getElement(i) );
  }
  p.setElement(dim-1, this.bias);
  return p;
}

代码示例来源:origin: algorithmfoundry/Foundry

/**
 * Sets the entry value to the first underlying vector.
 *
 * @param value Entry value to the first underlying vector.
 */
public void setFirstValue(
  double value)
{
  this.getFirstVector().setElement(this.getIndex(), value);
}

代码示例来源:origin: algorithmfoundry/Foundry

/**
 * Sets the entry value to the first underlying vector.
 *
 * @param value Entry value to the first underlying vector.
 */
public void setFirstValue(
  double value)
{
  this.getFirstVector().setElement(this.getIndex(), value);
}

代码示例来源:origin: algorithmfoundry/Foundry

/**
   * Sets the entry value for the second underlying vector.
   *
   * @param value Entry value for the second underlying vector.
   */
  public void setSecondValue(
    double value)
  {
    this.getSecondVector().setElement(this.getIndex(), value);
  }
}

代码示例来源:origin: algorithmfoundry/Foundry

@Override
public Vector convertToVector()
{
  final int dim = this.getInputDimensionality() + 1;
  Vector p = VectorFactory.getDefault().createVector(dim);
  for( int i = 0; i < dim-1; i++ )
  {
    p.setElement(i, this.weightVector.getElement(i) );
  }
  p.setElement(dim-1, this.bias);
  return p;
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-learning-core

/**
 * Converts this function into its parameters, which consists of the
 * threshold value
 * @return one-element Vector consisting of the threshold value
 */
public Vector convertToVector()
{
  Vector parameters = VectorFactory.getDefault().createVector(1);
  parameters.setElement(0, this.getThreshold());
  return parameters;
}

代码示例来源:origin: algorithmfoundry/Foundry

/**
 * Converts this function into its parameters, which consists of the
 * threshold value
 * @return one-element Vector consisting of the threshold value
 */
public Vector convertToVector()
{
  Vector parameters = VectorFactory.getDefault().createVector(1);
  parameters.setElement(0, this.getThreshold());
  return parameters;
}

代码示例来源:origin: algorithmfoundry/Foundry

/**
 * Converts this function into its parameters, which consists of the
 * threshold value
 * @return one-element Vector consisting of the threshold value
 */
public Vector convertToVector()
{
  Vector parameters = VectorFactory.getDefault().createVector(1);
  parameters.setElement(0, this.getThreshold());
  return parameters;
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-common-core

public Vector getRow(
  int rowIndex )
{
  int N = this.getDimensionality();
  Vector row = SparseVectorFactoryMTJ.getDefault().createVector( N );
  row.setElement( rowIndex, this.getElement( rowIndex, rowIndex ) );
  return row;
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-common-core

public Vector getColumn(
  int columnIndex )
{
  int M = this.getDimensionality();
  Vector column = SparseVectorFactoryMTJ.getDefault().createVector( M );
  column.setElement( columnIndex, this.getElement( columnIndex, columnIndex ) );
  return column;
}

代码示例来源:origin: algorithmfoundry/Foundry

public Vector getColumn(
  int columnIndex )
{
  int M = this.getDimensionality();
  Vector column = SparseVectorFactoryMTJ.getDefault().createVector( M );
  column.setElement( columnIndex, this.getElement( columnIndex, columnIndex ) );
  return column;
}

代码示例来源:origin: algorithmfoundry/Foundry

public Vector getRow(
  int rowIndex )
{
  int N = this.getDimensionality();
  Vector row = SparseVectorFactoryMTJ.getDefault().createVector( N );
  row.setElement( rowIndex, this.getElement( rowIndex, rowIndex ) );
  return row;
}

代码示例来源:origin: algorithmfoundry/Foundry

public Vector getColumn(
  int columnIndex )
{
  int M = this.getDimensionality();
  Vector column = SparseVectorFactoryMTJ.getDefault().createVector( M );
  column.setElement( columnIndex, this.getElement( columnIndex, columnIndex ) );
  return column;
}

代码示例来源:origin: algorithmfoundry/Foundry

public Vector getRow(
  int rowIndex )
{
  int N = this.getDimensionality();
  Vector row = SparseVectorFactoryMTJ.getDefault().createVector( N );
  row.setElement( rowIndex, this.getElement( rowIndex, rowIndex ) );
  return row;
}

代码示例来源:origin: gov.sandia.foundry/gov-sandia-cognition-learning-core

public Vector evaluate(
  InputType input )
{
  Vector output = VectorFactory.getDefault().createVector(
    this.getOutputDimensionality() );
  int i = 0;
  for (Evaluator<? super InputType, Double> f : this.getBasisFunctions())
  {
    output.setElement( i, f.evaluate( input ) );
    i++;
  }
  return output;
}

相关文章

微信公众号

最新文章

更多