Kim van der Linde wrote:
Hi Mark,
Mark R. Diggory wrote:
In my design of the Univariate package, the plan is to apply OO strategies to implement a statistic, this means that
"statistic=class".
The difference of opinion is about this aspect. Are population and
sample variances essential different statistics (you), or mere variants of each other (me). After that, different ways to implement them are possible.
Well, to be honest, I think the design could be maintained either way if the configuration were based in the constructor and there were one Variance Class or if there were two Variance Classes. I just tend to think that We want to promote OO approaches, and using inheritance and class hierarchies, it become very clear when manipulating the objects what type of object your working with.
Ok, then lets start with one very basic issue that I have with the RealMatrix(Impl) classes. I can do double[] getRow() but to use multiply (or any other RealMatrixImpl-based method in that class), I need Matrix getRow() (which needs to be named different as the only difference is the return type, so I called it Matrix getRowMatrix()). These are equal important methods, which only differ in the type they return. I could of course do:
Matrix row = new Matrix(data.getRow(0));
, but then I can see more reason to make a double[][] based MatrixArray class which would reduce the computation load. That would require to have two interfaces and two implementing classes. Which I think is tedious.
I think it would be beneficial to pass "Wrappers" back such as "Matrix" or "Vector" etc. Specifically because its an interface and the backing implementation can be optimized to work with the source objects internal Array without "array copying".
The the internal Constructor to pass it back would look more like:
public Matrix getRowMatrix(int row){
return new SpecialMatrixRowProxyImpl(data,row);
}-Mark -- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
