Hi, Using Mahout Matrix interface I want to represent some data where the row vector is dense iff an instance is associated to this row index, empty otherwise. The max possible index for rows (a.k.a. rowSize) is defined.
I never query the matrix by column. I want to be able to add rows if the rowId is not larger than the rowSize. Does a matrix implementation exist that I can use, or should I write one? Not to cause an XY problem, here is the particular use case: I row-index a latent factor matrix (for recommendation) with userIDs (and itemIDs for the other matrix). I need fast access to a row vector (to estimate a score for a user-item pair) I tried a SparseColumnMatrix, which degrades -it is designed for fast access by column- the performance. I may use a DenseMatrix, which would either bring a memory overhead (by allocating row vectors for empty rows), or result in losing the ability to add new rows (if I map the userIds to {1,2,...,noOfCurrentUsers} space) Thanks -- Gokhan