Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A few fixes in preparation for DMD 2.058's release.

  • Loading branch information...
commit 9761770566f301c404d383d4e24794fbd646f4b8 1 parent 31fc786
@dsimcha dsimcha authored
View
6 scid/demos/zmat.d
@@ -9,11 +9,11 @@ void zMatOpsTest() {
alias Matrix!cdouble zGeMat;
alias SymmetricMatrix!cdouble zSyMat;
- auto a = zGeMat( 3, [1.+4.i,2+3.i,3+2.i,4+1.i,5+0.i,6-1.i,7-2.i,8-3.i,9-4.i] );
- auto b = zGeMat( 3, [1.+2.i,2.+1.i,3+0.i,4-1.i,5-2.i,6-3.i] );
+ auto a = zGeMat( 3, [1.+4i,2+3i,3+2i,4+1i,5+0i,6-1i,7-2i,8-3i,9-4i] );
+ auto b = zGeMat( 3, [1.+2i,2.+1i,3+0i,4-1i,5-2i,6-3i] );
zGeMat c = b * a;
- enforceMatData( c, 2, 3, [ 18 + 19.i, 33 + 22i, 45 - 8i, 60 - 23i, 72 -35i, 87 - 68i ] );
+ enforceMatData( c, 2, 3, [ 18 + 19i, 33 + 22i, 45 - 8i, 60 - 23i, 72 -35i, 87 - 68i ] );
c[] = c[0 .. 2][ 0 .. 2 ].t * ( (b[][0] - a[1..3][0]).t * eval(c[][0]) ) / (10.+0.i);
View
12 scid/demos/zmatprod.d
@@ -7,12 +7,12 @@ void zMatProdTest() {
alias Matrix!cdouble ColMat;
alias Matrix!( cdouble, StorageOrder.RowMajor ) RowMat;
- auto aInit = [ [ 1. + 1.i, 2. - 1.i ], [ -1. + 2.i, 1. + 1.i ] ];
- auto bInit = [ [ -1. - 1.i, 2. - 2.i ], [ 2. + 1.i, 0. - 1.i ] ];
- auto correct1 = [ [ 5. - 2.i, 3. - 2.i ], [ 4. + 2.i, 3. + 5.i ] ];
- auto correct2 = [ [ 2. - 4.i, 3. - 4.i ], [ 1. + 1.i, 6. + 1.i ] ];
- auto correct3 = [ [ -2. - 5.i, -2. - 3.i ], [ 2. - 4.i, 5. - 3.i ] ];
- auto correct4 = [ [ 4. + 2.i, 4. + 3.i ], [ -1. + 1.i, -1. + 6.i ] ];
+ auto aInit = [ [ 1. + 1i, 2. - 1i ], [ -1. + 2i, 1. + 1i ] ];
+ auto bInit = [ [ -1. - 1i, 2. - 2i ], [ 2. + 1i, 0. - 1i ] ];
+ auto correct1 = [ [ 5. - 2i, 3. - 2i ], [ 4. + 2i, 3. + 5i ] ];
+ auto correct2 = [ [ 2. - 4i, 3. - 4i ], [ 1. + 1i, 6. + 1i ] ];
+ auto correct3 = [ [ -2. - 5i, -2. - 3i ], [ 2. - 4i, 5. - 3i ] ];
+ auto correct4 = [ [ 4. + 2i, 4. + 3i ], [ -1. + 1i, -1. + 6i ] ];
auto colA = ColMat( aInit ), colB = ColMat( bInit );
auto rowA = RowMat( aInit ), rowB = RowMat( bInit );
View
4 scid/internal/assertmessages.d
@@ -9,7 +9,7 @@ module scid.internal.assertmessages;
import std.string;
import std.range, std.conv;
-private alias to!string tos;
+package alias to!string tos;
/** Checks and error messages for array-like structs. */
mixin template ArrayChecks() {
@@ -170,4 +170,4 @@ in {
}
return app.data();
-}
+}
View
2  scid/internal/regionallocator.d
@@ -84,7 +84,7 @@ License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0)
module scid.internal.regionallocator;
import std.traits, core.memory, std.range, core.exception, std.conv,
- std.algorithm, std.typetuple, std.exception, std.typecons;
+ std.algorithm, std.typetuple, std.exception, std.typecons, core.stdc.string;
static import core.stdc.stdlib;
View
9 scid/splines/univariate/cubic.d
@@ -15,6 +15,11 @@ import scid.common.meta;
import scid.splines.univariate.base;
import scid.splines.univariate.poly3;
+version(unittest)
+{
+ import std.math : approxEqual;
+}
+
/** Cubic one-dimensional spline (order = 3, defect = 1).
*
* Natural boundary condition is zero 2nd derivative.
@@ -153,8 +158,8 @@ unittest
BoundCond.deriv1,
BoundCond.deriv1,
0, 27);
- assert(spl._calcFunction(2, 1) == 8);
- assert(spl._calcDeriv(2, 1) == 12);
+ assert(approxEqual(spl._calcFunction(2, 1), 8));
+ assert(approxEqual(spl._calcDeriv(2, 1), 12));
}
// Calculate cubic spline coefficients
View
8 scid/storage/generalmatview.d
@@ -154,7 +154,13 @@ struct BasicGeneralMatrixViewStorage( ContainerRef_ ) {
void copy( Transpose tr = Transpose.no, Source )( auto ref Source source )
if( isGeneralMatrixStorage!Source ) {
- resize( source.rows, source.columns, null );
+
+ if( tr == Transpose.yes ) {
+ resize( source.columns, source.rows, null );
+ } else {
+ resize( source.rows, source.columns, null );
+ }
+
if( !source.empty )
generalMatrixCopy!tr( source, this );
}

4 comments on commit 9761770

@MaksimZh

Hello!

When I try to build this version of the library with rdmd build lib -unittest I get the following error message:

dmd -lib -unittest ...<long list of modules>...
Internal error: ../ztc/cg87.c 202
Error building library

This happens on both dmd 2.056 and 2.058 and looks like a compiler bug.
I tried to reproduce it on a simple program but did not succeed.

On the previous commit (31fc786...) it gives another message:

.../scid $ rdmd build lib -unittest
dmd -lib -unittest ...<long list of modules>...
scid/internal/assertmessages.d(19): Error: module scid.storage.arraydata scid.internal.assertmessages.tos is private
Error building library

I get no errors without -unittest option.

@dsimcha
Collaborator
@MaksimZh

My OS is a 64-bit Linux
I use the 64-bit version of the compiler. Probably it builds a 64-bit by default.

@dsimcha
Collaborator
Please sign in to comment.
Something went wrong with that request. Please try again.