1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System.Collections.Generic;
|
---|
23 | using HeuristicLab.Core;
|
---|
24 |
|
---|
25 | namespace HeuristicLab.Problems.DataAnalysis {
|
---|
26 | public interface ITransformation : IParameterizedNamedItem {
|
---|
27 | }
|
---|
28 |
|
---|
29 | public interface ITransformation<T> : ITransformation {
|
---|
30 | /// <summary>
|
---|
31 | /// Checks if the data is valid for the transformation.
|
---|
32 | /// Calling <code>Apply</code> or <code>Configure</code> on invalid data will throw an exception.
|
---|
33 | /// </summary>
|
---|
34 | /// <param name="data"></param>
|
---|
35 | /// <param name="errorMessage"></param>
|
---|
36 | /// <returns></returns>
|
---|
37 | bool Check(IEnumerable<T> data, out string errorMessage);
|
---|
38 |
|
---|
39 | /// <summary>
|
---|
40 | /// Configure the internal parameter of the transformation for the given data.
|
---|
41 | /// </summary>
|
---|
42 | /// <param name="data"></param>
|
---|
43 | void Configure(IEnumerable<T> data);
|
---|
44 |
|
---|
45 | /// <summary>
|
---|
46 | /// Transforms the given data based on the transformation's external and internal parameters.
|
---|
47 | /// </summary>
|
---|
48 | /// <param name="data"></param>
|
---|
49 | /// <returns></returns>
|
---|
50 | IEnumerable<T> Apply(IEnumerable<T> data);
|
---|
51 | /// <summary>
|
---|
52 | /// Inverse-transforms the given data based on the transformation's external and internal parameters.
|
---|
53 | /// </summary>
|
---|
54 | /// <param name="data"></param>
|
---|
55 | /// <returns></returns>
|
---|
56 | /// <remarks>If the data cannot be inverse transformed, i.e. if the original data was not in the domain of the transformation,
|
---|
57 | /// the returned values can contain invalid values or <code>InverseApply</code> might throw an exception.</remarks>
|
---|
58 | IEnumerable<T> InverseApply(IEnumerable<T> data);
|
---|
59 | }
|
---|
60 | }
|
---|