|
||||||||||
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.IOException
public 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 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 copyMethod Detail |
---|
public void set(int index, double value)
Vector
x(index) = value
set
in interface Vector
set
in class AbstractVector
public void add(int index, double value)
Vector
x(index) += value
add
in interface Vector
add
in class AbstractVector
public double get(int index)
Vector
x(index)
get
in interface Vector
get
in class AbstractVector
public DenseVector copy()
Vector
copy
in interface Vector
copy
in class AbstractVector
public DenseVector zero()
Vector
zero
in interface Vector
zero
in class AbstractVector
public DenseVector scale(double alpha)
Vector
x=alpha*x
scale
in interface Vector
scale
in class AbstractVector
public Vector set(Vector y)
Vector
x=y
set
in interface Vector
set
in class AbstractVector
public Vector set(double alpha, Vector y)
Vector
x=alpha*y
set
in interface Vector
set
in class AbstractVector
public Vector add(Vector y)
Vector
x = y + x
add
in interface Vector
add
in class AbstractVector
public Vector add(double alpha, Vector y)
Vector
x = alpha*y + x
add
in interface Vector
add
in class AbstractVector
public double dot(Vector y)
Vector
xT*y
dot
in interface Vector
dot
in class AbstractVector
protected double norm1()
norm1
in class AbstractVector
protected double norm2()
norm2
in class AbstractVector
protected double norm2_robust()
norm2_robust
in class AbstractVector
protected double normInf()
normInf
in class AbstractVector
public double[] getData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |