Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
needs: [create_release]
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v5
Expand All @@ -92,6 +92,22 @@ jobs:
compiler: gcc
if: runner.os == 'Linux'

- name: Setup NSIS (Windows)
run: |
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop update
scoop bucket add extras
scoop install nsis
Add-Content $env:GITHUB_PATH "C:\Users\runneradmin\scoop\shims\"
if: runner.os == 'Windows'

- name: Install Rust-bindgen (Linux)
run: |
sudo apt-get -qq update
sudo apt-get -qq -y install bindgen
if: runner.os == 'Linux'

- name: Install VTK (Linux)
run: |
sudo apt-get -qq update
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/mdf_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v5

- name: Install deps
run: |
sudo apt-get -qq update
sudo apt-get -qq -y install libblas-dev liblapack-dev
if: runner.os == 'Linux'

- name: Setup Python
uses: actions/setup-python@v6
id: setup-python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-wheels-emulated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: 'Host OS'
required: false
type: string
default: '["ubuntu-22.04"]'
default: '["ubuntu-latest"]'
arch:
description: 'Architecture target'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-wheels-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: 'Host OS'
required: false
type: string
default: '["ubuntu-22.04"]'
default: '["ubuntu-latest"]'
arch:
description: 'Architecture target'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
name: Build Linux_x86_64
uses: FloatingArrayDesign/MoorDyn/.github/workflows/python-wheels-emulated.yml@master
with:
os: '["ubuntu-22.04"]'
os: '["ubuntu-latest"]'
arch: "x86_64"
secrets: inherit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v5
Expand Down
31 changes: 15 additions & 16 deletions tests/math_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,37 @@ template<typename DerivedA>
struct IsCloseMatcher : Catch::Matchers::MatcherGenericBase
{
IsCloseMatcher(
const Eigen::Ref<const DerivedA> a,
const DerivedA& a,
const typename DerivedA::RealScalar rtol =
Eigen::NumTraits<typename DerivedA::RealScalar>::dummy_precision(),
const typename DerivedA::RealScalar atol =
Eigen::NumTraits<typename DerivedA::RealScalar>::epsilon())
: a(a)
, rtol(rtol)
, atol(atol)
: _a(a)
, _rtol(rtol)
, _atol(atol)
{
}

template<typename DerivedB>
bool match(const Eigen::DenseBase<DerivedB>& b) const
bool match(const DerivedB& b) const
{
return ((a.derived() - b.derived()).array().abs() <=
(atol + rtol * b.derived().array().abs()))
return ((_a.derived() - b.derived()).array().abs() <=
(_atol + _rtol * b.derived().array().abs()))
.all();
}

std::string describe() const override
{
std::stringstream ss;
ss << "Is close to: " << Catch::StringMaker<DerivedA>::convert(a)
<< "\nrtol = " << rtol << ", atol = " << atol;
ss << "Is close to: " << Catch::StringMaker<DerivedA>::convert(_a)
<< "\nrtol = " << _rtol << ", atol = " << _atol;
return ss.str();
}

private:
const Eigen::Ref<const DerivedA> a;
const typename DerivedA::RealScalar rtol;
const typename DerivedA::RealScalar atol;
const DerivedA _a;
const typename DerivedA::RealScalar _rtol;
const typename DerivedA::RealScalar _atol;
};

template<typename T>
Expand All @@ -72,13 +72,12 @@ using namespace md;
TEST_CASE("getH gives the cross product matrix")
{

vec testVec;
testVec << 1, 2, 3;

vec testVec{ 1.0, 2.0, 3.0 };
vec v{ 0.3, 0.2, 0.1 };
// getH() should create a matrix that replicates the behavior of the cross
// product such that getH(v) * a == -v.cross(a)
REQUIRE_THAT(getH(v) * testVec, IsClose(v.cross(-testVec)));
vec ref = v.cross(-testVec);
REQUIRE_THAT(getH(v) * testVec, IsClose(ref));
}

TEST_CASE("translateMass linear acceleration")
Expand Down
Loading