1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/*
2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more
3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements.  See the NOTICE file distributed with
4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership.
5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0
6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with
7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License.  You may obtain a copy of the License at
8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *      http://www.apache.org/licenses/LICENSE-2.0
10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software
12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS,
13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and
15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License.
16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.transform;
18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.FunctionEvaluationException;
20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.analysis.UnivariateRealFunction;
21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/**
23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Interface for one-dimensional data sets transformations producing real results.
24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>Such transforms include {@link FastSineTransformer sine transform},
25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * {@link FastCosineTransformer cosine transform} or {@link
26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * FastHadamardTransformer Hadamard transform}. {@link FastFourierTransformer
27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Fourier transform} is of a different kind and does not implement this
28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * interface since it produces {@link org.apache.commons.math.complex.Complex complex}
29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * results instead of real ones.
30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </p>
31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 févr. 2011) $
32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0
33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic interface RealTransformer  {
35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Transform the given real data set.
38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param f the real data array to be transformed (signal)
39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return the real transformed array (spectrum)
40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws IllegalArgumentException if any parameters are invalid
41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    double[] transform(double f[])
43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        throws IllegalArgumentException;
44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
45dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
46dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Transform the given real function, sampled on the given interval.
47dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param f the function to be sampled and transformed
48dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param min the lower bound for the interval
49dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param max the upper bound for the interval
50dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param n the number of sample points
51dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return the real transformed array
52dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws FunctionEvaluationException if function cannot be evaluated at some point
53dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws IllegalArgumentException if any parameters are invalid
54dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
55dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    double[] transform(UnivariateRealFunction f, double min, double max, int n)
56dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        throws FunctionEvaluationException, IllegalArgumentException;
57dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
58dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
59dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Inversely transform the given real data set.
60dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param f the real data array to be inversely transformed (spectrum)
61dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return the real inversely transformed array (signal)
62dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws IllegalArgumentException if any parameters are invalid
63dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
64dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    double[] inversetransform(double f[])
65dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        throws IllegalArgumentException;
66dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
67dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
68dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Inversely transform the given real function, sampled on the given interval.
69dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param f the function to be sampled and inversely transformed
70dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param min the lower bound for the interval
71dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param max the upper bound for the interval
72dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param n the number of sample points
73dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return the real inversely transformed array
74dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws FunctionEvaluationException if function cannot be evaluated at some point
75dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @throws IllegalArgumentException if any parameters are invalid
76dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
77dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    double[] inversetransform(UnivariateRealFunction f, double min, double max, int n)
78dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        throws FunctionEvaluationException, IllegalArgumentException;
79dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
80dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond}
81