Structurefwcd.swift-utils 4.6.2Utils
Vector
Vector.swift:1struct Vector<T> where T : ExpressibleByIntegerLiteral, T : Hashable, T : Absolutable, T : Addable, T : Divisible, T : Multipliable, T : Negatable, T : Subtractable
struct Vector<T> where T : ExpressibleByIntegerLiteral, T : Hashable, T : Absolutable, T : Addable, T : Divisible, T : Multipliable, T : Negatable, T : Subtractable
import Utils
protocol ExpressibleByIntegerLiteral
A type that can be initialized with an integer literal.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Absolutable
protocol Addable
protocol Divisible
protocol Multipliable
protocol Negatable
Describes a (signed) type that has an additive inverse.
protocol Subtractable
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
init(_ values: [T])
static func zero(size: Int) -> Vector<T>
var asNDArray: NDArray<T> { get }
var description: String { get }
var values: [T]
subscript(i: Int) -> T { get set }
static func * (lhs: Self, rhs: Self) -> Vector<T>
static func * (lhs: Self, rhs: T) -> Vector<T>
static func * (lhs: T, rhs: Self) -> Vector<T>
static func *= (lhs: inout Self, rhs: Self)
static func + (lhs: Self, rhs: Self) -> Vector<T>
static func += (lhs: inout Self, rhs: Self)
static func - (operand: Self) -> Vector<T>
static func - (lhs: Self, rhs: Self) -> Vector<T>
static func -= (lhs: inout Self, rhs: Self)
static func / (lhs: Self, rhs: Self) -> Vector<T>
static func / (lhs: Self, rhs: T) -> Vector<T>
static func / (lhs: T, rhs: Self) -> Vector<T>
static func /= (lhs: inout Self, rhs: Self)
func dot(_ other: Self) -> T
func map<U>(_ transform: (T) throws -> U) rethrows -> Vector<U> where U : ExpressibleByIntegerLiteral, U : Hashable, U : Absolutable, U : Addable, U : Divisible, U : Multipliable, U : Negatable, U : Subtractable
mutating func mapInPlace(_ transform: (T) throws -> T) rethrows
mutating func negate()
func projected(onto other: Self) -> Vector<T>
func zip<U, R>(_ rhs: Vector<U>, _ zipper: (T, U) throws -> R) rethrows -> Vector<R> where U : ExpressibleByIntegerLiteral, U : Hashable, U : Absolutable, U : Addable, U : Divisible, U : Multipliable, U : Negatable, U : Subtractable, R : ExpressibleByIntegerLiteral, R : Hashable, R : Absolutable, R : Addable, R : Divisible, R : Multipliable, R : Negatable, R : Subtractable
mutating func zipInPlace<U>(_ rhs: Vector<U>, _ zipper: (T, U) throws -> T) rethrows where U : ExpressibleByIntegerLiteral, U : Hashable, U : Absolutable, U : Addable, U : Divisible, U : Multipliable, U : Negatable, U : Subtractable
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
protocol BinaryFloatingPoint : ExpressibleByFloatLiteral, FloatingPoint
A radix-2 (binary) floating-point type.
var floored: Vector<Int> { get }
var magnitude: T { get }
var normalized: Self { get }
protocol Sendable
protocol BinaryInteger : CustomStringConvertible, Hashable, Numeric, Strideable where Self.Magnitude : BinaryInteger, Self.Magnitude == Self.Magnitude.Magnitude
An integer type with a binary representation.
var asDouble: Vector<Double> { get }
var magnitude: Double { get }
struct Rational
A numeric type supporting precise division.
var asDouble: Vector<Double> { get }
var magnitude: Double { get }