Opened 14 years ago

Closed 14 years ago

#363 closed discussion (fixed)

Weighted Mutable Matrix

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.5
Component: utility Version: trunk
Keywords: Cc:


I think this is a missing feature. One could of course deal with weights as it is done in WeNNI, using two matrices: one data matrix and one weight matrix. However, if we are turning towards more of iterator interfaces this will not suit so well. One would like an iterator that iterator over data-weight pairs akin MatrixLookupWeighted.

Two obvious designs could be used here:

  1. store data as two matrices
  2. store data as e.g. std::vector<std::pair<double, double> >

1.) is likely to involve less work since most implementation is to call matrix functions. This is essentially how MatrixLookupWeighted is implemented. 2.) is more natural in some sence since the atom here is the data-weight pair, and thus it is natural to bind them tight together (i.e. not separate them into different matrices). The downside of this strategy is that gsl_matrix cannot be used directly. Perhaps one could utilize gsl_matrix_complex...

However, if we'll decide to go for 2.) I think the the type should be std::pair<double, double>. We should also take into account that how this class will interact with MatrixLookupWeighted. It should be parallel to how Matrix interacts with MatrixLookup. In fact, we have to analyze how all these four classes would interact...

I just realized that another alternative would be to use MTL. I guess as it is templatized it would work using T=std::pair<double,double>, right?

Change History (3)

comment:1 Changed 14 years ago by Peter

Owner: changed from Jari Häkkinen to Peter
Status: newassigned

comment:2 Changed 14 years ago by Peter

fixed in [1380] [1381] & [1382]

comment:3 Changed 14 years ago by Peter

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.