List of usage examples for org.apache.commons.lang ArrayUtils toObject
public static Boolean[] toObject(boolean[] array)
Converts an array of primitive booleans to objects.
From source file:org.uncertml.distribution.multivariate.DirichletDistribution.java
/** * Constructor that takes an array of doubles for the concentration parameter. * /*from w ww.j a v a2s .co m*/ * @param concentration an array of doubles representing the concentration * parameter. */ public DirichletDistribution(double[] concentration) { this(Arrays.asList(ArrayUtils.toObject(concentration))); }
From source file:org.uncertml.distribution.multivariate.MultinomialDistribution.java
/** * Constructor taking a single number of trials and an array of doubles for * the probabilities./*from w w w. j av a2 s. co m*/ * * @param numberOfTrials the number of trials parameter. * @param probabilities an array of doubles representing the probabilities parameter. */ public MultinomialDistribution(int numberOfTrials, double[] probabilities) { this(numberOfTrials, Arrays.asList(ArrayUtils.toObject(probabilities))); }
From source file:org.uncertml.distribution.multivariate.MultivariateNormalDistribution.java
/** * Constructor that takes an array of doubles representing the mean parameters * and a covariance matrix. Each mean parameter represents a marginal normal * distribution. The covariance matrix should contain n^2 elements where n is * the size of the array./*ww w . j av a2 s . co m*/ * * @param mean an array of doubles representing the mean parameter of n marginal * distributions. * @param covarianceMatrix a covariance matrix. */ public MultivariateNormalDistribution(double[] mean, CovarianceMatrix covarianceMatrix) { this(Arrays.asList(ArrayUtils.toObject(mean)), covarianceMatrix); }
From source file:org.uncertml.distribution.multivariate.MultivariateStudentTDistribution.java
/** * Constructor that takes an array of doubles for the mean parameter, a covariance * matrix and an array of integers for the degrees of freedom parameter. Each * mean and degrees of freedom pair represents a marginal distribution. The * arrays must be of equal length and the covariance matrix must contain n^2 * values where n is the length of the arrays. * //ww w. j a v a 2s . c om * @param mean an array of doubles representing the mean parameter of n marginal * Student T distributions. * @param covarianceMatrix a covariance matrix. * @param degreesOfFreedom an array of integers representing the degrees of * freedom of n marginal Student T distributions. */ public MultivariateStudentTDistribution(double[] mean, CovarianceMatrix covarianceMatrix, int[] degreesOfFreedom) { this(Arrays.asList(ArrayUtils.toObject(mean)), covarianceMatrix, Arrays.asList(ArrayUtils.toObject(degreesOfFreedom))); }
From source file:org.uncertml.sample.ContinuousRealisation.java
/** * Constructor that takes an array of doubles as the values of * the realisation.// www.jav a 2 s .c o m * * @param values the numeric values of a single realisation. */ public ContinuousRealisation(double[] values) { this(Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.uncertml.sample.ContinuousRealisation.java
/** * Constructor that takes an array of doubles as the values of * the realisation and a weight, used in weighted samples. * //from ww w .ja v a 2s . c o m * @param values the numeric values of a single realisation. * @param weight the weight of this realisation, between 0 - 1. */ public ContinuousRealisation(double[] values, double weight) { this(Arrays.asList(ArrayUtils.toObject(values)), weight); }
From source file:org.uncertml.sample.ContinuousRealisation.java
/** * Constructor that takes an array of doubles as the values of * the realisation,a weight used in weighted samples and an ID. * /* w ww . j ava 2 s . co m*/ * @param values the numeric values of a single realisation. * @param weight the weight of this realisation, between 0 - 1. * @param id a unique identifier for this realisation. Used to track realisations * through processing chains. */ public ContinuousRealisation(double[] values, double weight, String id) { this(Arrays.asList(ArrayUtils.toObject(values)), weight, id); }
From source file:org.uncertml.statistic.CentredMoment.java
/** * Constructor that takes a single integer order and an array of * doubles for the value of a centred moment statistic. Each value represents a single * centred moment statistic. This is in line with the UncertML syntax whereby a collection * of types can be represented by a single entity. * // w w w . j ava 2s . c om * @param order the order of the centred moment, e.g. 1st order. * @param values an array of doubles representing the value of n * centred moment statistics. */ public CentredMoment(int order, double[] values) { this(order, Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.uncertml.statistic.ConfusionMatrix.java
/** * Constructor that takes an array of categories and counts. The source and * target categories are assumed to the same. There should be categories^2 count values. * /*from w w w.j a va 2s .c om*/ * @param categories the categories (both source and target) of the confusion matrix. * @param counts the counts for each transition from source to target categories. */ public ConfusionMatrix(String[] categories, int[] counts) { this(Arrays.asList(categories), Arrays.asList(ArrayUtils.toObject(counts))); }
From source file:org.uncertml.statistic.ConfusionMatrix.java
/** * Constructor that takes an array of source and target categories and counts. * There should be source categories * target categories count values. * /*from w ww . ja v a 2 s . c o m*/ * @param categories the categories (both source and target) of the confusion matrix. * @param counts the counts for each transition from source to target categories. */ public ConfusionMatrix(String[] sourceCategories, String[] targetCategories, int[] counts) { this(Arrays.asList(sourceCategories), Arrays.asList(targetCategories), Arrays.asList(ArrayUtils.toObject(counts))); }