class LA::BandedMatrix(T)
- LA::BandedMatrix(T)
- LA::Matrix(T)
- Reference
- Object
Overview
banded matrix, heap-allocated
Defined in:
matrix/banded_matrix.crConstructors
- .new(nrows : Int32, ncolumns : Int32, upper_band : Int32, lower_band : Int32, values : Indexable)
- .new(nrows, ncolumns, upper_band, values : Indexable)
- .new(nrows : Int32, ncolumns : Int32, upper_band : Int32, lower_band : Int32 = upper_band, flags : LA::MatrixFlags = MatrixFlags::None)
- .new(nrows : Int32, ncolumns : Int32, upper_band : Int32, lower_band : Int32 = upper_band, flags : LA::MatrixFlags = MatrixFlags::None, &)
- .new(matrix : BandedMatrix)
- .new(matrix : Matrix, tolerance = matrix.tolerance)
Class Method Summary
- .diag(nrows, ncolumns, values)
- .rand(nrows, ncolumns, upper_band : Int32, lower_band : Int32, rng : Random = Random::DEFAULT)
- .rand(nrows, ncolumns, upper_band : Int32, rng : Random = Random::DEFAULT)
Instance Method Summary
-
#+(m : BandedMatrix(T))
returns element-wise sum
-
#-(m : BandedMatrix(T))
returns element-wise subtract
- #==(other : BandedMatrix(T))
- #add!(k : Number, m : BandedMatrix)
- #add!(k : Number, m : Matrix)
- #clone
-
#conjtranspose
returns conjtransposed matrix
- #det(*, overwrite_a = false)
-
#dup
Returns a shallow copy of this object.
- #each_index(*, all = false, &)
- #flags : MatrixFlags
- #flags=(flags : MatrixFlags)
- #lower_band : Int32
- #lower_band=(value)
-
#map_with_index(&)
Like
map
, but the block gets passed both the element and its index. - #map_with_index_complex(&)
-
#map_with_index_f64(&)
TODO - macro magic?
- #ncolumns : Int32
-
#norm(kind : MatrixNorm = MatrixNorm::Frobenius)
returns matrix norm
- #nrows : Int32
- #set_bands(aupper, alower) : Nil
- #solve(b : GeneralMatrix(T), *, overwrite_a = false, overwrite_b = false)
-
#to_unsafe
to_unsafe method raises at runtime and is overriden by matrix that actually have pointer
-
#transpose
returns transposed matrix
- #transpose!
-
#tril(k = 0)
same as tril in scipy - returns lower triangular or trapezoidal part of matrix
-
#tril!(k = 0)
like a tril in scipy - remove all elements above k-diagonal
-
#triu(k = 0)
same as triu in scipy - returns upper triangular or trapezoidal part of matrix
-
#triu!(k = 0)
like a triu in scipy - remove all elements below k-diagonal
- #unsafe_fetch(i, j)
- #unsafe_set(i, j, value)
- #upper_band : Int32
- #upper_band=(value)
Instance methods inherited from class LA::Matrix(T)
*(k : Number)*(k : Complex)
*(m : Matrix(T)) *, **(other : Int) **, +(k : Number)
+(k : Complex)
+(m : Matrix(T)) +, -(k : Number | Complex)
-(m : Matrix(T))
- -, /(k : Number | Complex) /, ==(other) ==, [](i : Int32, j : Int32)
[](arows : Range(Int32 | Nil, Int32 | Nil), acolumns : Range(Int32 | Nil, Int32 | Nil))
[](row : Int32, acolumns : Range(Int32 | Nil, Int32 | Nil))
[](arows : Range(Int32 | Nil, Int32 | Nil), column : Int32) [], []=(i : Int32, j : Int32, value)
[]=(arows : Range(Int32, Int32), acolumns : Range(Int32, Int32), value)
[]=(row : Int32, acolumns : Range(Int32, Int32), value)
[]=(nrows : Range(Int32, Int32), column : Int32, value) []=, abs(kind : MatrixNorm = MatrixNorm::Frobenius) abs, add!(k : Number, m : Matrix)
add!(m) add!, add_mult(a, b : Matrix(T), *, alpha = 1.0, beta = 1.0) add_mult, almost_eq(other : Matrix(T), eps)
almost_eq(other : Matrix(T)) almost_eq, assume!(flag : MatrixFlags, value : Bool = true) assume!, balance(*, permute = true, scale = true, separate = false) balance, balance!(*, permute = true, scale = true, separate = false) balance!, cat(other : Matrix(T), axis : Axis) cat, cho_solve(b : self, *, overwrite_b = false) cho_solve, cholesky(*, lower = false, dont_clean = false) cholesky, cholesky!(*, lower = false, dont_clean = false) cholesky!, chop(eps = self.tolerance) chop, clear_flags clear_flags, columns columns, conjt conjt, conjt! conjt!, conjtranspose conjtranspose, coshm coshm, cosm cosm, det(*, overwrite_a = false) det, detect(aflags : MatrixFlags = MatrixFlags::All, eps = tolerance) detect, detect?(aflags : MatrixFlags = MatrixFlags::All, eps = tolerance) detect?, diag(offset = 0) diag, each(*, all = false, &) each, each_index(*, all = false, &) each_index, each_with_index(*, all = false, &) each_with_index, eigs(*, left = false, overwrite_a = false)
eigs(*, need_left : Bool, need_right : Bool, overwrite_a = false)
eigs(*, b : Matrix(T), need_left : Bool, need_right : Bool, overwrite_a = false, overwrite_b = false) eigs, eigvals(*, overwrite_a = false) eigvals, expm(*, schur_fact = false) expm, expm_sqtri(t, f, s) expm_sqtri, flags : MatrixFlags flags, flags=(value : MatrixFlags) flags=, hcat(other) hcat, hessenberg
hessenberg(*, calc_q = false) hessenberg, hessenberg!
hessenberg!(*, calc_q = false) hessenberg!, inspect(io) inspect, inv inv, inv! inv!, kron(b : Matrix(T)) kron, lq(*, overwrite_a = false) lq, lq_r(*, overwrite_a = false) lq_r, lstsq(b : self, method : LSMethod = LSMethod::Auto, *, overwrite_a = false, overwrite_b = false, cond = -1) lstsq, lu(*, overwrite_a = false) lu, lu_factor lu_factor, lu_factor! lu_factor!, map(&) map, map!(&) map!, map_with_index(&) map_with_index, map_with_index!(&) map_with_index!, max(axis : Axis) max, min(axis : Axis) min, ncolumns : Int32 ncolumns, norm(kind : MatrixNorm = MatrixNorm::Frobenius) norm, nrows : Int32 nrows, product(axis : Axis) product, ql(*, overwrite_a = false) ql, ql_r(*, overwrite_a = false) ql_r, qr(*, overwrite_a = false, pivoting = false) qr, qr_r(*, overwrite_a = false, pivoting = false) qr_r, qr_raw(*, overwrite_a = false, pivoting = false) qr_raw, qz(b, overwrite_a = false, overwrite_b = false) qz, rank(eps = self.tolerance, *, method : RankMethod = RankMethod::SVD, overwrite_a = false) rank, reduce(axis : Axis, initial, &) reduce, repmat(arows, acolumns) repmat, rows rows, rq(*, overwrite_a = false) rq, rq_r(*, overwrite_a = false) rq_r, save_csv(filename) save_csv, scale!(k : Number | Complex) scale!, schur(*, overwrite_a = false) schur, sinhm sinhm, sinm sinm, size size, solve(b : self, *, overwrite_a = false, overwrite_b = false) solve, solvels(b : self, *, overwrite_a = false, overwrite_b = false, cond = -1) solvels, square? square?, sum(axis : Axis) sum, svd(*, overwrite_a = false) svd, svdvals(*, overwrite_a = false) svdvals, t t, t! t!, tanhm tanhm, tanm tanm, to_custom(io, prefix, columns_separator, rows_separator, postfix) to_custom, to_general to_general, to_imag to_imag, to_matlab(io)
to_matlab to_matlab, to_real to_real, to_s(io) to_s, to_unsafe to_unsafe, tolerance tolerance, tr_mult!(a : Matrix(T), *, alpha = 1.0, left = false) tr_mult!, trace trace, transpose transpose, tril(k = 0) tril, tril!(k = 0) tril!, triu(k = 0) triu, triu!(k = 0) triu!, vcat(other) vcat
Class methods inherited from class LA::Matrix(T)
arange(start_val : T, end_val : T, delta = 1.0)
arange,
block_diag(*args)
block_diag,
circulant(c)
circulant,
column(values)
column,
companion(a)
companion,
dft(n, scale : DFTScale = DFTScale::None)
dft,
diag(nrows, ncolumns, value : Number | Complex)diag(nrows, ncolumns, values)
diag(values)
diag(nrows, ncolumns, &) diag, eye(n) eye, from_custom(io, prefix, columns_separator, rows_separator, postfix) from_custom, from_matlab(s) from_matlab, hadamard(n) hadamard, hankel(column : Indexable | Matrix, row : Indexable | Matrix | Nil = nil) hankel, helmert(n, full = false) helmert, hilbert(n) hilbert, identity(n) identity, invpascal(n, kind : PascalKind = PascalKind::Symmetric) invpascal, kron(a, b) kron, leslie(f, s) leslie, load_csv(filename) load_csv, multiplicative_identity multiplicative_identity, ones(nrows, ncolumns) ones, pascal(n, kind : PascalKind = PascalKind::Symmetric) pascal, rand(nrows, ncolumns, rng = Random::DEFAULT) rand, repmat(a : Matrix(T), nrows, ncolumns) repmat, row(values) row, toeplitz(column : Indexable | Matrix, row : Indexable | Matrix | Nil = nil) toeplitz, tri(nrows, ncolumns, k = 0) tri, zero zero, zeros(nrows, ncolumns) zeros
Macros inherited from class LA::Matrix(T)
blas(storage, name, *args)
blas,
lapack(name, *args, worksize = nil)
lapack,
lapack_util(name, worksize, *args)
lapack_util
Instance methods inherited from module Enumerable(T)
product(initial : Complex)product(initial : Complex, &) product
Constructor Detail
Class Method Detail
Instance Method Detail
Returns a shallow copy of this object.
This allocates a new object and copies the contents of
self
into it.
Like map
, but the block gets passed both the element and its index.
["Alice", "Bob"].map_with_index { |name, i| "User ##{i}: #{name}" }
# => ["User #0: Alice", "User #1: Bob"]
Accepts an optional offset parameter, which tells it to start counting from there.
to_unsafe method raises at runtime and is overriden by matrix that actually have pointer
same as tril in scipy - returns lower triangular or trapezoidal part of matrix
like a tril in scipy - remove all elements above k-diagonal
same as triu in scipy - returns upper triangular or trapezoidal part of matrix
like a triu in scipy - remove all elements below k-diagonal