Opened 15 years ago

Closed 5 months ago

Last modified 4 weeks ago

#202 closed enhancement (fixed)

Matrix View

Reported by: Jari Häkkinen Owned by: Peter
Priority: major Milestone: yat 0.20
Component: utility Version: trunk
Keywords: Cc:

Description


Change History (20)

comment:1 Changed 15 years ago by Jari Häkkinen

Summary: utility::matrix has internal support for matrix views but there is no interface to create a matrix viewutility::matrix has internal support for const matrix views but there is no interface to create a const matrix view

comment:2 Changed 15 years ago by Jari Häkkinen

There is a test in matrix_test.cc that must be fixed when resolving this ticket. Look for a comment with ticket:202 in the code, this will point you to the code that needs to be changed.

comment:3 Changed 15 years ago by Peter

Related to this is that the following constructor should be removed from interface. It is a flaw to allow thos constructor because it creates a huge hole against const correctness.

vector(const vector& v, size_t offset, size_t n, size_t stride=1);

comment:4 Changed 13 years ago by Jari Häkkinen

Type: defectenhancement

comment:5 Changed 8 months ago by Peter

Owner: changed from Jari Häkkinen to Peter
Status: newaccepted
Summary: utility::matrix has internal support for const matrix views but there is no interface to create a const matrix viewMatrix View

It's time to implement this. Follow the same class hierarchy as Vector classes.

comment:6 Changed 8 months ago by Peter

Milestone: yat 0.x+yat 0.20

comment:7 Changed 8 months ago by Peter

In 4119:

split Matrix interface into three classes: MatrixBase?, MatrixMutable? and Matrix. refs #202

comment:8 Changed 6 months ago by Peter

In 4124:

refs #202. Rearrange structure of matrix classes. After trying a few
combinations, I decided to put the gsl_matrix* in MatrixMutable? and
MatrixBase? can access it via a virtual function. In that way we can
avoid having two pointers like in the Vector hierarchy where there is
a pointer in VectorMutable? and const pointer in VectorBase? and they
need to be equal all the time (which is a pain to maintain).

comment:9 Changed 6 months ago by Peter

In 4125:

when possible change public interface 'const Matrix&' and 'Matrix&' to 'const MatrixBase?&' and 'MatrixMutable?&', respectively, except for virtual and deprecated functionality. refs #202.

comment:10 Changed 6 months ago by Peter

There is a pure virtual function in Multivariate

virtual void fit(const utility::Matrix& x, const utility::VectorBase& y)=0;

where we would like to change to take MatrixBase with the downside that it'd break all classes inheriting from this interface class. A way to introduce MatrixBase? is to introduce a virtual fit2 class taking MatrixBase, for which the default implementation is to copy to a Matrix and call fit function.

comment:11 Changed 5 months ago by Peter

In 4129:

refs #202. Adding classes for Matrix View (and corresponding const version)

comment:12 Changed 5 months ago by Peter

In 4130:

Add function fit2 taking new class MatrixBase?. Keep the old interface
with a pure virtual function fit (for backward compability
reasons). For the same reason do not make this new function pure
virtual but provide a default implementation, which uses the the
implementation of the old function. Add some superficial tests for
these functions.

refs #202

comment:13 Changed 5 months ago by Peter

In 4131:

tests for Matrix View iterators; refs #975 and #202.

comment:14 Changed 5 months ago by Peter

In 4133:

refs #202 and #975; fix issue with column_iterators in matrix view setting the stride to tda rather than columns() of the view.

comment:15 Changed 5 months ago by Peter

In 4134:

avoid duplicated typedefs for mutable iterators in MatrixBase? and MatrixMutable?; refs #975 and #202

comment:16 Changed 5 months ago by Peter

In 4136:

closes #975 and refs #202; use Container2DIterator as MatrixBase::const_iterator and MatrixMutable::iterator.

comment:17 Changed 5 months ago by Peter

Resolution: fixed
Status: acceptedclosed

In 4137:

add proxy class to allow returnning a MatrixView? from a function (same solution as in VectorView?). closes #202

comment:18 Changed 5 months ago by Peter

In 4140:

allow MatrixBase? as input in inverse_svd (refs #202). In Perceptron, help the compiler figure out that the MatrixExpression? can be converted to a Matrix (i.e. a MatrixBase?) (refs #897).

comment:19 Changed 6 weeks ago by Peter

In 4174:

Fix major memory leak introduced during the refactoring of the
Matrix class (refs #202). Has only been exposed in the trunk.

comment:20 Changed 4 weeks ago by Peter

In 4178:

avoid limit interface to Matrix when not needed. refs #202

Note: See TracTickets for help on using tickets.