public class DenseVector extends AbstractVector implements Serializable
double[] array of the same length as
the vector itself.Vector.Normsize| Constructor and Description |
|---|
DenseVector(double[] x)
Constructor for DenseVector
|
DenseVector(double[] x,
boolean deep)
Constructor for DenseVector
|
DenseVector(int size)
Constructor for DenseVector
|
DenseVector(MatrixVectorReader r)
Constructor for DenseVector
|
DenseVector(Vector x)
Constructor for DenseVector
|
DenseVector(Vector x,
boolean deep)
Constructor for DenseVector
|
| 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 |
DenseVector |
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 vector contents.
|
protected double |
norm1() |
protected double |
norm2_robust() |
protected double |
norm2() |
protected double |
normInf() |
DenseVector |
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 |
DenseVector |
zero()
Zeros all the entries in the vector, while preserving any underlying
structure
|
check, checkSize, iterator, norm, size, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic DenseVector(MatrixVectorReader r) throws IOException
r - Reader to get vector fromIOExceptionpublic DenseVector(int size)
size - Size of the vectorpublic DenseVector(Vector x)
x - Copies contents from this vector. A deep copy is madepublic DenseVector(Vector x, boolean deep)
x - Copies contents from this vectordeep - True for a deep copy. For a shallow copy, x must
be a DenseVectorpublic DenseVector(double[] x,
boolean deep)
x - Copies contents from this arraydeep - True for a deep copy. For a shallow copy, x is
aliased with the internal storagepublic DenseVector(double[] x)
x - Copies contents from this array in a deep copypublic 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 DenseVector copy()
Vectorcopy in interface Vectorcopy in class AbstractVectorpublic DenseVector zero()
Vectorzero in interface Vectorzero in class AbstractVectorpublic DenseVector 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 AbstractVectorprotected double norm1()
norm1 in class AbstractVectorprotected double norm2()
norm2 in class AbstractVectorprotected double norm2_robust()
norm2_robust in class AbstractVectorprotected double normInf()
normInf in class AbstractVectorpublic double[] getData()
Copyright © 2015. All Rights Reserved.