Package org.nd4j.list
Class NDArrayList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<X>
-
- org.nd4j.list.BaseNDArrayList<Double>
-
- org.nd4j.list.NDArrayList
-
public class NDArrayList extends BaseNDArrayList<Double>
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description NDArrayList()NDArrayList(int size)Initialize with the desired size.NDArrayList(@NonNull INDArray container)Specify the underlying ndarray for this list.NDArrayList(@NonNull INDArray container, int size)Specify the underlying ndarray for this list.NDArrayList(DataType dataType, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int i, Double aDouble)booleanadd(Double aDouble)booleanaddAll(int i, Collection<? extends Double> collection)booleanaddAll(Collection<? extends Double> collection)INDArrayarray()Get a view of the underlying array relative to the size of the actual array.voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> collection)Doubleget(int i)intindexOf(Object o)booleanisEmpty()Iterator<Double>iterator()intlastIndexOf(Object o)ListIterator<Double>listIterator()ListIterator<Double>listIterator(int i)Doubleremove(int i)booleanremove(Object o)booleanremoveAll(Collection<?> collection)booleanretainAll(Collection<?> collection)Doubleset(int i, Double aDouble)intsize()List<Double>subList(int i, int i1)Object[]toArray()<T> T[]toArray(T[] ts)StringtoString()-
Methods inherited from class java.util.AbstractList
equals, hashCode, removeRange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Constructor Detail
-
NDArrayList
public NDArrayList(int size)
Initialize with the desired size. This will set the list.size() to be equal to the passed in size- Parameters:
size- the initial size of the array
-
NDArrayList
public NDArrayList(DataType dataType, int size)
-
NDArrayList
public NDArrayList(@NonNull @NonNull INDArray container, int size)Specify the underlying ndarray for this list.- Parameters:
container- the underlying array.size- the initial size of the array. This will set list.size() to be equal to the passed in size.
-
NDArrayList
public NDArrayList()
-
NDArrayList
public NDArrayList(@NonNull @NonNull INDArray container)Specify the underlying ndarray for this list.- Parameters:
container- the underlying array.
-
-
Method Detail
-
array
public INDArray array()
Get a view of the underlying array relative to the size of the actual array. (Sometimes there are overflows in the internals but you want to use the internal INDArray for computing something directly, this gives you the relevant subset that reflects the content of the list)- Overrides:
arrayin classBaseNDArrayList<Double>- Returns:
- the view of the underlying ndarray relative to the collection's real size
-
size
public int size()
- Specified by:
sizein interfaceCollection<Double>- Specified by:
sizein interfaceList<Double>- Overrides:
sizein classBaseNDArrayList<Double>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<Double>- Specified by:
isEmptyin interfaceList<Double>- Overrides:
isEmptyin classBaseNDArrayList<Double>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Double>- Specified by:
containsin interfaceList<Double>- Overrides:
containsin classBaseNDArrayList<Double>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<Double>- Specified by:
toArrayin interfaceList<Double>- Overrides:
toArrayin classBaseNDArrayList<Double>
-
toArray
public <T> T[] toArray(T[] ts)
- Specified by:
toArrayin interfaceCollection<Double>- Specified by:
toArrayin interfaceList<Double>- Overrides:
toArrayin classBaseNDArrayList<Double>
-
add
public boolean add(Double aDouble)
- Specified by:
addin interfaceCollection<Double>- Specified by:
addin interfaceList<Double>- Overrides:
addin classBaseNDArrayList<Double>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Double>- Specified by:
removein interfaceList<Double>- Overrides:
removein classBaseNDArrayList<Double>
-
containsAll
public boolean containsAll(Collection<?> collection)
- Specified by:
containsAllin interfaceCollection<Double>- Specified by:
containsAllin interfaceList<Double>- Overrides:
containsAllin classBaseNDArrayList<Double>
-
addAll
public boolean addAll(Collection<? extends Double> collection)
- Specified by:
addAllin interfaceCollection<Double>- Specified by:
addAllin interfaceList<Double>- Overrides:
addAllin classBaseNDArrayList<Double>
-
addAll
public boolean addAll(int i, Collection<? extends Double> collection)
-
removeAll
public boolean removeAll(Collection<?> collection)
- Specified by:
removeAllin interfaceCollection<Double>- Specified by:
removeAllin interfaceList<Double>- Overrides:
removeAllin classBaseNDArrayList<Double>
-
retainAll
public boolean retainAll(Collection<?> collection)
- Specified by:
retainAllin interfaceCollection<Double>- Specified by:
retainAllin interfaceList<Double>- Overrides:
retainAllin classBaseNDArrayList<Double>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<Double>- Specified by:
clearin interfaceList<Double>- Overrides:
clearin classBaseNDArrayList<Double>
-
get
public Double get(int i)
-
add
public void add(int i, Double aDouble)
-
remove
public Double remove(int i)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Double>- Overrides:
lastIndexOfin classBaseNDArrayList<Double>
-
listIterator
public ListIterator<Double> listIterator()
- Specified by:
listIteratorin interfaceList<Double>- Overrides:
listIteratorin classBaseNDArrayList<Double>
-
listIterator
public ListIterator<Double> listIterator(int i)
- Specified by:
listIteratorin interfaceList<Double>- Overrides:
listIteratorin classBaseNDArrayList<Double>
-
toString
public String toString()
- Overrides:
toStringin classBaseNDArrayList<Double>
-
-