A new function for vector scaling and addition.
This commit is contained in:
parent
65ce36b901
commit
654e3e8a93
@ -1157,6 +1157,21 @@ public class Mathematics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add vectors scaled: res[i] = s*(v[i] + w[i])
|
||||||
|
*
|
||||||
|
* @param s
|
||||||
|
* @param v
|
||||||
|
* @param w
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static void svvAddAndScale(double s, double[] v, double[] w,
|
||||||
|
double[] res) {
|
||||||
|
for (int i = 0; i < v.length; i++) {
|
||||||
|
res[i] = s * (v[i] + w[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add vectors returning a new vector c = a + b;
|
* Add vectors returning a new vector c = a + b;
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user