public class SparseVector extends Object implements Serializable
Constructor and Description |
---|
SparseVector(int N)
Constructor. initialize the all 0s vector of length N
|
Modifier and Type | Method and Description |
---|---|
double |
dot(SparseVector b)
Calculates the dot product of this vector a with b
|
double |
get(int i)
get a value
|
int |
nnz() |
double |
norm()
Calculates the 2-norm
|
SparseVector |
plus(SparseVector b)
Calcualtes return a + b
|
void |
put(int i,
double value)
Setter method (should it be renamed to set?)
|
SparseVector |
scale(double alpha)
Calculates alpha * a
|
int |
size() |
String |
toString() |
public SparseVector(int N)
N
- public void put(int i, double value)
i
- set symbolTable[i]value
- public double get(int i)
i
- public int nnz()
public int size()
public double dot(SparseVector b)
b
- public double norm()
public SparseVector scale(double alpha)
alpha
- public SparseVector plus(SparseVector b)
b
- Copyright © 2000–2019 BioJava. All rights reserved.