com.opengamma.strata.math.impl.function.DoublesVectorFunctionProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of strata-math Show documentation
Show all versions of strata-math Show documentation
Mathematic support for Strata
/*
* Copyright (C) 2014 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.math.impl.function;
import java.util.List;
import com.opengamma.strata.collect.ArgChecker;
import com.opengamma.strata.collect.DoubleArrayMath;
/**
* An abstraction for anything that provides a {@link VectorFunction} for a set of data points (as Double).
*/
public abstract class DoublesVectorFunctionProvider implements VectorFunctionProvider {
@Override
public VectorFunction from(List x) {
ArgChecker.notNull(x, "x");
return from(x.toArray(new Double[0]));
}
@Override
public VectorFunction from(Double[] x) {
ArgChecker.notNull(x, "x");
return from(DoubleArrayMath.toPrimitive(x));
}
/**
* Produces a vector function that depends in some way on the given data points.
*
* @param x the array of data points
* @return a {@link VectorFunction}
*/
public abstract VectorFunction from(double[] x);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy