there is matrix add API, might map rdd2 each row element to be negative , then make rdd1 and rdd2 and call add ?
Or some more ways ... On Wednesday, September 23, 2015 3:11 PM, Zhiliang Zhu <zchl.j...@yahoo.com> wrote: Hi All, There are two RDDs : RDD<Array<float>> rdd1, and RDD<Array<float>> rdd2,that is to say, rdd1 and rdd2 are similar with DataFrame, or Matrix with same row number and column number. I would like to get RDD<Array<float>> rdd3, each element in rdd3 is the subtract between rdd1 and rdd2 of thesame position, which is similar Matrix subtract:rdd3<i, j> = rdd1<i, j> - rdd2<i, j> ... It seemed very difficult to operate this kinds of matrix arithmetic, even is about add, subtract, multiple , diff etc... I shall appreciate your help very much~~Zhiliang