public class NDArrayIndex extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NDArrayIndex.NDArrayIndexAll |
Constructor and Description |
---|
NDArrayIndex(int... indices)
NDArrayIndexing based on the given
indexes
|
Modifier and Type | Method and Description |
---|---|
static NDArrayIndex |
all()
Represents collecting all elements
|
static NDArrayIndex |
concat(NDArrayIndex... indexes)
Concatneate all of the given indices in to one
|
static NDArrayIndex[] |
create(INDArray index)
Create from a matrix.
|
static NDArrayIndex[] |
createCoveringShape(int[] shape)
Creates an index covering the given shape
(for each dimension 0,shape[i])
|
int |
end() |
boolean |
equals(Object o) |
int |
hashCode() |
int[] |
indices() |
static NDArrayIndex |
interval(int begin,
int end)
Generates an interval from begin (inclusive) to end (exclusive)
|
static NDArrayIndex |
interval(int begin,
int end,
boolean inclusive)
Generates an interval from begin (inclusive) to end (exclusive)
|
static NDArrayIndex |
interval(int begin,
int stride,
int end)
Generates an interval from begin (inclusive) to end (exclusive)
|
static NDArrayIndex |
interval(int begin,
int stride,
int end,
boolean inclusive)
Generates an interval from begin (inclusive) to end (exclusive)
|
boolean |
isInterval() |
int |
length()
Returns the length of the indices
|
int |
offset() |
static NDArrayIndex[] |
rangeOfLength(NDArrayIndex... indexes)
Create a range based on the given indexes.
|
void |
reverse() |
void |
setInterval(boolean isInterval) |
String |
toString() |
public NDArrayIndex(int... indices)
indices
- public static NDArrayIndex all()
public static NDArrayIndex[] createCoveringShape(int[] shape)
shape
- the shape to coverpublic static NDArrayIndex[] rangeOfLength(NDArrayIndex... indexes)
indexes
- the indexes to create the range forpublic static NDArrayIndex[] create(INDArray index)
index
- the matrix to getFloat indices frompublic static NDArrayIndex concat(NDArrayIndex... indexes)
indexes
- the indexes to concatneatepublic static NDArrayIndex interval(int begin, int stride, int end)
begin
- the beginstride
- the stride at which to incrementend
- the end indexpublic static NDArrayIndex interval(int begin, int stride, int end, boolean inclusive)
begin
- the beginstride
- the stride at which to incrementend
- the end indexinclusive
- whether the end should be inclusive or notpublic static NDArrayIndex interval(int begin, int end)
begin
- the beginend
- the end indexpublic static NDArrayIndex interval(int begin, int end, boolean inclusive)
begin
- the beginend
- the end indexinclusive
- whether the end should be inclusive or notpublic int end()
public int offset()
public int length()
public int[] indices()
public void reverse()
public boolean isInterval()
public void setInterval(boolean isInterval)
Copyright © 2015. All Rights Reserved.