Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bdbf6e
commit 91e0f74
Showing
25 changed files
with
482 additions
and
605 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require "./vector/*" | ||
|
||
module Bottle | ||
VERSION = "0.1.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Bottle::Util::Exceptions | ||
module Bottle::Core::Exceptions | ||
class RangeError < Exception | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
macro matrix_indexing_abstract(type_, dtype, prefix) | ||
module Bottle::Util::Indexing | ||
include Bottle::Util::Exceptions | ||
extend self | ||
|
||
def get_matrix_row_at_index(matrix : Pointer({{ type_ }}), index : Int32) | ||
vv = LibGsl.{{ prefix }}_row(matrix, index) | ||
return Vector.new vv.vector, vv.vector.data | ||
end | ||
|
||
def get_matrix_col_at_index(matrix : Pointer({{ type_ }}), column : Int32) | ||
vv = LibGsl.{{ prefix }}_column(matrix, column) | ||
return Vector.new vv.vector, vv.vector.data | ||
end | ||
end | ||
end | ||
|
||
matrix_indexing_abstract LibGsl::GslMatrix, Float64, gsl_matrix | ||
matrix_indexing_abstract LibGsl::GslMatrixInt, Int32, gsl_matrix_int |
Oops, something went wrong.