Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,6 +1,6 @@
import std.stdio, std.range, std.array, std.numeric, std.algorithm;
T[][] matMul(T)(in T[][] A, in T[][] B) /*pure*/ nothrow {
T[][] matMul(T)(in T[][] A, in T[][] B) pure nothrow /*@safe*/ {
const Bt = B[0].length.iota.map!(i=> B.transversal(i).array).array;
return A.map!(a => Bt.map!(b => a.dotProduct(b)).array).array;
}

View file

@ -5,9 +5,13 @@ alias TMMul_helper(M1, M2) = Unqual!(ForeachType!(ForeachType!M1))
void matrixMul(T, T2, size_t k, size_t m, size_t n)
(in ref T[m][k] A, in ref T[n][m] B,
/*out*/ ref T2[n][k] result) pure nothrow
/*out*/ ref T2[n][k] result) pure nothrow /*@safe*/ @nogc
if (is(T2 == Unqual!T)) {
T2[m] aux;
static if (hasIndirections!T)
T2[m] aux;
else
T2[m] aux = void;
foreach (immutable j; 0 .. n) {
foreach (immutable i, const ref bi; B)
aux[i] = bi[j];