Linalg

Linear algebra for D programming language.

alias SquareMatrix(type, size_t size) = Matrix!(type, size, size);
alias Vector(type, size_t size = DYNAMIC) = Matrix!(type, size, 1);
alias RowVector(type, size_t size = DYNAMIC) = Matrix!(type, 1, size);
alias isMatrix(type) = isInstanceOf!(Matrix, type);
alias MatrixXi = Matrix!int;
alias MatrixXf = Matrix!float;
alias MatrixXd = Matrix!double;
alias MatrixXr = Matrix!real;

alias Matrix2i = SquareMatrix!(int, 2);
alias Matrix2f = SquareMatrix!(float, 2);
alias Matrix2d = SquareMatrix!(double, 2);
alias Matrix2r = SquareMatrix!(real, 2);

alias Matrix3i = SquareMatrix!(int, 3);
alias Matrix3f = SquareMatrix!(float, 3);
alias Matrix3d = SquareMatrix!(double, 3);
alias Matrix3r = SquareMatrix!(real, 3);

alias Matrix4i = SquareMatrix!(int, 4);
alias Matrix4f = SquareMatrix!(float, 4);
alias Matrix4d = SquareMatrix!(double, 4);
alias Matrix4r = SquareMatrix!(real, 4);
alias VectorXi = Vector!int;
alias VectorXf = Vector!float;
alias VectorXd = Vector!double;
alias VectorXr = Vector!real;

alias Vector2i = Vector!(int, 2);
alias Vector2f = Vector!(float, 2);
alias Vector2d = Vector!(double, 2);
alias Vector2r = Vector!(real, 2);

alias Vector3i = Vector!(int, 3);
alias Vector3f = Vector!(float, 3);
alias Vector3d = Vector!(double, 3);
alias Vector3r = Vector!(real, 3);

alias Vector4i = Vector!(int, 4);
alias Vector4f = Vector!(float, 4);
alias Vector4d = Vector!(double, 4);
alias Vector4r = Vector!(real, 4);
alias RowVectorXi = RowVector!int;
alias RowVectorXf = RowVector!float;
alias RowVectorXd = RowVector!double;
alias RowVectorXr = RowVector!real;

alias RowVector2i = RowVector!(int, 2);
alias RowVector2f = RowVector!(float, 2);
alias RowVector2d = RowVector!(double, 2);
alias RowVector2r = RowVector!(real, 2);

alias RowVector3i = RowVector!(int, 3);
alias RowVector3f = RowVector!(float, 3);
alias RowVector3d = RowVector!(double, 3);
alias RowVector3r = RowVector!(real, 3);

alias RowVector4i = RowVector!(int, 4);
alias RowVector4f = RowVector!(float, 4);
alias RowVector4d = RowVector!(double, 4);
alias RowVector4r = RowVector!(real, 4);
auto m1 = Matrix!(float, 3, 2);
Matrix!(T, 3, 3) m1;
Matrix!(T, DYNAMIC, 3) m2;
Matrix!(T, 3, DYNAMIC) m3;
Matrix!(T, DYNAMIC, DYNAMIC) m4;