All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opengamma.strata.math.impl.linearalgebra.QRDecompositionCommons Maven / Gradle / Ivy

There is a newer version: 2.12.46
Show newest version
/*
 * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.strata.math.impl.linearalgebra;

import org.apache.commons.math3.linear.QRDecomposition;
import org.apache.commons.math3.linear.RealMatrix;

import com.opengamma.strata.collect.ArgChecker;
import com.opengamma.strata.collect.array.DoubleMatrix;
import com.opengamma.strata.math.impl.util.CommonsMathWrapper;
import com.opengamma.strata.math.linearalgebra.Decomposition;

/**
 * This class is a wrapper for the Commons Math library implementation 
 * of QR decomposition.
 */
// CSOFF: AbbreviationAsWordInName
public class QRDecompositionCommons implements Decomposition {

  @Override
  public QRDecompositionResult apply(DoubleMatrix x) {
    ArgChecker.notNull(x, "x");
    RealMatrix temp = CommonsMathWrapper.wrap(x);
    QRDecomposition qr = new QRDecomposition(temp);
    return new QRDecompositionCommonsResult(qr);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy