cristicbz / scid

Scientific library for the D programming language
Boost Software License 1.0
23 stars 8 forks source link

Constructing Matrix!float from Matrix!double Fails #34

Closed dsimcha closed 13 years ago

dsimcha commented 13 years ago

This doesn't work (error message below):

import scid.matvec;

void main() {
    auto a = Matrix!double(5, 5);
    Matrix!float b = a;
}

This very similar code does work, though:

import scid.matvec;

void main() {
    auto a = Matrix!double(5, 5);
    Matrix!float b;
    b[] = a;
}

D:\home\dsimcha\customd\scid\ops\common.d(319): Error: template scid.blas.blas.xgecopy(char transA,T) does not match any function template declaration D:\home\dsimcha\customd\scid\ops\common.d(319): Error: template scid.blas.blas.xgecopy(char transA,T) cannot deduce template function from argument types !('t')(uint,uint,const(double),uint,float,uint) D:\home\dsimcha\customd\scid\storage\generalmat.d(86): Error: template instance scid.ops.common.generalMatrixCopy!(tr,BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(double,order),cast(RefCountedAutoInitialize)1)),BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(float,order),cast(RefCountedAutoInitialize)1))) error instantiating D:\home\dsimcha\customd\scid\matrix.d(186): instantiated from here: copy!(cast(Transpose)false,BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(double,order_),cast(RefCountedAutoInitialize)1))) D:\home\dsimcha\bin\test.d(5): instantiated from here: _ctor!(BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(double,order),cast(RefCountedAutoInitialize)1))) D:\home\dsimcha\customd\scid\matrix.d(186): Error: template instance scid.storage.generalmat.BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(float,order),cast(RefCountedAutoInitialize)1)).BasicGeneralMatrixStorage.copy!(cast(Transpose)false,BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(double,order),cast(RefCountedAutoInitialize)1))) error instantiating D:\home\dsimcha\bin\test.d(5): instantiated from here: ctor!(BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(double,order),cast(RefCountedAutoInitialize)1))) D:\home\dsimcha\bin\test.d(5): Error: template instance scid.matrix.BasicMatrix!(BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(float,order),cast(RefCountedAutoInitialize)1))).BasicMatrix.ctor!(BasicGeneralMatrixStorage!(RefCounted!(CowMatrix!(double,order_),cast(RefCountedAutoInitialize)1))) error instantiating

dsimcha commented 13 years ago

Fixed by a recently merged pull request.