Skip to content

Commit

Permalink
Fixed Issue 24.
Browse files Browse the repository at this point in the history
  • Loading branch information
cristicbz committed Aug 5, 2011
1 parent fb6acb2 commit f1ce568
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 21 deletions.
Binary file modified scid.suo
Binary file not shown.
16 changes: 8 additions & 8 deletions scid/bindings/blas/dblas.d
Original file line number Diff line number Diff line change
Expand Up @@ -421,17 +421,17 @@ void tpmv(char uplo, char trans, char diag, f_int n, f_cdouble *ap, f_cdouble *x
OR x := A.inv.T * x
OR x := A.inv.H * x
*/
void trsv(char uplo, char trans, char diag, f_int n, f_float *A, f_int lda, f_float *x, f_int incx) {
strsv_(&uplo, &trans, &diag, &n, A, &lda, x, &incx, 1, 1, 1);
void trsv(char uplo, char trans, char diag, f_int n, const f_float *A, f_int lda, f_float *x, f_int incx) {
strsv_(&uplo, &trans, &diag, &n, cast(f_float*)A, &lda, x, &incx, 1, 1, 1);
}
void trsv(char uplo, char trans, char diag, f_int n, f_double *A, f_int lda, f_double *x, f_int incx) {
dtrsv_(&uplo, &trans, &diag, &n, A, &lda, x, &incx, 1, 1, 1);
void trsv(char uplo, char trans, char diag, f_int n, const f_double *A, f_int lda, f_double *x, f_int incx) {
dtrsv_(&uplo, &trans, &diag, &n, cast(f_double*)A, &lda, x, &incx, 1, 1, 1);
}
void trsv(char uplo, char trans, char diag, f_int n, f_cfloat *A, f_int lda, f_cfloat *x, f_int incx) {
ctrsv_(&uplo, &trans, &diag, &n, A, &lda, x, &incx, 1, 1, 1);
void trsv(char uplo, char trans, char diag, f_int n, const f_cfloat *A, f_int lda, f_cfloat *x, f_int incx) {
ctrsv_(&uplo, &trans, &diag, &n, cast(f_cfloat*)A, &lda, x, &incx, 1, 1, 1);
}
void trsv(char uplo, char trans, char diag, f_int n, f_cdouble *A, f_int lda, f_cdouble *x, f_int incx) {
ztrsv_(&uplo, &trans, &diag, &n, A, &lda, x, &incx, 1, 1, 1);
void trsv(char uplo, char trans, char diag, f_int n, const f_cdouble *A, f_int lda, f_cdouble *x, f_int incx) {
ztrsv_(&uplo, &trans, &diag, &n, cast(f_cdouble*)A, &lda, x, &incx, 1, 1, 1);
}

/** solving triangular banded matrix problems
Expand Down
16 changes: 13 additions & 3 deletions scid/demo.d
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,18 @@ version( demo ) {
enforce( array[ 0 .. 2 ] == [ 10., 22. ] );
}



void main() {
externalViews();
Vector!double v;
foo( v );
writeln( v[ 0 ] );
readln();
}
}


void foo( V )( ref V vec ) {
vec = V( 5, null );
writeln( vec.length );
vec[ 0 ] = 6;
}
}
3 changes: 2 additions & 1 deletion scid/scid.visualdproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<oneobj>0</oneobj>
<trace>0</trace>
<quiet>0</quiet>
<verbose>1</verbose>
<verbose>0</verbose>
<vtls>0</vtls>
<symdebug>2</symdebug>
<optimize>0</optimize>
Expand Down Expand Up @@ -225,6 +225,7 @@
<File path="storage\triangular.d" />
<File path="storage\external.d" />
<File path="storage\diagonalmat.d" />
<File path="storage\triangularview.d" />
</Folder>
<File path="exception.d" />
<File path="types.d" />
Expand Down
6 changes: 3 additions & 3 deletions scid/storage/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct BasicArrayStorage( ContainerRef_, VectorType vectorType_ = VectorType.Col
This ensures copy semantics on assignment.
*/
this( this ) {
if( containerRef_.RefCounted.isInitialized() )
if( isInitd_() )
containerRef_ = ContainerRef( containerRef_.ptr );
}

Expand All @@ -89,7 +89,7 @@ struct BasicArrayStorage( ContainerRef_, VectorType vectorType_ = VectorType.Col

/** Implements copy on assignment semnatics. */
ref typeof(this) opAssign( typeof(this) rhs ) {
swap( rhs.containerRef_, containerRef_ );
move( rhs.containerRef_, containerRef_ );
return this;
}

Expand Down Expand Up @@ -251,7 +251,7 @@ private:

// Constructor for slice()
this()( ContainerRef containerRef ) {
swap( containerRef, containerRef_ );
move( containerRef, containerRef_ );
}

// The wrapped reference.
Expand Down
10 changes: 5 additions & 5 deletions scid/storage/generalmatview.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ struct BasicGeneralMatrixViewStorage( ContainerRef_ ) {
}

ref typeof( this ) opAssign( typeof( this ) rhs ) {
swap( rhs.containerRef_, containerRef_ );
firstIndex_ = rhs.firstIndex_;
rows_ = rhs.rows_;
cols_ = rhs.cols_;
leading_ = rhs.leading_;
containerRef_ = rhs.containerRef_;
firstIndex_ = rhs.firstIndex_;
rows_ = rhs.rows_;
cols_ = rhs.cols_;
leading_ = rhs.leading_;
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion scid/vector.d
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct BasicVector( Storage_ ) {
}

ref typeof(this) opAssign( typeof(this) rhs ) {
rhs.storage = storage;
move( rhs.storage, storage );
return this;
}

Expand Down

0 comments on commit f1ce568

Please sign in to comment.