Class Mapping
java.lang.Object
com.semedy.reasoner.reasoning.processes.Mapping
Describes a mapping of reasoning relation arguments
map[i] maps argument position i to another one
- Author:
- angele
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()clone a mappingintget(int i) get the mapped indexintgetArity()get the arity of the mappingint[]get the whole mappinginvert()invert a mappingintlength()get length of mappingconcatenate two mappings first m, then thisvoidset(int[] map) set the whole mappingvoidset(int i, int j) map index i to jshrinkArity(int arity) shrink arity of mappingtoString()
-
Field Details
-
_map
public int[] _mapthe mapping
-
-
Constructor Details
-
Mapping
public Mapping(int[] map) given is mapping- Parameters:
map-
-
Mapping
public Mapping(int arity) identity mapping- Parameters:
arity-
-
Mapping
public Mapping(int[] source, int[] dest, int arity) compute mapping- Parameters:
source-dest-arity-
-
-
Method Details
-
length
public int length()get length of mapping- Returns:
-
map
concatenate two mappings first m, then this- Parameters:
m-- Returns:
-
invert
invert a mapping- Returns:
-
clone
clone a mapping -
shrinkArity
shrink arity of mapping- Parameters:
arity-- Returns:
-
getArity
public int getArity()get the arity of the mapping- Returns:
-
get
public int get(int i) get the mapped index- Parameters:
i-- Returns:
-
set
public void set(int i, int j) map index i to j- Parameters:
i-j-
-
set
public void set(int[] map) set the whole mapping- Parameters:
map-
-
getMapping
public int[] getMapping()get the whole mapping- Returns:
-
toString
-