|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectno.uib.cipr.matrix.AbstractVector
no.uib.cipr.matrix.DenseVector
public class DenseVector
Dense vector. Stored by a double[] array of the same length as
the vector itself.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface no.uib.cipr.matrix.Vector |
|---|
Vector.Norm |
| Field Summary |
|---|
| Fields inherited from class no.uib.cipr.matrix.AbstractVector |
|---|
size |
| Constructor Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class no.uib.cipr.matrix.AbstractVector |
|---|
check, checkSize, iterator, norm, size, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DenseVector(MatrixVectorReader r)
throws java.io.IOException
r - Reader to get vector from
java.io.IOExceptionpublic DenseVector(int size)
size - Size of the vectorpublic DenseVector(Vector x)
x - Copies contents from this vector. A deep copy is made
public DenseVector(Vector x,
boolean deep)
x - Copies contents from this vectordeep - True for a deep copy. For a shallow copy, x
must be a DenseVector
public 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 copy| Method Detail |
|---|
public void set(int index,
double value)
Vectorx(index) = value
set in interface Vectorset in class AbstractVector
public void add(int index,
double value)
Vectorx(index) += value
add in interface Vectoradd in class AbstractVectorpublic double get(int index)
Vectorx(index)
get in interface Vectorget in class AbstractVectorpublic DenseVector copy()
Vector
copy in interface Vectorcopy in class AbstractVectorpublic DenseVector zero()
Vector
zero in interface Vectorzero in class AbstractVectorpublic DenseVector scale(double alpha)
Vectorx=alpha*x
scale in interface Vectorscale in class AbstractVectorpublic Vector set(Vector y)
Vectorx=y
set in interface Vectorset in class AbstractVector
public Vector set(double alpha,
Vector y)
Vectorx=alpha*y
set in interface Vectorset in class AbstractVectorpublic Vector add(Vector y)
Vectorx = y + x
add in interface Vectoradd in class AbstractVector
public Vector add(double alpha,
Vector y)
Vectorx = alpha*y + x
add in interface Vectoradd in class AbstractVectorpublic double dot(Vector y)
VectorxT*y
dot 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||