aboutsummaryrefslogtreecommitdiffstats
path: root/110
diff options
context:
space:
mode:
Diffstat (limited to '110')
-rw-r--r--110/Makefile18
-rw-r--r--110/README.md5
-rw-r--r--110/common2
-rw-r--r--110/common11
-rw-r--r--110/compile_flags.txt4
-rw-r--r--110/data18
-rw-r--r--110/data25
l---------110/include1
-rwxr-xr-x110/mainbin0 -> 301936 bytes
-rw-r--r--110/main.cpp41
-rw-r--r--110/plots.gp14
11 files changed, 99 insertions, 0 deletions
diff --git a/110/Makefile b/110/Makefile
new file mode 100644
index 0000000..eb309ff
--- /dev/null
+++ b/110/Makefile
@@ -0,0 +1,18 @@
+
+CFLAGS = -std=c++2c -mavx -Iinclude -ggdb
+
+.PHONY: all run_main clean gnuplot
+
+run: gnuplot
+
+gnuplot: plots.gp run_main
+ gnuplot $<
+
+run_main: main
+ ./main
+
+main: main.cpp include/*
+ $(CXX) -o $@ $< $(CFLAGS)
+
+clean:
+ rm -fr main *.png *.plot
diff --git a/110/README.md b/110/README.md
new file mode 100644
index 0000000..96fd716
--- /dev/null
+++ b/110/README.md
@@ -0,0 +1,5 @@
+<!-- Шаблон для прака -->
+<!-- файлы, заканчивающиеся на .plot считаются генерируемыми и удаляются через make clean -->
+# Обработка <> прака
+
+
diff --git a/110/common b/110/common
new file mode 100644
index 0000000..75797ad
--- /dev/null
+++ b/110/common
@@ -0,0 +1,2 @@
+R1 R2 x0_1 x2_1 x4_1 m1 R2_0 R2_1 m2_0 m2_1
+0.0194 0.0296 0.745 0 0.04 0.20145 0.0296 0.0194 0.20145 0.12977
diff --git a/110/common1 b/110/common1
new file mode 100644
index 0000000..bd692b4
--- /dev/null
+++ b/110/common1
@@ -0,0 +1 @@
+R1 R2 x0 x2 m1 m2 x4
diff --git a/110/compile_flags.txt b/110/compile_flags.txt
new file mode 100644
index 0000000..34ae930
--- /dev/null
+++ b/110/compile_flags.txt
@@ -0,0 +1,4 @@
+-Iinclude
+-std=c++2c
+-mavx2
+
diff --git a/110/data1 b/110/data1
new file mode 100644
index 0000000..7be72e7
--- /dev/null
+++ b/110/data1
@@ -0,0 +1,8 @@
+x3 x11 x12 x13 t1 t2 t3
+0.76 0.575 0.573 0.578 5.683 5.572 5.711
+0.72 0.548 0.564 0.560 5.952 5.672 5.878
+0.65 0.503 0.498 0.505 5.041 5.173 5.059
+0.60 0.465 0.466 0.469 4.862 4.776 4.728
+0.55 0.429 0.466 0.469 4.593 4.520 4.519
+0.50 0.391 0.400 0.402 4.097 4.077 4.244
+0.40 0.329 0.327 0.325 3.640 3.612 3.629
diff --git a/110/data2 b/110/data2
new file mode 100644
index 0000000..cc0e301
--- /dev/null
+++ b/110/data2
@@ -0,0 +1,5 @@
+R M t1 t2 t3
+0 0 5.573 5.693 5.676
+0 1 6.597 6.661 6.685
+1 0 8.261 8.324 8.319
+1 1 10.254 10.467 10.441
diff --git a/110/include b/110/include
new file mode 120000
index 0000000..1b37f46
--- /dev/null
+++ b/110/include
@@ -0,0 +1 @@
+../libprakpp/include \ No newline at end of file
diff --git a/110/main b/110/main
new file mode 100755
index 0000000..2af817c
--- /dev/null
+++ b/110/main
Binary files differ
diff --git a/110/main.cpp b/110/main.cpp
new file mode 100644
index 0000000..3ce0d0b
--- /dev/null
+++ b/110/main.cpp
@@ -0,0 +1,41 @@
+#include <iostream>
+
+#include "include/praktable.hpp"
+
+using table = prak::table<double>;
+using vecarg = const std::vector<f64> &;
+table data;
+
+f64 get(std::string key) {
+ return data[key, 0];
+}
+
+// [0] = x0
+f64 getsqrt(vecarg v) {
+ return std::sqrt(std::abs(get("x0_1") - v[0]));
+}
+
+table prepare_ex1(std::string s) {
+ table ret(s);
+ ret.add_column("x1", std::vector<f64>(ret.rows, NAN));
+ ret.add_column("t", std::vector<f64>(ret.rows, NAN));
+ ret.add_column("st", std::vector<f64>(ret.rows, NAN));
+ ret.add_column("sqrt", std::vector<f64>(ret.rows, NAN));
+ ret .apply(prak::avg<f64>, {"x11", "x12", "x13"}, "x1")
+ .apply(prak::avg<f64>, {"t1", "t2", "t3"}, "t")
+ .apply(prak::stddev<f64>, {"t1", "t2", "t3"}, "st")
+ .apply(getsqrt, {"x3"}, "sqrt");
+
+ std::cout << ret;
+ return ret;
+}
+
+void ex1(void) {
+ table t;
+}
+
+int main() {
+ data = table("common");
+ prepare_ex1("data1");
+ return 0;
+}
diff --git a/110/plots.gp b/110/plots.gp
new file mode 100644
index 0000000..702408a
--- /dev/null
+++ b/110/plots.gp
@@ -0,0 +1,14 @@
+set term pngcairo size 1000, 800
+set tmargin at screen 0.95
+
+f1(x) = a1*x+b1
+fit f1(x) '.plot' using 1:2:3 yerr via a1, b1
+
+set output ''
+set label "" at graph 0.5, graph 1.025 center
+set xlabel ""
+set ylabel ""
+
+plot '.plot' using 1:2:3 with yerrorbars notitle lc 0 pt 1 lw 2, \
+ f1(x) title "" lc rgb "red", \
+