src/main/java/org/apache/sysds/runtime/compress/utils/LinearAlgebraUtils.java
/**
	 * Add aval to a series of indexes in c.
	 * 
	 * @param aval the value to add
	 * @param c    The output vector to add on
	 * @param bix  The indexes. Note that it is char so it only supports adding to a block at a time.
	 * @param bi   The index to start at inside bix.
	 * @param ci   An Offset into c, to enable adding values to indexes that are higher than char size.
	 * @param len  The number of indexes to take.
	 */
Add aval to a series of indexes in c.

@param aval the value to add
@param c    The output vector to add on
@param bix  The indexes. Note that it is char so it only supports adding to a block at a time.
@param bi   The index to start at inside bix.
@param ci   An Offset into c, to enable adding values to indexes that are higher than char size.
@param len  The number of indexes to take.
Add aval to a series of indexes in c . @param aval the value to add @param c The output vector to add on @param bix The indexes . Note that it is char so it only supports adding to a block at a time . @param bi The index to start at inside bix . @param ci An Offset into c to enable adding values to indexes that are higher than char size . @param len The number of indexes to take .
public static void vectAdd(final double aval, double[] c, char[] bix, final int bi, final int ci, final int len) {
		final int bn = len % 8;
		for(int j = bi; j < bi + bn; j++)
			c[ci + bix[j]] += aval;
		for(int j = bi + bn; j < bi + len; j += 8) {
			c[ci + bix[j + 0]] += aval;
			c[ci + bix[j + 1]] += aval;
			c[ci + bix[j + 2]] += aval;
			c[ci + bix[j + 3]] += aval;
			c[ci + bix[j + 4]] += aval;
			c[ci + bix[j + 5]] += aval;
			c[ci + bix[j + 6]] += aval;
			c[ci + bix[j + 7]] += aval;
		}
	}
public static void vectAdd ( final double aval , double [ ] c , char [ ] bix , final int bi , final int ci , final int len ) { final int bn = len % 8 ; for ( int j = bi ; j < bi + bn ; j ++ ) c [ ci + bix [ j ] ] += aval ; for ( int j = bi + bn ; j < bi + len ; j += 8 ) { c [ ci + bix [ j + 0 ] ] += aval ; c [ ci + bix [ j + 1 ] ] += aval ; c [ ci + bix [ j + 2 ] ] += aval ; c [ ci + bix [ j + 3 ] ] += aval ; c [ ci + bix [ j + 4 ] ] += aval ; c [ ci + bix [ j + 5 ] ] += aval ; c [ ci + bix [ j + 6 ] ] += aval ; c [ ci + bix [ j + 7 ] ] += aval ; } }
Add aval to a series of indexes in c.
Add aval to a series of indexes in c .
// rest, not aligned to 8-blocks // unrolled 8-block (for better instruction-level parallelism)