@TypeInfo(value=DenseVectorTypeInfoFactory.class) @PublicEvolving public class DenseVector extends Object implements Vector
Modifier and Type | Field and Description |
---|---|
double[] |
values |
Constructor and Description |
---|
DenseVector(double[] values) |
DenseVector(int size) |
Modifier and Type | Method and Description |
---|---|
DenseVector |
clone()
Makes a deep copy of the vector.
|
boolean |
equals(Object obj) |
double |
get(int i)
Gets the value of the ith element.
|
int |
hashCode() |
void |
set(int i,
double value)
Sets the value of the ith element.
|
int |
size()
Gets the size of the vector.
|
double[] |
toArray()
Converts the instance to a double array.
|
DenseVector |
toDense()
Converts the instance to a dense vector.
|
SparseVector |
toSparse()
Converts the instance to a sparse vector.
|
String |
toString() |
public DenseVector(double[] values)
public DenseVector(int size)
public int size()
Vector
public double get(int i)
Vector
public void set(int i, double value)
Vector
public double[] toArray()
Vector
public DenseVector toDense()
Vector
public SparseVector toSparse()
Vector
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.