Jama.Matrix.inverse()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(185)

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

Matrix.inverse介绍

暂无

代码示例

代码示例来源:origin: h2oai/h2o-3

final Matrix inv_hessian = new Matrix(cs._hessian).inverse();
for (int j = 0; j < n_coef; ++j) {
 for (int k = 0; k <= j; ++k) {

代码示例来源:origin: h2oai/h2o-2

protected void calcModelStats(final double[] newCoef, final double newLoglik) {
 final int n_coef = coef.length;
 final Matrix inv_hessian = new Matrix(hessian).inverse();
 for (int j = 0; j < n_coef; ++j) {
  for (int k = 0; k <= j; ++k) {

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

@Override
  public Matrix refine(Matrix initial, List<? extends IndependentPair<? extends Point2d, ? extends Point2d>> data) {
    final Matrix hInv = initial.inverse();
    final List<IndependentPair<? extends Point2d, ? extends Point2d>> dataInv = IndependentPair.swapList(data);
    return SINGLE_IMAGE_TRANSFER.refine(hInv, dataInv).inverse();
  }
},

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

@Override
public boolean estimate(List<? extends IndependentPair<Point3d, Point3d>> data) {
  this.transform = TransformUtilities.rigidMatrix(data);
  try {
    transform.inverse();
  } catch (final RuntimeException e) {
    transform = Matrix.identity(4, 4);
  }
  return true;
}

代码示例来源:origin: org.scijava/jep

public void run(Stack s) throws ParseException
{
  Object o = s.pop();
  if(!(o instanceof Matrix))
    throw new ParseException("inverse: can only be applied to a matrix");
  Jama.Matrix m = JamaUtil.toJama((Matrix) o);
  Jama.Matrix inv = m.inverse();
  Matrix res = JamaUtil.fromJama(inv);
  s.push(res);
}

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

protected void cacheValues() {
  inv_covar = covar.inverse();
  pdf_const_factor = 1.0 / Math.sqrt((Math.pow((2 * Math.PI), N) * covar.det()));
  chol = covar.chol().getL();
}

代码示例来源:origin: net.imglib2/imglib2-realtransform

protected void invert()
{
  final Matrix ii = a.inverse();
  inverse.a.setMatrix( 0, n - 1, 0, n - 1, ii );
  invertT();
}

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

/**
 *    {@inheritDoc}
 *     @see org.openimaj.vis.DataUnitsTransformer#calculateUnitsAt(java.lang.Object)
 */
@Override
public Double calculateUnitsAt( final double[] position )
{
  if( this.transform == null ) this.precalc( );
  final Point2d p = new Point2dImpl( (float)position[0], (float)position[1] );
  final Point2d p2 = p.transform( this.transform.inverse() );
  return new Double(p2.getX());
}

代码示例来源:origin: org.openimaj/sandbox

private void applyMetricConstraint() {
  final Matrix Q = calculateOrthometricConstraint(R);
  R = R.times(Q);
  S = Q.inverse().times(S);
}

代码示例来源:origin: org.openimaj/object-detection

private void detectObjects(IMAGE image, Matrix transform, List<TransformedDetection<DETECTED_OBJECT>> results) {
  if (this.roi != null) {
    final Rectangle troi = roi.transform(transform).calculateRegularBoundingBox();
    detector.setROI(troi);
  }
  final List<DETECTED_OBJECT> detections = detector.detect(image);
  if (detections == null)
    return;
  for (final DETECTED_OBJECT o : detections) {
    results.add(new TransformedDetection<DETECTED_OBJECT>(o, transform.inverse()));
  }
}

代码示例来源:origin: org.scijava/jep

public MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs)
  throws ParseException
{
  if(!(lhs instanceof Matrix))
    throw new ParseException("inverse: can only be applied to a matrix");
  if(!(res instanceof Matrix))
    throw new ParseException("inverse: result should be a matrix");
  Jama.Matrix m = JamaUtil.toJama((Matrix) lhs);
  Jama.Matrix inv = m.inverse();
  JamaUtil.fromJama(inv,(Matrix) res);
  return res;
}

代码示例来源:origin: org.openimaj/image-feature-extraction

/**
 * @return the mean of the model
 */
public double[] getMean() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return mean;
}

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

/**
 * @return the mean of the model
 */
public double[] getMean() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return mean;
}

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

/**
 * @return the inverse of the covariance matrix
 */
public Matrix getInverseCovariance() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return invCovar;
}

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

/**
 * @return the mean of the model
 */
public double[] getMean() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return mean;
}

代码示例来源:origin: org.openimaj/image-feature-extraction

/**
 * @return the inverse of the covariance matrix
 */
public Matrix getInverseCovariance() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return invCovar;
}

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

void invSimT(SimTData in, SimTData out) {
  Matrix M = new Matrix(
      new double[][] { { in.a, -in.b }, { in.b, in.a } });
  Matrix N = M.inverse();
  out.a = N.get(0, 0);
  out.b = N.get(1, 0);
  out.tx = -1.0 * (N.get(0, 0) * in.tx + N.get(0, 1) * in.ty);
  out.ty = -1.0 * (N.get(1, 0) * in.tx + N.get(1, 1) * in.ty);
}

代码示例来源:origin: org.openimaj/FaceTracker

void invSimT(SimTData in, SimTData out) {
  Matrix M = new Matrix(
      new double[][] { { in.a, -in.b }, { in.b, in.a } });
  Matrix N = M.inverse();
  out.a = N.get(0, 0);
  out.b = N.get(1, 0);
  out.tx = -1.0 * (N.get(0, 0) * in.tx + N.get(0, 1) * in.ty);
  out.ty = -1.0 * (N.get(1, 0) * in.tx + N.get(1, 1) * in.ty);
}

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

/**
 * @return the covariance of the model
 */
public Matrix getCovariance() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return new Matrix(statistics.getCovariance().getData());
}

代码示例来源:origin: org.openimaj/image-feature-extraction

/**
 * @return the covariance of the model
 */
public Matrix getCovariance() {
  if (mean == null) {
    mean = statistics.getMean();
    invCovar = new Matrix(statistics.getCovariance().getData()).inverse();
  }
  return new Matrix(statistics.getCovariance().getData());
}

相关文章