use direct array access where possible

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@729172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2008-12-23 23:25:31 +00:00
parent a20be3af18
commit 13583c53fa
1 changed files with 45 additions and 39 deletions

View File

@ -606,7 +606,9 @@ public abstract class AbstractRealMatrix implements RealMatrix, Serializable {
/** {@inheritDoc} */
public RealVector operate(final RealVector v)
throws IllegalArgumentException {
try {
return new RealVectorImpl(operate(((RealVectorImpl) v).getDataRef()), false);
} catch (ClassCastException cce) {
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
if (v.getDimension() != nCols) {
@ -627,7 +629,7 @@ public abstract class AbstractRealMatrix implements RealMatrix, Serializable {
}
return new RealVectorImpl(out, false);
}
}
/** {@inheritDoc} */
@ -660,6 +662,9 @@ public abstract class AbstractRealMatrix implements RealMatrix, Serializable {
/** {@inheritDoc} */
public RealVector preMultiply(final RealVector v)
throws IllegalArgumentException {
try {
return new RealVectorImpl(preMultiply(((RealVectorImpl) v).getDataRef()), false);
} catch (ClassCastException cce) {
final int nRows = getRowDimension();
final int nCols = getColumnDimension();
@ -683,6 +688,7 @@ public abstract class AbstractRealMatrix implements RealMatrix, Serializable {
return new RealVectorImpl(out);
}
}
/** {@inheritDoc} */
@Deprecated