This commit is contained in:
parent
73aec484df
commit
8fbbf0afcf
42
.gitea/workflows/build.yaml
Normal file
42
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
|
||||||
|
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
|
||||||
|
name: CMake on a single platform
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
|
BUILD_TYPE: Release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: archlinux
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Stop previous server if running
|
||||||
|
run: ~/stop.sh fourier || echo service was not started
|
||||||
|
|
||||||
|
- name: clear old installation
|
||||||
|
run: xargs rm < ~/build/install_manifest.txt || echo previous installation not found
|
||||||
|
|
||||||
|
- name: clear old builddir
|
||||||
|
run: rm -rf ~/build || echo previous installation not found
|
||||||
|
|
||||||
|
- name: Configure CMake
|
||||||
|
run: cmake -B ~/build -DCMAKE_INSTALL_PREFIX=~/.local
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cmake --build ~/build
|
||||||
|
|
||||||
|
- name: install
|
||||||
|
run: make -C ~/build install
|
||||||
|
|
||||||
|
- name: Start server
|
||||||
|
run: ~/start.sh fourier
|
||||||
|
|
74
.gitignore
vendored
Normal file
74
.gitignore
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# This file is used to ignore files which are generated
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
build
|
||||||
|
*~
|
||||||
|
*.autosave
|
||||||
|
*.a
|
||||||
|
*.core
|
||||||
|
*.moc
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*_pch.h.cpp
|
||||||
|
*_resource.rc
|
||||||
|
*.qm
|
||||||
|
.#*
|
||||||
|
*.*#
|
||||||
|
core
|
||||||
|
!core/
|
||||||
|
tags
|
||||||
|
.DS_Store
|
||||||
|
.directory
|
||||||
|
*.debug
|
||||||
|
Makefile*
|
||||||
|
*.prl
|
||||||
|
*.app
|
||||||
|
moc_*.cpp
|
||||||
|
ui_*.h
|
||||||
|
qrc_*.cpp
|
||||||
|
Thumbs.db
|
||||||
|
*.res
|
||||||
|
*.rc
|
||||||
|
/.qmake.cache
|
||||||
|
/.qmake.stash
|
||||||
|
|
||||||
|
# qtcreator generated files
|
||||||
|
*.pro.user*
|
||||||
|
CMakeLists.txt.user*
|
||||||
|
|
||||||
|
# xemacs temporary files
|
||||||
|
*.flc
|
||||||
|
|
||||||
|
# Vim temporary files
|
||||||
|
.*.swp
|
||||||
|
|
||||||
|
# Visual Studio generated files
|
||||||
|
*.ib_pdb_index
|
||||||
|
*.idb
|
||||||
|
*.ilk
|
||||||
|
*.pdb
|
||||||
|
*.sln
|
||||||
|
*.suo
|
||||||
|
*.vcproj
|
||||||
|
*vcproj.*.*.user
|
||||||
|
*.ncb
|
||||||
|
*.sdf
|
||||||
|
*.opensdf
|
||||||
|
*.vcxproj
|
||||||
|
*vcxproj.*
|
||||||
|
|
||||||
|
# MinGW generated files
|
||||||
|
*.Debug
|
||||||
|
*.Release
|
||||||
|
|
||||||
|
# Python byte code
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Binaries
|
||||||
|
# --------
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
|
@ -53,32 +53,18 @@ public:
|
|||||||
data_.clear();
|
data_.clear();
|
||||||
data_.reserve(rowCount());
|
data_.reserve(rowCount());
|
||||||
|
|
||||||
vector<double> vals;
|
|
||||||
vals.reserve( discreteModel->rowCount());
|
|
||||||
|
|
||||||
double first_positive = DBL_MAX;
|
|
||||||
for(int i = 0; i < discreteModel->rowCount(); i++) {
|
|
||||||
auto v = discreteModel->data(i, 1);
|
|
||||||
vals.push_back(v);
|
|
||||||
|
|
||||||
if ( abs(vals[i]) > 0 && abs(vals[i]) < first_positive )
|
|
||||||
first_positive = abs(vals[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( int k = 0; k < rowCount(); k++ ) {
|
for ( int k = 0; k < rowCount(); k++ ) {
|
||||||
if ( first_positive > 0 ) {
|
|
||||||
double x = 0,
|
double x = 0,
|
||||||
y = 0;
|
y = 0;
|
||||||
for ( int n = 0; n < discreteModel->rowCount(); n++ ) {
|
for ( int n = 0; n < discreteModel->rowCount(); n++ ) {
|
||||||
double e = 2*M_PI*k*n/discreteModel->rowCount();
|
double e = 2*M_PI*k*n/discreteModel->rowCount();
|
||||||
double x = vals[n] / first_positive;
|
double v = discreteModel->data(n, 1);;
|
||||||
|
|
||||||
x+=x*cos(e);
|
x+=v*cos(e);
|
||||||
y-=x*sin(e);
|
y-=v*sin(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
data_[k] = {sqrt(x*x+y*y), atan2(y,x)};
|
data_[k] = {sqrt(x*x+y*y)/rowCount(), atan2(y,x)};
|
||||||
} else data_[k] = {0,0};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
changed().emit();
|
changed().emit();
|
||||||
@ -86,7 +72,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual double data(int row, int column) const override {
|
virtual double data(int row, int column) const override {
|
||||||
//double x = row/(2*M_PI);
|
|
||||||
switch ( column ) {
|
switch ( column ) {
|
||||||
case 0: return row;
|
case 0: return row;
|
||||||
case 1: return data_[row].first;
|
case 1: return data_[row].first;
|
||||||
|
@ -6,7 +6,7 @@ using namespace std;
|
|||||||
using namespace Wt;
|
using namespace Wt;
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
int code = 0;
|
int code = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user