Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiagonalMatrix / Scalar #81

Open
dsimcha opened this issue Dec 20, 2011 · 2 comments
Open

DiagonalMatrix / Scalar #81

dsimcha opened this issue Dec 20, 2011 · 2 comments

Comments

@dsimcha
Copy link
Collaborator

dsimcha commented Dec 20, 2011

import scid.matvec;

void main() {
    auto m = DiagonalMatrix!double([1.0, 2, 3]);
    eval(m / 3.0);
}

scid\ops\expression.d(403): Error: static assert "Types 'BasicMatrix!(BasicDiagonalMatrixStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),cast(DiagonalMatrixStorageType)0))' and 'double' do not define a promotion. "
scid\ops\expression.d(376): instantiated from here: PromotionImpl!(BasicMatrix!(BasicDiagonalMatrixStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),cast(DiagonalMatrixStorageType)0)),double)
scid\ops\expression.d(312): instantiated from here: Promotion!(BasicMatrix!(BasicDiagonalMatrixStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),cast(DiagonalMatrixStorageType)0)),double)
scid\ops\eval.d(70): instantiated from here: ExpressionResult!(Expression!(op,BasicMatrix!(BasicDiagonalMatrixStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),cast(DiagonalMatrixStorageType)0)),Expression!(op,double,double)))
test.d(5): instantiated from here: eval!(Expression!(op,BasicMatrix!(BasicDiagonalMatrixStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),cast(DiagonalMatrixStorageType)0)),Expression!(op,double,double)))

@cristicbz
Copy link
Owner

Yeah, like I mentioned in a commit message, DiagonalMatrices are in need of quite a bit of attention, they were left behind in a refactoring a while back - should I prioritise it higher? I actually didn't think they would be this useful, but you seem to be using them quite a bit.

@dsimcha
Copy link
Collaborator Author

dsimcha commented Dec 20, 2011

I've been working on integrating Dstats into SciD (definitely still a work in progress) and I need diagonal matrices for singular value decomposition and weighted least squares regression. That's where all this is coming from. Overall, though, I don't think diagonal matrices are that high a priority. I just seem to have stumbled on the few use cases where they're needed lately. Just to give a complete answer, here are the things I would put ahead of diagonal matrices, in order of priority. Maybe this should be on the wiki, too, with anything you would add:

  1. Lapack wrappers for basic matrix factorizations. I'm already working on this slowly but surely. SVD and Cholesky are there already because those are the two I happened to have an urgent need for. I want to get around to QR factorization, eigenvalue decomposition, and LU decomposition. I understand that inv(m) * v uses LU decomposition under the hood, but I think it should still be exposed in scid.linalg.
  2. Improving the tests. scid.demo seems to have tests, but they're just not run. I know OPTLINK gets in the way here, though.
  3. Misc. bug fixes.
  4. Fixing symmetric and triangular matrix operations. These are basically unusable right now IIRC. (I haven't really tried to use them because the few things I did try were so horribly broken that I figured they were still a work in progress.)
  5. Benchmarking/performance improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants