mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-17 08:25:56 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
32a6fd9ba0 | ||
cd04f97fd0
|
|||
458a313aee
|
|||
e97aea2a4d
|
|||
4707bc0b7f
|
|||
8c868981e8
|
|||
e812e91540
|
|||
dddeea4024
|
|||
5b7d66d922
|
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
@@ -1,26 +1,30 @@
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
- uses: sonarsource/sonarqube-scan-action@master
|
- name: Install sonar-scanner and build-wrapper
|
||||||
|
uses: SonarSource/sonarcloud-github-c-cpp@v1
|
||||||
|
- name: Run build-wrapper
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cmake -S . -B build
|
||||||
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
|
||||||
|
- name: Run sonar-scanner
|
||||||
env:
|
env:
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here
|
||||||
# If you wish to fail your job when the Quality Gate is red, uncomment the
|
run: |
|
||||||
# following lines. This would typically be used to fail a deployment.
|
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
|
||||||
# - uses: sonarsource/sonarqube-quality-gate-action@master
|
|
||||||
# timeout-minutes: 5
|
|
||||||
# env:
|
|
||||||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -35,4 +35,3 @@
|
|||||||
.idea
|
.idea
|
||||||
cmake-*
|
cmake-*
|
||||||
**/CMakeFiles
|
**/CMakeFiles
|
||||||
sonar-project.properties
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <limits>
|
||||||
#include "CPPFImdlp.h"
|
#include "CPPFImdlp.h"
|
||||||
#include "Metrics.h"
|
#include "Metrics.h"
|
||||||
|
|
||||||
@@ -36,8 +37,6 @@ namespace mdlp {
|
|||||||
size_t idxNext = cut + 1 < end ? cut + 1 : cut;
|
size_t idxNext = cut + 1 < end ? cut + 1 : cut;
|
||||||
bool backWall; // true if duplicates reach begining of the interval
|
bool backWall; // true if duplicates reach begining of the interval
|
||||||
precision_t previous, actual, next;
|
precision_t previous, actual, next;
|
||||||
if (cut - 1 < start || cut + 1 >= end)
|
|
||||||
throw logic_error("Invalid cutpoint index");
|
|
||||||
previous = X[indices[idxPrev]];
|
previous = X[indices[idxPrev]];
|
||||||
actual = X[indices[cut]];
|
actual = X[indices[cut]];
|
||||||
next = X[indices[idxNext]];
|
next = X[indices[idxNext]];
|
||||||
|
@@ -23,7 +23,7 @@ namespace mdlp {
|
|||||||
~CPPFImdlp();
|
~CPPFImdlp();
|
||||||
CPPFImdlp& fit(samples_t&, labels_t&);
|
CPPFImdlp& fit(samples_t&, labels_t&);
|
||||||
samples_t getCutPoints();
|
samples_t getCutPoints();
|
||||||
inline string version() { return "1.1.0"; };
|
inline string version() { return "1.1.1"; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
12
sonar-project.properties
Normal file
12
sonar-project.properties
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
sonar.projectKey=rmontanana_mdlp
|
||||||
|
sonar.organization=rmontanana
|
||||||
|
|
||||||
|
# This is the name and version displayed in the SonarCloud UI.
|
||||||
|
#sonar.projectName=mdlp
|
||||||
|
#sonar.projectVersion=1.0
|
||||||
|
|
||||||
|
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
|
||||||
|
#sonar.sources=.
|
||||||
|
|
||||||
|
# Encoding of the source code. Default is default system encoding
|
||||||
|
sonar.sourceEncoding=UTF-8
|
Reference in New Issue
Block a user