class
Rubellite::Spinel::Vector(T)
- Rubellite::Spinel::Vector(T)
- Reference
- Object
Overview
High-performance contiguous typed vector with SIMD math operations and zero-copy CRuby TypedData interoperability.
Included Modules
Defined in:
rubellite/spinel/vector.crConstructors
Class Method Summary
-
.setup_ruby_methods! : Nil
Registers Ruby methods on the wrapped CRuby class
Instance Method Summary
- #[](index : Int) : T
- #[]=(index : Int, val : T) : T
-
#add!(other : Vector(T)) : self
In-place element-wise addition: self += other
-
#axpy!(factor : Number, other : Vector(T)) : self
In-place BLAS axpy operation: self = factor * other + self
- #buffer : Slice(T)
-
#dot(other : Vector(T)) : T
Computes the dot product of two vectors
-
#inspect(io : IO) : Nil
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
-
#multiply!(other : Vector(T)) : self
In-place element-wise multiplication: self *= other
-
#norm : Float64
Computes the Euclidean (L2) norm
-
#norm_squared : Float64
Computes the squared Euclidean norm
-
#scale(factor : Number) : Vector(T)
Out-of-place scalar multiplication
-
#scale!(factor : Number) : self
In-place scalar multiplication
- #size : Int32
-
#sum : T
Computes the sum of all elements
- #to_a : Array(T)
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #to_slice : Slice(T)
- #to_unsafe : Pointer(T)
Instance methods inherited from module Rubellite::TypedDataMixin
to_ruby : Value
to_ruby
Constructor Detail
Class Method Detail
Registers Ruby methods on the wrapped CRuby class
Instance Method Detail
In-place BLAS axpy operation: self = factor * other + self
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
In-place element-wise multiplication: self *= other
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>