Vector

Generic Vector backed by a static array.

Constructors

this
this(T scalar)

Constructs a Vector with all elements equal to scalar

this
this(T[N] values)

Constructs a Vector from static array.

this
this(R range)

Constructs a Vector with elements from an Input Range

this
this(Args args)

Constructs a Vector with all elements initialized separetely

Alias This

elements

Members

Aliases

ElementType
alias ElementType = T

Alias for Vector element type.

a
alias a = w
Undocumented in source.
b
alias b = z
Undocumented in source.
ba
alias ba = zw
Undocumented in source.
g
alias g = y
Undocumented in source.
gb
alias gb = yz
Undocumented in source.
gba
alias gba = yzw
Undocumented in source.
p
alias p = z
Undocumented in source.
pq
alias pq = zw
Undocumented in source.
q
alias q = w
Undocumented in source.
r
alias r = x
Undocumented in source.
rg
alias rg = xy
Undocumented in source.
rgb
alias rgb = xyz
Undocumented in source.
s
alias s = x
Undocumented in source.
st
alias st = xy
Undocumented in source.
stp
alias stp = xyz
Undocumented in source.
t
alias t = y
Undocumented in source.
tp
alias tp = yz
Undocumented in source.
tpq
alias tpq = yzw
Undocumented in source.
u
alias u = x
Undocumented in source.
uv
alias uv = xy
Undocumented in source.
v
alias v = y
Undocumented in source.
w
alias w = _get!(3)

Get a reference to fourth element.

x
alias x = _get!(0)

Get a reference to first element.

xy
alias xy = _slice!(0, 2)

Get a reference to the first and second elements.

xyz
alias xyz = _slice!(0, 3)

Get a reference to the first, second and third elements.

y
alias y = _get!(1)

Get a reference to second element.

yz
alias yz = _slice!(1, 3)

Get a reference to the second and third elements.

yzw
alias yzw = _slice!(1, 4)

Get a reference to the second, third and fourth elements.

z
alias z = _get!(2)

Get a reference to third element.

zeroes
alias zeroes = zeros
Undocumented in source.
zw
alias zw = _slice!(2, 4)

Get a reference to the third and fourth elements.

Functions

opBinary
Vector opBinary(T scalar)

Returns a new vector with binary operator applied to all elements and scalar

opBinary
Vector!(T, max(N, M)) opBinary(T[M] other)

Returns a new vector with the results of applying operator against elements of other. If operands dimensions are unequal, copies the values from greater dimension vector.

opBinary
Vector!(T, N + 1) opBinary(T scalar)

Returns a new vector of greater dimension by copying elements and appending scalar.

opBinary
Vector!(T, N + M) opBinary(T[M] other)

Returns a new vector of greater dimension by copying elements and appending values from other.

opBinaryRight
Vector opBinaryRight(T scalar)

Returns a new vector with binary operator applied to all elements and scalar

opBinaryRight
Vector!(T, N + 1) opBinaryRight(T scalar)

Returns a new vector of greater dimension by copying elements and prepending scalar.

opBinaryRight
Vector!(T, N + M) opBinaryRight(T[M] other)

Returns a new vector of greater dimension by copying elements and prepending values from other.

opCast
U opCast()

Cast to a static array of same dimension, but different element type.

opOpAssign
Vector opOpAssign(T scalar)

Assign result of applying operator with scalar to elements.

opOpAssign
Vector opOpAssign(T[M] other)

Assign result of applying operator with other to elements.

opUnary
Vector opUnary()

Returns a new vector with unary operator applied to all elements

Manifest constants

dimension
enum dimension;

Vector dimension.

Variables

elements
T[N] elements;

Element array.

ones
enum Vector ones;

Vector with all ones

zeros
enum Vector zeros;

Vector with all zeros

Parameters

T

Element type

N

Vector dimension, must be positive

Meta