001 /*
002 * Copyright (C) 2008-2009 Holger Arndt, A. Naegele and M. Bundschus
003 *
004 * This file is part of the Java Data Mining Package (JDMP).
005 * See the NOTICE file distributed with this work for additional
006 * information regarding copyright ownership and licensing.
007 *
008 * JDMP is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU Lesser General Public License as
010 * published by the Free Software Foundation; either version 2
011 * of the License, or (at your option) any later version.
012 *
013 * JDMP is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU Lesser General Public License for more details.
017 *
018 * You should have received a copy of the GNU Lesser General Public
019 * License along with JDMP; if not, write to the
020 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
021 * Boston, MA 02110-1301 USA
022 */
023
024 package org.jdmp.core.algorithm;
025
026 import java.util.List;
027 import java.util.Map;
028
029 import org.jdmp.core.CoreObject;
030 import org.jdmp.core.variable.HasVariableMap;
031 import org.jdmp.core.variable.Variable;
032 import org.ujmp.core.Matrix;
033
034 public interface Algorithm extends CoreObject, HasVariableMap, HasAlgorithmMap {
035 public static final Class<?>[] ALGORITHMARRAY = new Class<?>[] { new Algorithm[] {}.getClass() };
036
037 public enum EdgeDirection {
038 NotConnected, Incoming, Outgoing, Bidirectional
039 };
040
041 public static final String SOURCE = "Source";
042
043 public static final String DIMENSION = "Dimension";
044
045 public static final String IGNORENAN = "IgnoreNaN";
046
047 public static final String TARGET = "Target";
048
049 public void setVariable(Object key, Variable variable);
050
051 public void setAlgorithm(Object key, Algorithm a);
052
053 public Map<Object, Object> calculate() throws Exception;
054
055 public Map<Object, Object> calculate(Matrix... input) throws Exception;
056
057 public Map<Object, Object> calculateObjects(Object... input) throws Exception;
058
059 public Map<Object, Object> calculate(double... input) throws Exception;
060
061 public Map<Object, Object> calculate(List<Matrix> matrices) throws Exception;
062
063 public Map<Object, Object> calculateObjects(List<Object> matrices) throws Exception;
064
065 public Map<Object, Object> calculateObjects(Map<Object, Object> objects) throws Exception;
066
067 public EdgeDirection getEdgeDirection(Object key);
068
069 public String getEdgeLabel(Object key);
070
071 public void setEdgeDirection(Object key, EdgeDirection direction);
072
073 public void setEdgeLabel(Object key, String edgeLabel);
074
075 public void addVariableKey(Object key);
076
077 public void setVariables(Variable... variables);
078
079 public List<Object> getVariableKeys();
080
081 public List<Object> getInputKeys();
082
083 public List<Object> getOutputKeys();
084
085 }