Skip to content

Commit

Permalink
split LinearModel in univariate and multivariate
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloCampana committed Jan 6, 2024
1 parent 946c076 commit 427b642
Show file tree
Hide file tree
Showing 22 changed files with 958 additions and 199 deletions.
7 changes: 1 addition & 6 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ pub fn build(b: *std.Build) !void {
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&test_cmd.step);

const docs_tests = b.addTest(.{
.root_source_file = .{.path = "src/root.zig"},
.target = target,
.optimize = optimize,
});
const docs_cmd = b.addInstallDirectory(.{
.source_dir = docs_tests.getEmittedDocs(),
.source_dir = lib.getEmittedDocs(),
.install_dir = .{.custom = ".."},
.install_subdir = "docs",
});
Expand Down
2 changes: 1 addition & 1 deletion docs/data-astNodes.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data-calls.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data-comptimeExprs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data-decls.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data-exprs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/data-types.js

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions docs/src/builtin/builtin.zig.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@
<span class="line" id="L5"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> zig_version_string = <span class="tok-str">&quot;0.12.0-dev.2046+d3a163f86&quot;</span>;</span>
<span class="line" id="L6"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> zig_backend = std.builtin.CompilerBackend.stage2_llvm;</span>
<span class="line" id="L7"></span>
<span class="line" id="L8"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> output_mode = std.builtin.OutputMode.Exe;</span>
<span class="line" id="L8"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> output_mode = std.builtin.OutputMode.Lib;</span>
<span class="line" id="L9"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> link_mode = std.builtin.LinkMode.Static;</span>
<span class="line" id="L10"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> is_test = <span class="tok-null">true</span>;</span>
<span class="line" id="L10"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> is_test = <span class="tok-null">false</span>;</span>
<span class="line" id="L11"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> single_threaded = <span class="tok-null">false</span>;</span>
<span class="line" id="L12"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> abi = std.Target.Abi.gnu;</span>
<span class="line" id="L13"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> cpu: std.Target.Cpu = .{</span>
Expand Down Expand Up @@ -236,9 +236,6 @@
<span class="line" id="L122"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> strip_debug_info = <span class="tok-null">false</span>;</span>
<span class="line" id="L123"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> code_model = std.builtin.CodeModel.default;</span>
<span class="line" id="L124"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> omit_frame_pointer = <span class="tok-null">false</span>;</span>
<span class="line" id="L125"><span class="tok-kw">pub</span> <span class="tok-kw">var</span> test_functions: []<span class="tok-kw">const</span> std.builtin.TestFn = <span class="tok-null">undefined</span>; <span class="tok-comment">// overwritten later</span>
</span>
<span class="line" id="L126"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> test_io_mode = .blocking;</span>
<span class="line" id="L127"></span>
<span class="line" id="L125"></span>
</code></pre></body>
</html>
4 changes: 2 additions & 2 deletions docs/src/root/csv.zig.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
<span class="line" id="L24"></span>
<span class="line" id="L25"> <span class="tok-kw">const</span> result = <span class="tok-kw">try</span> Matrix</span>
<span class="line" id="L26"> .init(allocator)</span>
<span class="line" id="L27"> .create(rows, cols);</span>
<span class="line" id="L28"> <span class="tok-kw">errdefer</span> result.destroy();</span>
<span class="line" id="L27"> .alloc(rows, cols);</span>
<span class="line" id="L28"> <span class="tok-kw">errdefer</span> result.free();</span>
<span class="line" id="L29"></span>
<span class="line" id="L30"> <span class="tok-kw">var</span> i: <span class="tok-type">usize</span> = <span class="tok-number">0</span>;</span>
<span class="line" id="L31"> <span class="tok-kw">while</span> (iterator_vertical.next()) |line| : (i += <span class="tok-number">1</span>) {</span>
Expand Down
125 changes: 125 additions & 0 deletions docs/src/root/linear_model.zig.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>linear_model.zig - source view</title>
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBCBwHiip8UYmRdrAlDpIMgApwQZNnNii5Dq0MBgCxxycBnwEd+wAAAABJRU5ErkJggg==">
<link rel="icon" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNTMgMTQwIj48ZyBmaWxsPSIjRjdBNDFEIj48Zz48cG9seWdvbiBwb2ludHM9IjQ2LDIyIDI4LDQ0IDE5LDMwIi8+PHBvbHlnb24gcG9pbnRzPSI0NiwyMiAzMywzMyAyOCw0NCAyMiw0NCAyMiw5NSAzMSw5NSAyMCwxMDAgMTIsMTE3IDAsMTE3IDAsMjIiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIvPjxwb2x5Z29uIHBvaW50cz0iMzEsOTUgMTIsMTE3IDQsMTA2Ii8+PC9nPjxnPjxwb2x5Z29uIHBvaW50cz0iNTYsMjIgNjIsMzYgMzcsNDQiLz48cG9seWdvbiBwb2ludHM9IjU2LDIyIDExMSwyMiAxMTEsNDQgMzcsNDQgNTYsMzIiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIvPjxwb2x5Z29uIHBvaW50cz0iMTE2LDk1IDk3LDExNyA5MCwxMDQiLz48cG9seWdvbiBwb2ludHM9IjExNiw5NSAxMDAsMTA0IDk3LDExNyA0MiwxMTcgNDIsOTUiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIvPjxwb2x5Z29uIHBvaW50cz0iMTUwLDAgNTIsMTE3IDMsMTQwIDEwMSwyMiIvPjwvZz48Zz48cG9seWdvbiBwb2ludHM9IjE0MSwyMiAxNDAsNDAgMTIyLDQ1Ii8+PHBvbHlnb24gcG9pbnRzPSIxNTMsMjIgMTUzLDExNyAxMDYsMTE3IDEyMCwxMDUgMTI1LDk1IDEzMSw5NSAxMzEsNDUgMTIyLDQ1IDEzMiwzNiAxNDEsMjIiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyIvPjxwb2x5Z29uIHBvaW50cz0iMTI1LDk1IDEzMCwxMTAgMTA2LDExNyIvPjwvZz48L2c+PC9zdmc+">
<style>
body{
font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
margin: 0;
line-height: 1.5;
}

pre > code {
display: block;
overflow: auto;
line-height: normal;
margin: 0em;
}
.tok-kw {
color: #333;
font-weight: bold;
}
.tok-str {
color: #d14;
}
.tok-builtin {
color: #005C7A;
}
.tok-comment {
color: #545454;
font-style: italic;
}
.tok-fn {
color: #900;
font-weight: bold;
}
.tok-null {
color: #005C5C;
}
.tok-number {
color: #005C5C;
}
.tok-type {
color: #458;
font-weight: bold;
}
pre {
counter-reset: line;
}
pre .line:before {
counter-increment: line;
content: counter(line);
display: inline-block;
padding-right: 1em;
width: 2em;
text-align: right;
color: #999;
}

.line {
width: 100%;
display: inline-block;
}
.line:target {
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background: #fafafa;
}

@media (prefers-color-scheme: dark) {
body{
background:#222;
color: #ccc;
}
pre > code {
color: #ccc;
background: #222;
border: unset;
}
.line:target {
border-top: 1px solid #444;
border-bottom: 1px solid #444;
background: #333;
}
.tok-kw {
color: #eee;
}
.tok-str {
color: #2e5;
}
.tok-builtin {
color: #ff894c;
}
.tok-comment {
color: #aa7;
}
.tok-fn {
color: #B1A0F8;
}
.tok-null {
color: #ff8080;
}
.tok-number {
color: #ff8080;
}
.tok-type {
color: #68f;
}
}
</style>
</head>
<body>
<pre><code><span class="line" id="L1"><span class="tok-comment">// TODO //!</span>
</span>
<span class="line" id="L2"></span>
<span class="line" id="L3"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> Univariate = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;linear_model/Univariate.zig&quot;</span>);</span>
<span class="line" id="L4"><span class="tok-kw">pub</span> <span class="tok-kw">const</span> Multivariate = <span class="tok-builtin">@import</span>(<span class="tok-str">&quot;linear_model/Multivariate.zig&quot;</span>);</span>
<span class="line" id="L5"></span>
<span class="line" id="L6"><span class="tok-comment">// TODO test</span>
</span>
<span class="line" id="L7"></span>
</code></pre></body>
</html>
117 changes: 117 additions & 0 deletions docs/src/root/linear_model/Multivariate.zig.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>linear_model/Multivariate.zig - source view</title>
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgklEQVR4AWMYWuD7EllJIM4G4g4g5oIJ/odhOJ8wToOxSTXgNxDHoeiBMfA4+wGShjyYOCkG/IGqWQziEzYAoUAeiF9D5U+DxEg14DRU7jWIT5IBIOdCxf+A+CQZAAoopEB7QJwBC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ZGdlcyIvPjxwb2x5Z29uIHBvaW50cz0iMTI1LDk1IDEzMCwxMTAgMTA2LDExNyIvPjwvZz48L2c+PC9zdmc+">
<style>
body{
font-family: system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
margin: 0;
line-height: 1.5;
}

pre > code {
display: block;
overflow: auto;
line-height: normal;
margin: 0em;
}
.tok-kw {
color: #333;
font-weight: bold;
}
.tok-str {
color: #d14;
}
.tok-builtin {
color: #005C7A;
}
.tok-comment {
color: #545454;
font-style: italic;
}
.tok-fn {
color: #900;
font-weight: bold;
}
.tok-null {
color: #005C5C;
}
.tok-number {
color: #005C5C;
}
.tok-type {
color: #458;
font-weight: bold;
}
pre {
counter-reset: line;
}
pre .line:before {
counter-increment: line;
content: counter(line);
display: inline-block;
padding-right: 1em;
width: 2em;
text-align: right;
color: #999;
}

.line {
width: 100%;
display: inline-block;
}
.line:target {
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background: #fafafa;
}

@media (prefers-color-scheme: dark) {
body{
background:#222;
color: #ccc;
}
pre > code {
color: #ccc;
background: #222;
border: unset;
}
.line:target {
border-top: 1px solid #444;
border-bottom: 1px solid #444;
background: #333;
}
.tok-kw {
color: #eee;
}
.tok-str {
color: #2e5;
}
.tok-builtin {
color: #ff894c;
}
.tok-comment {
color: #aa7;
}
.tok-fn {
color: #B1A0F8;
}
.tok-null {
color: #ff8080;
}
.tok-number {
color: #ff8080;
}
.tok-type {
color: #68f;
}
}
</style>
</head>
<body>
<pre><code><span class="line" id="L1"></span>
</code></pre></body>
</html>
Loading

0 comments on commit 427b642

Please sign in to comment.