E
- Base type for elements of the matrix.public class GenericVector<E> extends java.lang.Object implements VectorI
setEle(int, Object)
method. Both of these take a standard form.
class ComplexVector extends GenericVector<Complex> { protected ComplexVector(Complex[][] data) { super(data); } @Override public void setEle(int row, int col, Object val) throws EvaluationException { if(val instanceof Complex) this.setEleG(row, col, (Complex) val); else throw new EvaluationException("Complex Vector setEle: element should Complex. It was "+val.toString()); } }
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object[] |
data |
Constructor and Description |
---|
GenericVector(java.lang.Object[] data) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Tests equality using the Arrays.equals method.
|
Dimensions |
getDimensions()
Gets the dimensions of the Vector or Matrix
|
E |
getEle(int i)
Gets the i-th element of a vector
|
int |
getNEles()
Gets the number of elements of a vector
|
int |
hashCode() |
void |
setEle(int i,
java.lang.Object val)
Sets an element of a vector.
|
void |
setEleG(int i,
E val) |
java.lang.Object[] |
toArray(java.lang.Object[] vec) |
java.lang.String |
toString() |
public E getEle(int i)
VectorI
public void setEleG(int i, E val) throws EvaluationException
EvaluationException
public void setEle(int i, java.lang.Object val) throws EvaluationException
VectorI
setEle
in interface VectorI
EvaluationException
public int getNEles()
VectorI
public Dimensions getDimensions()
VectorI
getDimensions
in interface VectorI
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object[] toArray(java.lang.Object[] vec) throws EvaluationException
toArray
in interface VectorI
EvaluationException
Copyright © 2018 Singular Systems http://www.singularsys.com/jep