Avoid some array copying in add and subtract ArrayFieldVector.

JIRA: MATH-573

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1101579 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2011-05-10 18:19:36 +00:00
parent d84695d151
commit 8ef3dd0269
2 changed files with 7 additions and 4 deletions

View File

@ -383,7 +383,7 @@ public class ArrayFieldVector<T extends FieldElement<T>> implements FieldVector<
for (int i = 0; i < data.length; i++) {
out[i] = data[i].add(v.getEntry(i));
}
return new ArrayFieldVector<T>(out);
return new ArrayFieldVector<T>(field, out, false);
}
}
@ -394,7 +394,7 @@ public class ArrayFieldVector<T extends FieldElement<T>> implements FieldVector<
for (int i = 0; i < data.length; i++) {
out[i] = data[i].add(v[i]);
}
return new ArrayFieldVector<T>(out);
return new ArrayFieldVector<T>(field, out, false);
}
/**
@ -417,7 +417,7 @@ public class ArrayFieldVector<T extends FieldElement<T>> implements FieldVector<
for (int i = 0; i < data.length; i++) {
out[i] = data[i].subtract(v.getEntry(i));
}
return new ArrayFieldVector<T>(out);
return new ArrayFieldVector<T>(field, out, false);
}
}
@ -428,7 +428,7 @@ public class ArrayFieldVector<T extends FieldElement<T>> implements FieldVector<
for (int i = 0; i < data.length; i++) {
out[i] = data[i].subtract(v[i]);
}
return new ArrayFieldVector<T>(out);
return new ArrayFieldVector<T>(field, out, false);
}
/**

View File

@ -52,6 +52,9 @@ The <action> type attribute can be add,update,fix,remove.
If the output is not quite correct, check for invisible trailing spaces!
-->
<release version="3.0" date="TBD" description="TBD">
<action dev="luc" type="fix" issue="MATH-573">
Avoid some array copying in add and subtract ArrayFieldVector.
</action>
<action dev="luc" type="fix" issue="MATH-572">
Fixed an unused constructor parameter in ArrayFieldVector.
</action>