cc.redberry.core.indices
Class IndicesBuilder
- java.lang.Object
-
- cc.redberry.core.indices.IndicesBuilder
-
public final class IndicesBuilder extends java.lang.ObjectBuilder of unordered indices. This class provides functionality to construct unorderedIndicesobject by combining otherIndicesobjects. For example, if we have a productX_mn*Y_abwe can construct products indices by appending consequentially indices of tensorXandYtoIndicesBuilder. As the result this class returnsSortedIndicesinstance.- Since:
- 1.0
- See Also:
Indices
-
-
Constructor Summary
Constructors Constructor and Description IndicesBuilder()IndicesBuilder(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IndicesBuilderappend(java.util.Collection<? extends Tensor> tensors)Appends consequentially indices oftensorsin specified array.IndicesBuilderappend(Indices indices)Appends specifiedIndices.IndicesBuilderappend(IndicesBuilder ib)Appends specifiedIndicesBuilder.IndicesBuilderappend(int index)Appends index to thisIndicesBuilderappend(int[] indices)Sequentially appends all indices from specified arrayIndicesBuilderappend(int[][] indices)Sequentially appends all indices from specified array.IndicesBuilderappend(IntArray indices)Sequentially appends all indices from specified arrayIndicesBuilderappend(IntArrayList indices)Appends indices representation of specifiedIntArrayList.IndicesBuilderappend(Tensor... tensors)Appends consequentially indices oftensorsin specified array.IndicesBuilderappend(Tensor tensor)Appends indices of specifiedTensor.IndicesBuilderclone()IndicesgetIndices()Returns resultingIndices.int[]toArray()Returns integer array, representing indices, constructed in thisIndicesBuilder.java.lang.StringtoString()
-
-
-
Constructor Detail
-
IndicesBuilder
public IndicesBuilder()
-
IndicesBuilder
public IndicesBuilder(int capacity)
-
-
Method Detail
-
append
public IndicesBuilder append(int index)
Appends index to this- Parameters:
index- index to be appended- Returns:
- a reference to this object
-
append
public IndicesBuilder append(int[] indices)
Sequentially appends all indices from specified array- Parameters:
indices- indices to be appended- Returns:
- a reference to this object
-
append
public IndicesBuilder append(int[][] indices)
Sequentially appends all indices from specified array.- Parameters:
indices- indices to be appended- Returns:
- a reference to this object
-
append
public IndicesBuilder append(IntArray indices)
Sequentially appends all indices from specified array- Parameters:
indices- indices to be appended- Returns:
- a reference to this object
-
append
public IndicesBuilder append(IntArrayList indices)
Appends indices representation of specifiedIntArrayList.- Parameters:
indices- indices to be appended- Returns:
- a reference to this object
-
append
public IndicesBuilder append(Indices indices)
Appends specifiedIndices.- Parameters:
indices- indices to be appended- Returns:
- a reference to this object
-
append
public IndicesBuilder append(IndicesBuilder ib)
Appends specifiedIndicesBuilder.- Parameters:
ib- IndicesBuilder- Returns:
- a reference to this object
-
append
public IndicesBuilder append(Tensor tensor)
Appends indices of specifiedTensor.- Parameters:
tensor- a tensor- Returns:
- a reference to this object
-
append
public IndicesBuilder append(java.util.Collection<? extends Tensor> tensors)
Appends consequentially indices oftensorsin specified array.- Parameters:
tensors- a collection of tensors- Returns:
- a reference to this object
-
append
public IndicesBuilder append(Tensor... tensors)
Appends consequentially indices oftensorsin specified array.- Parameters:
tensors- an array of tensors- Returns:
- a reference to this object
-
getIndices
public Indices getIndices()
Returns resultingIndices.- Returns:
- resulting
Indices - Throws:
InconsistentIndicesException- if there was more then one same index (with same names, types and states)
-
toArray
public int[] toArray()
Returns integer array, representing indices, constructed in thisIndicesBuilder.- Returns:
- integer array, representing indices, constructed in this
IndicesBuilder
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
public IndicesBuilder clone()
- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG