Updaed docs and added matrix creation methods

This commit is contained in:
Chris Watson 2019-06-12 23:17:13 -07:00
parent bb0f2c4332
commit 49a30afcc0
No known key found for this signature in database
GPG Key ID: 37DAEF5F446370A4
12 changed files with 457 additions and 288 deletions

View File

@ -131,28 +131,28 @@ of Crystal.</p>
<h2>Defined in:</h2>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L1" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L1" target="_blank">
apatite/linear_algebra/ndarray.cr
</a>
<br/>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra.cr#L5" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra.cr#L5" target="_blank">
apatite/linear_algebra.cr
</a>
<br/>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L10" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L10" target="_blank">
apatite.cr
</a>
<br/>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/version.cr#L1" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/version.cr#L1" target="_blank">
apatite/version.cr
</a>
@ -172,6 +172,8 @@ of Crystal.</p>
<dd class="entry-const-doc">
<p>Cartesian unit vector I</p>
<p><code><a href="Apatite/LinearAlgebra/Vector.html">Vector</a>{1.0, 0.0, 0.0}</code></p>
</dd>
@ -181,6 +183,8 @@ of Crystal.</p>
<dd class="entry-const-doc">
<p>Cartesian unit vector J</p>
<p><code><a href="Apatite/LinearAlgebra/Vector.html">Vector</a>{0.0, 1.0, 0.0}</code></p>
</dd>
@ -190,6 +194,8 @@ of Crystal.</p>
<dd class="entry-const-doc">
<p>Cartesian unit vector K</p>
<p><code><a href="Apatite/LinearAlgebra/Vector.html">Vector</a>{0.0, 0.0, 1.0}</code></p>
</dd>
@ -204,31 +210,6 @@ of Crystal.</p>
<h2>Class Method Summary</h2>
<ul class="list-summary">
<li class="entry-summary">
<a href="#approx_precision-class-method" class="signature"><strong>.approx_precision</strong></a>
</li>
<li class="entry-summary">
<a href="#approx_precision%3D%28approx_precision%29-class-method" class="signature"><strong>.approx_precision=</strong>(approx_precision)</a>
</li>
<li class="entry-summary">
<a href="#precision-class-method" class="signature"><strong>.precision</strong></a>
</li>
<li class="entry-summary">
<a href="#precision%3D%28precision%29-class-method" class="signature"><strong>.precision=</strong>(precision)</a>
</li>
</ul>
<h2>Instance Method Summary</h2>
@ -244,7 +225,14 @@ of Crystal.</p>
<li class="entry-summary">
<a href="#basis%28size%2Cindex%29-instance-method" class="signature"><strong>#basis</strong>(size, index)</a>
<div class="summary"><p>Returns a standard basis-n vector of the given <code>size</code> and <code>index</code>.</p></div>
<div class="summary"><p>Creates a standard basis-n vector of the given <code>size</code> and <code>index</code>.</p></div>
</li>
<li class="entry-summary">
<a href="#diagonal%28values%29-instance-method" class="signature"><strong>#diagonal</strong>(values)</a>
<div class="summary"><p>Creates a matrix where the diagonal elements are composed of <code>values</code>.</p></div>
</li>
@ -255,6 +243,20 @@ of Crystal.</p>
</li>
<li class="entry-summary">
<a href="#empty_matrix%28row_count%3D0%2Ccolumn_count%3D0%29-instance-method" class="signature"><strong>#empty_matrix</strong>(row_count = <span class="n">0</span>, column_count = <span class="n">0</span>)</a>
<div class="summary"><p>Creates a new empty matrix with the given <code>row_count</code> and <code>column_count</code>.</p></div>
</li>
<li class="entry-summary">
<a href="#eye%28n%29-instance-method" class="signature"><strong>#eye</strong>(n)</a>
<div class="summary"><p>Creates a new diagonal matrix of size <code>n</code> with ones in the diagonal and zeros elsewhere.</p></div>
</li>
<li class="entry-summary">
<a href="#full%28n%2Ci%29-instance-method" class="signature"><strong>#full</strong>(n, i)</a>
@ -262,6 +264,13 @@ of Crystal.</p>
</li>
<li class="entry-summary">
<a href="#identity%28n%29-instance-method" class="signature"><strong>#identity</strong>(n)</a>
<div class="summary"><p>Creates a <code>n x n</code> identity matrix.</p></div>
</li>
<li class="entry-summary">
<a href="#ones%28n%29-instance-method" class="signature"><strong>#ones</strong>(n)</a>
@ -269,6 +278,27 @@ of Crystal.</p>
</li>
<li class="entry-summary">
<a href="#random%28n%2Crange%3Dnil%29-instance-method" class="signature"><strong>#random</strong>(n, range = <span class="n">nil</span>)</a>
<div class="summary"><p>Creates a new vector of size <code>n</code> filled with random numbers.</p></div>
</li>
<li class="entry-summary">
<a href="#row_vector%28row%29-instance-method" class="signature"><strong>#row_vector</strong>(row)</a>
<div class="summary"><p>Creates a single-row matrix where the values of that row are as given in <code>row</code>.</p></div>
</li>
<li class="entry-summary">
<a href="#scalar%28n%2Cvalue%29-instance-method" class="signature"><strong>#scalar</strong>(n, value)</a>
<div class="summary"><p>Creates an <code>n</code> by <code>n</code> diagonal matrix where each diagonal element is value.</p></div>
</li>
<li class="entry-summary">
<a href="#vector%28n%2C%26block%29-instance-method" class="signature"><strong>#vector</strong>(n, &block)</a>
@ -320,73 +350,6 @@ of Crystal.</p>
<h2>Class Method Detail</h2>
<div class="entry-detail" id="approx_precision-class-method">
<div class="signature">
def self.<strong>approx_precision</strong>
<a class="method-permalink" href="#approx_precision-class-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L17" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="approx_precision=(approx_precision)-class-method">
<div class="signature">
def self.<strong>approx_precision=</strong>(approx_precision)
<a class="method-permalink" href="#approx_precision%3D%28approx_precision%29-class-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L21" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="precision-class-method">
<div class="signature">
def self.<strong>precision</strong>
<a class="method-permalink" href="#precision-class-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L16" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="precision=(precision)-class-method">
<div class="signature">
def self.<strong>precision=</strong>(precision)
<a class="method-permalink" href="#precision%3D%28precision%29-class-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L20" target="_blank">View source</a>]
</div>
</div>
<h2>Instance Method Detail</h2>
@ -405,7 +368,7 @@ of Crystal.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L58" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L61" target="_blank">View source</a>]
</div>
</div>
@ -418,12 +381,30 @@ of Crystal.</p>
<a class="method-permalink" href="#basis%28size%2Cindex%29-instance-method">#</a>
</div>
<div class="doc"><p>Returns a standard basis-n vector of the given <code>size</code> and <code>index</code>.</p></div>
<div class="doc"><p>Creates a standard basis-n vector of the given <code>size</code> and <code>index</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L63" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L66" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="diagonal(values)-instance-method">
<div class="signature">
def <strong>diagonal</strong>(values)
<a class="method-permalink" href="#diagonal%28values%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates a matrix where the diagonal elements are composed of <code>values</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L89" target="_blank">View source</a>]
</div>
</div>
@ -441,7 +422,46 @@ of Crystal.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L31" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L34" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="empty_matrix(row_count=0,column_count=0)-instance-method">
<div class="signature">
def <strong>empty_matrix</strong>(row_count = <span class="n">0</span>, column_count = <span class="n">0</span>)
<a class="method-permalink" href="#empty_matrix%28row_count%3D0%2Ccolumn_count%3D0%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates a new empty matrix with the given <code>row_count</code> and
<code>column_count</code>. At lease one of <code>row_count</code> or
<code>column_count</code> must be zero.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L84" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="eye(n)-instance-method">
<div class="signature">
def <strong>eye</strong>(n)
<a class="method-permalink" href="#eye%28n%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates a new diagonal matrix of size <code>n</code> with ones in the diagonal
and zeros elsewhere.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L95" target="_blank">View source</a>]
</div>
</div>
@ -459,7 +479,25 @@ of Crystal.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L46" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L49" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="identity(n)-instance-method">
<div class="signature">
def <strong>identity</strong>(n)
<a class="method-permalink" href="#identity%28n%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates a <code>n x n</code> identity matrix.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L100" target="_blank">View source</a>]
</div>
</div>
@ -477,7 +515,63 @@ of Crystal.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L36" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L39" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="random(n,range=nil)-instance-method">
<div class="signature">
def <strong>random</strong>(n, range = <span class="n">nil</span>)
<a class="method-permalink" href="#random%28n%2Crange%3Dnil%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates a new vector of size <code>n</code> filled with random numbers. A <code>range</code>
can optionally be passed in if you want to limit the random numbers
to a given range.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L73" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="row_vector(row)-instance-method">
<div class="signature">
def <strong>row_vector</strong>(row)
<a class="method-permalink" href="#row_vector%28row%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates a single-row matrix where the values of that row are as given in <code>row</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L105" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="scalar(n,value)-instance-method">
<div class="signature">
def <strong>scalar</strong>(n, value)
<a class="method-permalink" href="#scalar%28n%2Cvalue%29-instance-method">#</a>
</div>
<div class="doc"><p>Creates an <code>n</code> by <code>n</code> diagonal matrix where each diagonal element is value.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L110" target="_blank">View source</a>]
</div>
</div>
@ -496,7 +590,7 @@ for each index of <code>self</code>, assigning the block's value in that index.<
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L52" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L55" target="_blank">View source</a>]
</div>
</div>
@ -514,7 +608,7 @@ for each index of <code>self</code>, assigning the block's value in that index.<
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite.cr#L41" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite.cr#L44" target="_blank">View source</a>]
</div>
</div>

View File

@ -123,28 +123,28 @@
<h2>Defined in:</h2>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L1" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L1" target="_blank">
apatite/linear_algebra/ndarray.cr
</a>
<br/>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L1" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L1" target="_blank">
apatite/linear_algebra/vector.cr
</a>
<br/>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L3" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L3" target="_blank">
apatite/linear_algebra/matrix.cr
</a>
<br/>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra.cr#L6" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra.cr#L6" target="_blank">
apatite/linear_algebra.cr
</a>
@ -203,14 +203,14 @@
<div class="doc"><p>Calculates the sigmoid curve for a numeric input.</p>
<p>f(x) = 1/(1 + e^-x)</p>
<p><code>f(x) = 1/(1 + e^-x)</code></p>
<p>See also: <a href="https://www.wikiwand.com/en/Sigmoid_function" target="_blank">Sigmoid function [WikiWand</a></p></div>
<p>See also: <a href="https://www.wikiwand.com/en/Sigmoid_function" target="_blank">Sigmoid function (WikiWand)</a></p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra.cr#L14" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra.cr#L14" target="_blank">View source</a>]
</div>
</div>
@ -225,12 +225,12 @@
<div class="doc"><p>Calculates the derivative sigmoid curve for a numeric input.</p>
<p>f'(x) = f(x)(1 - f(x)),</p></div>
<p><code>f'(x) = f(x)(1 - f(x)),</code></p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra.cr#L22" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra.cr#L22" target="_blank">View source</a>]
</div>
</div>

View File

@ -122,7 +122,7 @@
<h2>Defined in:</h2>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L4" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L4" target="_blank">
apatite/linear_algebra/matrix.cr
</a>
@ -137,7 +137,7 @@
<ul class="list-summary">
<li class="entry-summary">
<a href="#new%28rows%2Ccolumn_count%3AInt32%3Drows%5B0%5D.size%29-class-method" class="signature"><strong>.new</strong>(rows, column_count : Int32 = rows[<span class="n">0</span>].size)</a>
<a href="#new%28rows%2Ccolumn_count%3AInt32%3F%3Dnil%29-class-method" class="signature"><strong>.new</strong>(rows, column_count : Int32? = <span class="n">nil</span>)</a>
</li>
@ -197,6 +197,13 @@
</li>
<li class="entry-summary">
<a href="#eye%28n%29-class-method" class="signature"><strong>.eye</strong>(n)</a>
<div class="summary"><p>Creates a new diagonal matrix of size <code>n</code> with ones in the diagonal and zeros elsewhere.</p></div>
</li>
<li class="entry-summary">
<a href="#hstack%28x%2C%2Amatrices%29-class-method" class="signature"><strong>.hstack</strong>(x, *matrices)</a>
@ -521,18 +528,18 @@
<h2>Constructor Detail</h2>
<div class="entry-detail" id="new(rows,column_count:Int32=rows[0].size)-class-method">
<div class="entry-detail" id="new(rows,column_count:Int32?=nil)-class-method">
<div class="signature">
def self.<strong>new</strong>(rows, column_count : Int32 = rows[<span class="n">0</span>].size)
def self.<strong>new</strong>(rows, column_count : Int32? = <span class="n">nil</span>)
<a class="method-permalink" href="#new%28rows%2Ccolumn_count%3AInt32%3Drows%5B0%5D.size%29-class-method">#</a>
<a class="method-permalink" href="#new%28rows%2Ccolumn_count%3AInt32%3F%3Dnil%29-class-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L15" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L15" target="_blank">View source</a>]
</div>
</div>
@ -555,7 +562,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L22" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L22" target="_blank">View source</a>]
</div>
</div>
@ -574,7 +581,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L28" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L28" target="_blank">View source</a>]
</div>
</div>
@ -592,7 +599,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L39" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L39" target="_blank">View source</a>]
</div>
</div>
@ -610,7 +617,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L44" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L44" target="_blank">View source</a>]
</div>
</div>
@ -628,7 +635,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L70" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L70" target="_blank">View source</a>]
</div>
</div>
@ -646,7 +653,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L84" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L84" target="_blank">View source</a>]
</div>
</div>
@ -665,7 +672,26 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L90" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L90" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="eye(n)-class-method">
<div class="signature">
def self.<strong>eye</strong>(n)
<a class="method-permalink" href="#eye%28n%29-class-method">#</a>
</div>
<div class="doc"><p>Creates a new diagonal matrix of size <code>n</code> with ones in the diagonal
and zeros elsewhere.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L98" target="_blank">View source</a>]
</div>
</div>
@ -683,7 +709,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L97" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L103" target="_blank">View source</a>]
</div>
</div>
@ -701,7 +727,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L101" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L107" target="_blank">View source</a>]
</div>
</div>
@ -719,7 +745,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L106" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L112" target="_blank">View source</a>]
</div>
</div>
@ -737,7 +763,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L111" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L117" target="_blank">View source</a>]
</div>
</div>
@ -755,7 +781,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L120" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L126" target="_blank">View source</a>]
</div>
</div>
@ -773,7 +799,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L125" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L131" target="_blank">View source</a>]
</div>
</div>
@ -791,7 +817,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L129" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L135" target="_blank">View source</a>]
</div>
</div>
@ -812,7 +838,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L134" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L140" target="_blank">View source</a>]
</div>
</div>
@ -828,7 +854,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L148" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L154" target="_blank">View source</a>]
</div>
</div>
@ -844,7 +870,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L155" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L161" target="_blank">View source</a>]
</div>
</div>
@ -860,7 +886,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L161" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L167" target="_blank">View source</a>]
</div>
</div>
@ -876,7 +902,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L170" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L176" target="_blank">View source</a>]
</div>
</div>
@ -892,7 +918,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L182" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L188" target="_blank">View source</a>]
</div>
</div>
@ -908,7 +934,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L199" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L205" target="_blank">View source</a>]
</div>
</div>
@ -924,7 +950,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L187" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L193" target="_blank">View source</a>]
</div>
</div>
@ -940,7 +966,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L204" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L210" target="_blank">View source</a>]
</div>
</div>
@ -956,7 +982,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L208" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L214" target="_blank">View source</a>]
</div>
</div>
@ -972,7 +998,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L215" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L221" target="_blank">View source</a>]
</div>
</div>
@ -990,7 +1016,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L222" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L228" target="_blank">View source</a>]
</div>
</div>
@ -1008,7 +1034,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L227" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L233" target="_blank">View source</a>]
</div>
</div>
@ -1026,7 +1052,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L233" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L239" target="_blank">View source</a>]
</div>
</div>
@ -1044,7 +1070,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L241" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L247" target="_blank">View source</a>]
</div>
</div>
@ -1062,7 +1088,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L268" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L274" target="_blank">View source</a>]
</div>
</div>
@ -1080,7 +1106,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L259" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L265" target="_blank">View source</a>]
</div>
</div>
@ -1098,7 +1124,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L250" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L256" target="_blank">View source</a>]
</div>
</div>
@ -1114,7 +1140,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L11" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -1132,7 +1158,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L277" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L283" target="_blank">View source</a>]
</div>
</div>
@ -1148,7 +1174,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L348" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L354" target="_blank">View source</a>]
</div>
</div>
@ -1164,7 +1190,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L423" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L429" target="_blank">View source</a>]
</div>
</div>
@ -1182,7 +1208,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L298" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L304" target="_blank">View source</a>]
</div>
</div>
@ -1200,7 +1226,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L444" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L450" target="_blank">View source</a>]
</div>
</div>
@ -1216,7 +1242,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L510" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L516" target="_blank">View source</a>]
</div>
</div>
@ -1232,7 +1258,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L469" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L475" target="_blank">View source</a>]
</div>
</div>
@ -1248,7 +1274,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L474" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L480" target="_blank">View source</a>]
</div>
</div>
@ -1264,7 +1290,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L13" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L13" target="_blank">View source</a>]
</div>
</div>
@ -1280,7 +1306,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L478" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L484" target="_blank">View source</a>]
</div>
</div>
@ -1296,7 +1322,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L486" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L492" target="_blank">View source</a>]
</div>
</div>
@ -1312,7 +1338,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L496" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L502" target="_blank">View source</a>]
</div>
</div>
@ -1328,7 +1354,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L490" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L496" target="_blank">View source</a>]
</div>
</div>
@ -1344,7 +1370,7 @@ the given block, passing the current row and column.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/matrix.cr#L519" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/matrix.cr#L525" target="_blank">View source</a>]
</div>
</div>

View File

@ -122,7 +122,7 @@
<h2>Defined in:</h2>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L2" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L2" target="_blank">
apatite/linear_algebra/ndarray.cr
</a>
@ -323,7 +323,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L18" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L18" target="_blank">View source</a>]
</div>
</div>
@ -346,7 +346,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L11" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -362,7 +362,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L11" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -378,7 +378,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L13" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L13" target="_blank">View source</a>]
</div>
</div>
@ -394,7 +394,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L12" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L12" target="_blank">View source</a>]
</div>
</div>
@ -410,7 +410,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L12" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L12" target="_blank">View source</a>]
</div>
</div>
@ -428,7 +428,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L24" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L24" target="_blank">View source</a>]
</div>
</div>
@ -446,7 +446,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L29" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L29" target="_blank">View source</a>]
</div>
</div>
@ -462,7 +462,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L9" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L9" target="_blank">View source</a>]
</div>
</div>
@ -478,7 +478,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L11" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -494,7 +494,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L16" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L16" target="_blank">View source</a>]
</div>
</div>
@ -510,7 +510,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L16" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L16" target="_blank">View source</a>]
</div>
</div>
@ -526,7 +526,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L15" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L15" target="_blank">View source</a>]
</div>
</div>
@ -542,7 +542,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L15" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L15" target="_blank">View source</a>]
</div>
</div>
@ -558,7 +558,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L14" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L14" target="_blank">View source</a>]
</div>
</div>
@ -574,7 +574,7 @@
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/ndarray.cr#L14" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/ndarray.cr#L14" target="_blank">View source</a>]
</div>
</div>

View File

@ -127,7 +127,7 @@ of a <code><a href="../../Apatite/LinearAlgebra/Matrix.html">Matrix</a></code></
<h2>Defined in:</h2>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L4" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L4" target="_blank">
apatite/linear_algebra/vector.cr
</a>
@ -244,9 +244,9 @@ of a <code><a href="../../Apatite/LinearAlgebra/Matrix.html">Matrix</a></code></
</li>
<li class="entry-summary">
<a href="#random%28n%2Crange%3DFloat64%3A%3AMIN..Float64%3A%3AMAX%29-class-method" class="signature"><strong>.random</strong>(n, range = <span class="t">Float64</span><span class="t">::</span><span class="t">MIN</span>..<span class="t">Float64</span><span class="t">::</span><span class="t">MAX</span>)</a>
<a href="#random%28n%2Crange%3Dnil%29-class-method" class="signature"><strong>.random</strong>(n, range = <span class="n">nil</span>)</a>
<div class="summary"><p>Generates a random vector of size <code>n</code> with elements in <code>range</code>.</p></div>
<div class="summary"><p>Creates a new <code><a href="../../Apatite/LinearAlgebra/Vector.html">Vector</a></code> of size <code>n</code> filled with random numbers.</p></div>
</li>
@ -773,7 +773,7 @@ and yielding that buffer. The given block must return the desired size of the ve
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L106" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L106" target="_blank">View source</a>]
</div>
</div>
@ -793,7 +793,7 @@ and yielding that buffer. The given block must return the desired size of the ve
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L63" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L63" target="_blank">View source</a>]
</div>
</div>
@ -820,7 +820,7 @@ vec.size <span class="c"># =&gt; 0</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L43" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L43" target="_blank">View source</a>]
</div>
</div>
@ -838,7 +838,7 @@ vec.size <span class="c"># =&gt; 0</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L25" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L25" target="_blank">View source</a>]
</div>
</div>
@ -862,7 +862,7 @@ vec <span class="c"># =&gt; Vector{5.0, 5.0, 5.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L87" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L87" target="_blank">View source</a>]
</div>
</div>
@ -883,7 +883,7 @@ vec <span class="c"># =&gt; Vector{5.0, 5.0, 5.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L156" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L156" target="_blank">View source</a>]
</div>
</div>
@ -901,7 +901,7 @@ vec <span class="c"># =&gt; Vector{5.0, 5.0, 5.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L138" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L138" target="_blank">View source</a>]
</div>
</div>
@ -922,7 +922,7 @@ collection.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L118" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L118" target="_blank">View source</a>]
</div>
</div>
@ -940,26 +940,27 @@ collection.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L152" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L152" target="_blank">View source</a>]
</div>
</div>
<div class="entry-detail" id="random(n,range=Float64::MIN..Float64::MAX)-class-method">
<div class="entry-detail" id="random(n,range=nil)-class-method">
<div class="signature">
def self.<strong>random</strong>(n, range = <span class="t">Float64</span><span class="t">::</span><span class="t">MIN</span>..<span class="t">Float64</span><span class="t">::</span><span class="t">MAX</span>)
def self.<strong>random</strong>(n, range = <span class="n">nil</span>)
<a class="method-permalink" href="#random%28n%2Crange%3DFloat64%3A%3AMIN..Float64%3A%3AMAX%29-class-method">#</a>
<a class="method-permalink" href="#random%28n%2Crange%3Dnil%29-class-method">#</a>
</div>
<div class="doc"><p>Generates a random vector of size <code>n</code> with elements
in <code>range</code>.</p></div>
<div class="doc"><p>Creates a new <code><a href="../../Apatite/LinearAlgebra/Vector.html">Vector</a></code> of size <code>n</code> filled with random numbers. A <code>range</code>
can optionally be passed in if you want to limit the random numbers
to a given range.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L128" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L129" target="_blank">View source</a>]
</div>
</div>
@ -977,7 +978,7 @@ in <code>range</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L147" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L147" target="_blank">View source</a>]
</div>
</div>
@ -998,7 +999,7 @@ in <code>range</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L370" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L370" target="_blank">View source</a>]
</div>
</div>
@ -1014,7 +1015,7 @@ in <code>range</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L362" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L362" target="_blank">View source</a>]
</div>
</div>
@ -1030,7 +1031,7 @@ in <code>range</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L366" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L366" target="_blank">View source</a>]
</div>
</div>
@ -1048,7 +1049,7 @@ in <code>range</code>.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L349" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L349" target="_blank">View source</a>]
</div>
</div>
@ -1077,7 +1078,7 @@ value, that result is the return value of the comparison.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L339" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L339" target="_blank">View source</a>]
</div>
</div>
@ -1093,7 +1094,7 @@ value, that result is the return value of the comparison.</p>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L353" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L353" target="_blank">View source</a>]
</div>
</div>
@ -1122,7 +1123,7 @@ v[<span class="n">6</span>, <span class="n">10</span>] <span class="c"># raise I
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L191" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L191" target="_blank">View source</a>]
</div>
</div>
@ -1150,7 +1151,7 @@ v[<span class="n">6</span>..<span class="n">10</span>] <span class="c"># raise I
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L173" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L173" target="_blank">View source</a>]
</div>
</div>
@ -1176,7 +1177,7 @@ vec <span class="c"># = Vector{1.0, 6.0, 7.0, 5.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L297" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L297" target="_blank">View source</a>]
</div>
</div>
@ -1208,7 +1209,7 @@ vec <span class="c"># =&gt; Vector{1.0, 6.0, 2.0, 3.0, 4.0, 5.0}</span></code></
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L248" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L248" target="_blank">View source</a>]
</div>
</div>
@ -1235,7 +1236,7 @@ vec[<span class="n">3</span>] <span class="o">=</span> <span class="n">5.0</span
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L226" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L226" target="_blank">View source</a>]
</div>
</div>
@ -1261,7 +1262,7 @@ vec <span class="c"># = Vector{1.0, 6.0, 2.0, 3.0, 4.0, 5.0}</span></code></pre>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L282" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L282" target="_blank">View source</a>]
</div>
</div>
@ -1281,7 +1282,7 @@ will be added together.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L488" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L488" target="_blank">View source</a>]
</div>
</div>
@ -1300,7 +1301,7 @@ If the vectors are mirrored across their axes this will return <code>nil</code>.
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L440" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L440" target="_blank">View source</a>]
</div>
</div>
@ -1318,7 +1319,7 @@ If the vectors are mirrored across their axes this will return <code>nil</code>.
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L475" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L475" target="_blank">View source</a>]
</div>
</div>
@ -1337,7 +1338,7 @@ on the end.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L556" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L556" target="_blank">View source</a>]
</div>
</div>
@ -1356,7 +1357,7 @@ the beginning.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L541" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L541" target="_blank">View source</a>]
</div>
</div>
@ -1377,7 +1378,7 @@ vec.clear <span class="c"># =&gt; Vector{}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L782" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L782" target="_blank">View source</a>]
</div>
</div>
@ -1393,7 +1394,7 @@ vec.clear <span class="c"># =&gt; Vector{}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L374" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L374" target="_blank">View source</a>]
</div>
</div>
@ -1409,7 +1410,7 @@ vec.clear <span class="c"># =&gt; Vector{}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L731" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L731" target="_blank">View source</a>]
</div>
</div>
@ -1427,7 +1428,7 @@ vec.clear <span class="c"># =&gt; Vector{}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L601" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L601" target="_blank">View source</a>]
</div>
</div>
@ -1449,7 +1450,7 @@ v1.cross(v2) => <span class="t">Vector</span>{<span class="n">0.0</span>, <span
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L518" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L518" target="_blank">View source</a>]
</div>
</div>
@ -1468,7 +1469,7 @@ a point in space.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L629" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L629" target="_blank">View source</a>]
</div>
</div>
@ -1488,7 +1489,7 @@ a point in space.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L574" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L574" target="_blank">View source</a>]
</div>
</div>
@ -1507,7 +1508,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L426" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L426" target="_blank">View source</a>]
</div>
</div>
@ -1525,7 +1526,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L384" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L384" target="_blank">View source</a>]
</div>
</div>
@ -1543,7 +1544,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L654" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L654" target="_blank">View source</a>]
</div>
</div>
@ -1561,7 +1562,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L649" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L649" target="_blank">View source</a>]
</div>
</div>
@ -1579,7 +1580,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L562" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L562" target="_blank">View source</a>]
</div>
</div>
@ -1599,7 +1600,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L419" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L419" target="_blank">View source</a>]
</div>
</div>
@ -1617,7 +1618,7 @@ is out of bounds. Indexing starts from 1.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L379" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L379" target="_blank">View source</a>]
</div>
</div>
@ -1640,7 +1641,7 @@ a <span class="c"># =&gt; Vector{1.0, 4.0, 9.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L400" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L400" target="_blank">View source</a>]
</div>
</div>
@ -1658,7 +1659,7 @@ a <span class="c"># =&gt; Vector{1.0, 4.0, 9.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L406" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L406" target="_blank">View source</a>]
</div>
</div>
@ -1676,7 +1677,7 @@ a <span class="c"># =&gt; Vector{1.0, 4.0, 9.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L411" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L411" target="_blank">View source</a>]
</div>
</div>
@ -1694,7 +1695,7 @@ a <span class="c"># =&gt; Vector{1.0, 4.0, 9.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L589" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L589" target="_blank">View source</a>]
</div>
</div>
@ -1712,7 +1713,7 @@ a <span class="c"># =&gt; Vector{1.0, 4.0, 9.0}</span></code></pre></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L594" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L594" target="_blank">View source</a>]
</div>
</div>
@ -1732,7 +1733,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L502" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L502" target="_blank">View source</a>]
</div>
</div>
@ -1750,7 +1751,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L469" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L469" target="_blank">View source</a>]
</div>
</div>
@ -1768,7 +1769,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L481" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L481" target="_blank">View source</a>]
</div>
</div>
@ -1784,7 +1785,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L754" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L754" target="_blank">View source</a>]
</div>
</div>
@ -1802,7 +1803,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L567" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L567" target="_blank">View source</a>]
</div>
</div>
@ -1818,7 +1819,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L665" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L665" target="_blank">View source</a>]
</div>
</div>
@ -1834,7 +1835,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L658" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L658" target="_blank">View source</a>]
</div>
</div>
@ -1853,7 +1854,7 @@ will be element-wise multiplied.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L684" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L684" target="_blank">View source</a>]
</div>
</div>
@ -1873,7 +1874,7 @@ careful with line directions!</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L678" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L678" target="_blank">View source</a>]
</div>
</div>
@ -1891,7 +1892,7 @@ careful with line directions!</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L612" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L612" target="_blank">View source</a>]
</div>
</div>
@ -1907,7 +1908,7 @@ careful with line directions!</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L726" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L726" target="_blank">View source</a>]
</div>
</div>
@ -1926,7 +1927,7 @@ across the whole vector.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L707" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L707" target="_blank">View source</a>]
</div>
</div>
@ -1944,7 +1945,7 @@ across the whole vector.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L24" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L24" target="_blank">View source</a>]
</div>
</div>
@ -1963,7 +1964,7 @@ they differ from it by less than <code>Apetite.precision</code></p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L623" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L623" target="_blank">View source</a>]
</div>
</div>
@ -1983,7 +1984,7 @@ will be subtracted.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L495" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L495" target="_blank">View source</a>]
</div>
</div>
@ -2001,7 +2002,7 @@ will be subtracted.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L507" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L507" target="_blank">View source</a>]
</div>
</div>
@ -2020,7 +2021,7 @@ z-component is added.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L713" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L713" target="_blank">View source</a>]
</div>
</div>
@ -2036,7 +2037,7 @@ z-component is added.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L744" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L744" target="_blank">View source</a>]
</div>
</div>
@ -2055,7 +2056,7 @@ diagonal elements.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L607" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L607" target="_blank">View source</a>]
</div>
</div>
@ -2071,7 +2072,7 @@ diagonal elements.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L748" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L748" target="_blank">View source</a>]
</div>
</div>
@ -2091,7 +2092,7 @@ vector, it will not be modified.</p></div>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L433" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L433" target="_blank">View source</a>]
</div>
</div>
@ -2115,7 +2116,7 @@ vec.to_unsafe[<span class="n">0</span>] <span class="c"># =&gt; 1.0</span></code
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L772" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L772" target="_blank">View source</a>]
</div>
</div>
@ -2133,7 +2134,7 @@ vec.to_unsafe[<span class="n">0</span>] <span class="c"># =&gt; 1.0</span></code
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L548" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L548" target="_blank">View source</a>]
</div>
</div>
@ -2151,7 +2152,7 @@ vec.to_unsafe[<span class="n">0</span>] <span class="c"># =&gt; 1.0</span></code
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L617" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L617" target="_blank">View source</a>]
</div>
</div>
@ -2167,7 +2168,7 @@ vec.to_unsafe[<span class="n">0</span>] <span class="c"># =&gt; 1.0</span></code
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L759" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L759" target="_blank">View source</a>]
</div>
</div>
@ -2183,7 +2184,7 @@ vec.to_unsafe[<span class="n">0</span>] <span class="c"># =&gt; 1.0</span></code
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/linear_algebra/vector.cr#L788" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/linear_algebra/vector.cr#L788" target="_blank">View source</a>]
</div>
</div>

View File

@ -160,7 +160,7 @@ set <span class="o">&lt;&lt;</span> <span class="n">3</span></code></pre>
<h2>Defined in:</h2>
<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/core_ext/array.cr#L1" target="_blank">
<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/core_ext/array.cr#L1" target="_blank">
apatite/core_ext/array.cr
</a>
@ -294,7 +294,7 @@ set <span class="o">&lt;&lt;</span> <span class="n">3</span></code></pre>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/core_ext/array.cr#L3" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/core_ext/array.cr#L3" target="_blank">View source</a>]
</div>
</div>
@ -312,7 +312,7 @@ set <span class="o">&lt;&lt;</span> <span class="n">3</span></code></pre>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/core_ext/array.cr#L11" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/core_ext/array.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -330,7 +330,7 @@ set <span class="o">&lt;&lt;</span> <span class="n">3</span></code></pre>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/core_ext/array.cr#L19" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/core_ext/array.cr#L19" target="_blank">View source</a>]
</div>
</div>
@ -346,7 +346,7 @@ set <span class="o">&lt;&lt;</span> <span class="n">3</span></code></pre>
<br/>
<div>
[<a href="https://github.com/watzon/apatite/blob/6c8ee1fded2782d2cc9fcd30ca82bd149f6eb9a3/src/apatite/core_ext/array.cr#L24" target="_blank">View source</a>]
[<a href="https://github.com/watzon/apatite/blob/bb0f2c43324c0d6ab61bd78a63170c4d2e671d2f/src/apatite/core_ext/array.cr#L24" target="_blank">View source</a>]
</div>
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -11,20 +11,23 @@ module Apatite
extend self
include Apatite::LinearAlgebra
class_property precision = 1e-6
class_property approx_precision = 1e-5
## ## ## ## ## ## ## ## ## ## ## ## ##
# # Vector Creation
## ## ## ## ## ## ## ## ## ## ## ## ##
# Cartesian unit vector I
#
# `Vector{1.0, 0.0, 0.0}`
I = Vector::I
# Cartesian unit vector J
#
# `Vector{0.0, 1.0, 0.0}`
J = Vector::J
# Cartesian unit vector K
#
# `Vector{0.0, 0.0, 1.0}`
K = Vector::K
# Returns a new empty `Vector`
@ -34,12 +37,12 @@ module Apatite
# Returns a new vector filled with `n` ones.
def ones(n)
Vector.new(n, 1)
Vector.ones(n)
end
# Returns a new vector filled with `n` zeros.
def zeros(n)
Vector.new(n, 0)
Vector.zeros(n)
end
# Returns a new vector of size `n` filled with `i`
@ -59,13 +62,52 @@ module Apatite
Vector.create(input)
end
# Returns a standard basis-n vector of the given `size` and `index`.
# Creates a standard basis-n vector of the given `size` and `index`.
def basis(size, index)
Vector.basis(size, index)
end
# 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.
def random(n, range = nil)
Vector.random(n, range)
end
## ## ## ## ## ## ## ## ## ## ## ##
# # Matrix Creation
## ## ## ## ## ## ## ## ## ## ## ##
# 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.
def empty_matrix(row_count = 0, column_count = 0)
Matrix.new(rows, column_count)
end
# Creates a matrix where the diagonal elements are composed of `values`.
def diagonal(values)
Matrix.diagonal(values)
end
# Creates a new diagonal matrix of size `n` with ones in the diagonal
# and zeros elsewhere.
def eye(n)
Matrix.eye(n)
end
# Creates a `n x n` identity matrix.
def identity(n)
Matrix.identity(n)
end
# Creates a single-row matrix where the values of that row are as given in `row`.
def row_vector(row)
Matrix.row_vector(row)
end
# Creates an `n` by `n` diagonal matrix where each diagonal element is value.
def scalar(n, value)
Matrix.scalar(n, value)
end
end

View File

@ -8,9 +8,9 @@ module Apatite
# Calculates the sigmoid curve for a numeric input.
#
# f(x) = 1/(1 + e^-x)
# `f(x) = 1/(1 + e^-x)`
#
# See also: [Sigmoid function [WikiWand]](https://www.wikiwand.com/en/Sigmoid_function)
# See also: [Sigmoid function (WikiWand)](https://www.wikiwand.com/en/Sigmoid_function)
def sigmoid(input : Number)
num = input.to_f64
1 / (1 + Math.exp(-num))
@ -18,7 +18,7 @@ module Apatite
# Calculates the derivative sigmoid curve for a numeric input.
#
# f'(x) = f(x)(1 - f(x)),
# `f'(x) = f(x)(1 - f(x)),`
def sigmoid_d(input : Number)
num = input.to_f64
num * (1 - num)

View File

@ -12,10 +12,10 @@ module Apatite::LinearAlgebra
@buffer : Pointer(Vector)
def initialize(rows, column_count : Int32 = rows[0].size)
def initialize(rows, column_count : Int32? = nil)
@buffer = rows.map { |r| Vector.create(r) }.to_a.to_unsafe
@row_count = rows.size
@column_count = column_count
@column_count = column_count || rows[0].size
end
# Creates a matrix where each argument is a row.
@ -93,6 +93,12 @@ module Apatite::LinearAlgebra
Matrix.new(([] of Vector) * row_count, column_count)
end
# Creates a new diagonal matrix of size `n` with ones in the diagonal
# and zeros elsewhere.
def self.eye(n)
Matrix.diagonal([1] * n)
end
# TODO
def self.hstack(x, *matrices)
end

View File

@ -123,13 +123,13 @@ module Apatite::LinearAlgebra
vec
end
# Generates a random vector of size `n` with elements
# in `range`.
def self.random(n, range = Float64::MIN..Float64::MAX)
random = Random.new
# 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.
def self.random(n, range = nil)
vec = Vector.new(n)
n.times do
vec.push random.rand(range)
vec.push rand(range || -1e+1..1e+1)
end
vec
end