private static void daxpy ( double constant , double vector1 [ ] , double vector2 [ ] ) { if ( constant == 0 ) return ; assert vector1 . length == vector2 . length ; for ( int i = 0 ; i < vector1 . length ; i ++ ) { vector2 [ i ] += constant * vector1 [ i ] ; } }
constant times a vector plus a vector