module Apatite
Overview
Apatite is a fundimental package for scientific computing in Crystal. If that sounds like a modified version of the first line from the NumPy homepage, that's because it is. Apatite has (ok, will have) all of the goodness of NumPy sitting atop the blazing speed and beautiful syntax of Crystal.
Included Modules
Extended Modules
Defined in:
apatite/linear_algebra/ndarray.crapatite/linear_algebra.cr
apatite.cr
apatite/version.cr
Constant Summary
-
I =
Vector::I
-
Cartesian unit vector I
Vector{1.0, 0.0, 0.0}
-
J =
Vector::J
-
Cartesian unit vector J
Vector{0.0, 1.0, 0.0}
-
K =
Vector::K
-
Cartesian unit vector K
Vector{0.0, 0.0, 1.0}
-
VERSION =
"0.1.0"
Instance Method Summary
-
#as_vector(input : Indexable)
Creates a new vector from the given
input
. -
#basis(size, index)
Creates a standard basis-n vector of the given
size
andindex
. -
#diagonal(values)
Creates a matrix where the diagonal elements are composed of
values
. -
#empty
Returns a new empty
Vector
-
#empty_matrix(row_count = 0, column_count = 0)
Creates a new empty matrix with the given
row_count
andcolumn_count
. -
#eye(n)
Creates a new diagonal matrix of size
n
with ones in the diagonal and zeros elsewhere. -
#full(n, i)
Returns a new vector of size
n
filled withi
-
#identity(n)
Creates a
n x n
identity matrix. -
#ones(n)
Returns a new vector filled with
n
ones. -
#random(n, range = nil)
Creates a new vector of size
n
filled with random numbers. -
#row_vector(row)
Creates a single-row matrix where the values of that row are as given in
row
. -
#scalar(n, value)
Creates an
n
byn
diagonal matrix where each diagonal element is value. -
#vector(n, &block)
Creates a new vector of size
n
, and invokes the block once for each index ofself
, assigning the block's value in that index. -
#zeros(n)
Returns a new vector filled with
n
zeros.
Instance methods inherited from module Apatite::LinearAlgebra
sigmoid(input : Number)
sigmoid,
sigmoid_d(input : Number)
sigmoid_d
Instance Method Detail
Creates a new vector from the given input
. Input can be any
Indexable
type.
Creates a new empty matrix with the given row_count
and
column_count
. At lease one of row_count
or
column_count
must be zero.
Creates a new vector of size n
filled with random numbers. A range
can optionally be passed in if you want to limit the random numbers
to a given range.
Creates a new vector of size n
, and invokes the block once
for each index of self
, assigning the block's value in that index.