public class MapVector extends AbstractVector implements ISparseVector
Vector.Normsize| Constructor and Description |
|---|
MapVector(int size) |
MapVector(int size,
java.util.function.Supplier<java.util.Map<java.lang.Integer,java.lang.Double>> supplier) |
MapVector(Vector x) |
MapVector(Vector x,
java.util.function.Supplier<java.util.Map<java.lang.Integer,java.lang.Double>> supplier) |
| Modifier and Type | Method and Description |
|---|---|
Vector |
add(double alpha,
Vector y)
x = alpha*y + x |
void |
add(int index,
double value)
x(index) += value |
Vector |
add(Vector y)
x = y + x |
void |
compact()
Compacts the vector
|
Vector |
copy()
Creates a deep copy of the vector
|
double |
dot(Vector y)
xT*y |
double |
get(int index)
Returns
x(index) |
double[] |
getData()
Returns the internal value array.
|
int[] |
getIndex()
Returns the indices
|
int |
getUsed()
Number of entries used in the sparse structure
|
java.util.Iterator<VectorEntry> |
iterator() |
Vector |
scale(double alpha)
x=alpha*x |
Vector |
set(double alpha,
Vector y)
x=alpha*y |
void |
set(int index,
double value)
x(index) = value |
Vector |
set(Vector y)
x=y |
int |
size()
Size of the vector
|
Vector |
zero()
Zeros all the entries in the vector, while preserving any underlying
structure
|
check, checkSize, norm, norm1, norm2_robust, norm2, normInf, toStringpublic MapVector(int size)
public MapVector(int size,
java.util.function.Supplier<java.util.Map<java.lang.Integer,java.lang.Double>> supplier)
public MapVector(Vector x)
public MapVector(Vector x, java.util.function.Supplier<java.util.Map<java.lang.Integer,java.lang.Double>> supplier)
public int size()
Vectorsize in interface Vectorsize in class AbstractVectorpublic void set(int index,
double value)
Vectorx(index) = valueset in interface Vectorset in class AbstractVectorpublic void add(int index,
double value)
Vectorx(index) += valueadd in interface Vectoradd in class AbstractVectorpublic double get(int index)
Vectorx(index)get in interface Vectorget in class AbstractVectorpublic Vector copy()
Vectorcopy in interface Vectorcopy in class AbstractVectorpublic Vector zero()
Vectorzero in interface Vectorzero in class AbstractVectorpublic Vector scale(double alpha)
Vectorx=alpha*xscale in interface Vectorscale in class AbstractVectorpublic Vector set(Vector y)
Vectorx=yset in interface Vectorset in class AbstractVectorpublic Vector set(double alpha, Vector y)
Vectorx=alpha*yset in interface Vectorset in class AbstractVectorpublic Vector add(Vector y)
Vectorx = y + xadd in interface Vectoradd in class AbstractVectorpublic Vector add(double alpha, Vector y)
Vectorx = alpha*y + xadd in interface Vectoradd in class AbstractVectorpublic double dot(Vector y)
VectorxT*ydot in interface Vectordot in class AbstractVectorpublic java.util.Iterator<VectorEntry> iterator()
iterator in interface java.lang.Iterable<VectorEntry>iterator in class AbstractVectorpublic int[] getIndex()
ISparseVectorgetIndex in interface ISparseVectorpublic int getUsed()
ISparseVectorgetUsed in interface ISparseVectorpublic void compact()
ISparseVectorcompact in interface ISparseVectorpublic double[] getData()
ISparseVectorgetData in interface ISparseVectorCopyright © 2019. All Rights Reserved.