Constructor and Description |
---|
Vec() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addTo(Vec r,
double scale)
Add this vector (scaled) to another vector.
|
abstract void |
addTo(Vec r,
double scale,
int i0,
int i1) |
abstract void |
clear()
Set all elements to zero.
|
abstract Vec |
copy()
Make a copy of the vector
|
abstract Vec |
copy(int i0,
int i1)
create a new, smaller vector beginning at element i0, going
through i1 (inclusive).
|
abstract double[] |
copyArray() |
abstract Vec |
copyPart(int i0,
int i1)
create a same-sized vector containing only the spec'd elements.
|
abstract Vec |
copyPermuteColumns(Permutation p)
reorder the columns of this matrix so that they are:
X' = [ X(perm[0]) X(perm[1]) X(perm[2])... ]
|
abstract double |
dotProduct(Vec r)
Compute the dot product with vector r
|
abstract double |
dotProduct(Vec r,
int i0,
int i1) |
abstract double |
get(int idx)
Get the element at index idx
|
abstract double[] |
getDoubles()
Return an array corresponding to the vector's elements.
|
abstract int |
getNz()
How many non-zero entries are there?
|
abstract double |
normF()
sum of squared elements.
|
void |
plusEquals(int idx,
double v)
Add the value v to each element.
|
void |
plusEquals(int idx,
double[] v)
Add the vector v to the elements beginning at index idx
|
abstract void |
resize(int newlength)
Resize the vector, truncating or adding zeros as appropriate.
|
abstract void |
set(int idx,
double v)
Set the element at index idx to v.
|
abstract int |
size()
How long is the vector?
|
abstract void |
timesEquals(double v)
Multiply all elements in the vector by v
|
abstract void |
timesEquals(double v,
int i0,
int i1)
Multiply the elements between indices [i0,i1] (inclusive) by
v
|
abstract void |
transposeAsColumn(Matrix A,
int col)
Insert this vector as column 'col' in matrix A.
|
abstract void |
transposeAsColumn(Matrix A,
int col,
int i0,
int i1)
Transpose only the elements at indices [i0,i1] inclusive.
|
public abstract double[] getDoubles()
public abstract int size()
public abstract int getNz()
public abstract double get(int idx)
public abstract void set(int idx, double v)
public abstract double dotProduct(Vec r)
public abstract double dotProduct(Vec r, int i0, int i1)
public abstract Vec copy()
public abstract double[] copyArray()
public abstract void resize(int newlength)
public abstract Vec copy(int i0, int i1)
public abstract Vec copyPart(int i0, int i1)
public abstract void timesEquals(double v)
public abstract void timesEquals(double v, int i0, int i1)
public abstract void clear()
public void plusEquals(int idx, double v)
public void plusEquals(int idx, double[] v)
public abstract double normF()
public abstract void transposeAsColumn(Matrix A, int col)
public abstract void transposeAsColumn(Matrix A, int col, int i0, int i1)
public abstract void addTo(Vec r, double scale)
public abstract void addTo(Vec r, double scale, int i0, int i1)
public abstract Vec copyPermuteColumns(Permutation p)