Skip to content

Commit 0cbe048

Browse files
authored
Merge branch 'develop' into task/rhornung67/v0.10.0-RC
2 parents 3f1b415 + b9cc160 commit 0cbe048

File tree

6 files changed

+97
-22
lines changed

6 files changed

+97
-22
lines changed

.github/workflows/test_windows_tpls.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ jobs:
2929

3030
steps:
3131
- name: Checkout repo w/ submodules
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v4
3333
with:
3434
submodules: recursive
3535

3636
- name: Set up python
37-
uses: actions/setup-python@v2
37+
uses: actions/setup-python@v5
3838
with:
39-
python-version: '3.7'
39+
python-version: '3.10'
4040

4141
- name: List path and files
4242
run: ls
4343
- name: Run uberenv (${{ matrix.triplet }})
4444
run: python3 ./scripts/uberenv/uberenv.py --triplet ${{ matrix.triplet }}
4545
- name: Save Uberenv logs
46-
uses: actions/upload-artifact@v2
46+
uses: actions/upload-artifact@v4
4747
if: ${{ always() }}
4848
with:
4949
name: uberenv_artifacts_${{ matrix.triplet }}_${{ matrix.cfg }}.zip
@@ -73,7 +73,7 @@ jobs:
7373
ls
7474
ctest -C ${{ matrix.cfg }} --no-compress-output -T Test
7575
- name: Save CTest logs
76-
uses: actions/upload-artifact@v2
76+
uses: actions/upload-artifact@v4
7777
if: ${{ always() }}
7878
with:
7979
name: ctest_artifacts_${{ matrix.triplet }}_${{ matrix.cfg }}.zip

RELEASE-NOTES.md

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
8484
- Removes caching of `{PACKAGE}_FOUND` variables in `SetupAxomThirdParty.cmake`
8585
- We no longer test Axom with the XL compiler. So users should consider XL unsupported.
8686

87+
### Fixed
88+
- `numerics::eigen_solve()` has been corrected to avoid an early return with error state.
89+
8790
## [Version 0.9.0] - Release date 2024-03-19
8891

8992
### Added

src/axom/core/MDMapping.hpp

+7-13
Original file line numberDiff line numberDiff line change
@@ -324,22 +324,16 @@ class MDMapping
324324
const axom::StackArray<DirectionType, DIM>& v) const
325325
{
326326
// v is a permutation if all its values are unique and in [0, DIM).
327-
axom::StackArray<bool, DIM> found;
328-
for(int d = 0; d < DIM; ++d)
329-
{
330-
found[d] = false;
331-
}
332-
for(int d = 0; d < DIM; ++d)
327+
axom::StackArray<DirectionType, DIM> values_sorted = v;
328+
329+
// After sorting, the values should be the sequence {0, 1, ... DIM - 1}.
330+
axom::utilities::insertionSort(&values_sorted[0], DIM);
331+
for(int d = 0; d < DIM; d++)
333332
{
334-
if(v[d] < 0 || v[d] >= DIM)
335-
{
336-
return false; // Out of range.
337-
}
338-
if(found[v[d]] == true)
333+
if(values_sorted[d] != d)
339334
{
340-
return false; // Repeated index.
335+
return false;
341336
}
342-
found[v[d]] = true;
343337
}
344338
return true;
345339
}

src/axom/core/numerics/eigen_solve.hpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace numerics
3838
* \param [in] A a square input matrix
3939
* \param [in] k number of eigenvalue-eigenvectors to find
4040
* \param [out] u pointer to k eigenvectors in order by magnitude of eigenvalue
41-
* \param [out] lambdas pointer to k eigenvales in order by size
41+
* \param [out] lambdas pointer to k eigenvalues in order by size
4242
* \param [in] numIterations optional number of iterations for the power method
4343
* \note if k <= 0, the solve is declared successful
4444
* \return rc return value, nonzero if the solve is successful.
@@ -119,9 +119,12 @@ int eigen_solve(Matrix<T>& A, int k, T* u, T* lambdas, int numIterations)
119119

120120
bool res = normalize<T>(vec, N);
121121

122-
if(!res) // something went wrong
122+
// something went wrong, likely because `vec` is (numerically)
123+
// in the span of the previous eigenvectors. Try again!
124+
if(!res)
123125
{
124-
return 0;
126+
i--;
127+
continue;
125128
}
126129

127130
// 3: run depth iterations of power method; note that a loop invariant

src/axom/primal/tests/primal_orientedboundingbox.cpp

+75
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,81 @@ TEST(primal_OBBox, obb_ctor_from_data)
121121
EXPECT_TRUE(obbox1.getExtents() == e);
122122
}
123123

124+
//------------------------------------------------------------------------------
125+
TEST(primal_OBBox, obb_ctor_from_point_array)
126+
{
127+
constexpr int DIM = 3;
128+
using CoordType = double;
129+
using QPoint = primal::Point<CoordType, DIM>;
130+
using QOBBox = primal::OrientedBoundingBox<CoordType, DIM>;
131+
132+
QPoint pt1; // origin
133+
QPoint pt2({1.0, 0.0, 0.0});
134+
QPoint pt3({0.0, 1.0, 0.0});
135+
QPoint pt4({0.0, 0.0, 1.0});
136+
QPoint pt5({1.0, 1.0, 0.0});
137+
QPoint pt6({1.0, 0.0, 1.0});
138+
QPoint pt7({0.0, 1.0, 1.0});
139+
QPoint pt8({1.0, 1.0, 1.0});
140+
141+
/* -1D OBB */
142+
QPoint* pts_00 = nullptr;
143+
QOBBox obbox00(pts_00, 0);
144+
145+
EXPECT_FALSE(obbox00.isValid());
146+
147+
/* 0D OBB */
148+
QPoint pts_0d[] = {pt1};
149+
QOBBox obbox0(pts_0d, 1);
150+
151+
EXPECT_TRUE(obbox0.isValid());
152+
EXPECT_TRUE(obbox0.contains(pt1));
153+
154+
EXPECT_NEAR(obbox0.getCentroid()[0], 0.0, 1e-6);
155+
EXPECT_NEAR(obbox0.getCentroid()[1], 0.0, 1e-6);
156+
EXPECT_NEAR(obbox0.getCentroid()[2], 0.0, 1e-6);
157+
158+
/* 1D OBB */
159+
QPoint pts_1d[] = {pt1, pt2};
160+
QOBBox obbox1(pts_1d, 2);
161+
162+
EXPECT_TRUE(obbox1.isValid());
163+
EXPECT_TRUE(obbox1.contains(pt1));
164+
EXPECT_TRUE(obbox1.contains(pt2));
165+
166+
EXPECT_NEAR(obbox1.getCentroid()[0], 0.5, 1e-6);
167+
EXPECT_NEAR(obbox1.getCentroid()[1], 0.0, 1e-6);
168+
EXPECT_NEAR(obbox1.getCentroid()[2], 0.0, 1e-6);
169+
170+
/* 2D OBB */
171+
QPoint pts_2d[] = {pt1, pt2, pt3, pt5};
172+
QOBBox obbox2(pts_2d, 4);
173+
174+
EXPECT_TRUE(obbox2.isValid());
175+
EXPECT_TRUE(obbox2.contains(pt1));
176+
EXPECT_TRUE(obbox2.contains(pt2));
177+
EXPECT_TRUE(obbox2.contains(pt3));
178+
EXPECT_TRUE(obbox2.contains(pt5));
179+
180+
EXPECT_NEAR(obbox2.getCentroid()[0], 0.5, 1e-6);
181+
EXPECT_NEAR(obbox2.getCentroid()[1], 0.5, 1e-6);
182+
EXPECT_NEAR(obbox2.getCentroid()[2], 0.0, 1e-6);
183+
184+
/* 3D OBB */
185+
QPoint pts_3d[] = {pt1, pt2, pt3, pt4, pt5, pt6, pt7, pt8};
186+
QOBBox obbox3(pts_3d, 8);
187+
188+
// check containments
189+
EXPECT_TRUE(obbox3.isValid());
190+
for(int i = 0; i < 8; i++)
191+
{
192+
EXPECT_TRUE(obbox3.contains(pts_3d[i]));
193+
}
194+
195+
// check settings
196+
EXPECT_TRUE(obbox3.getCentroid() == QPoint(0.5));
197+
}
198+
124199
//------------------------------------------------------------------------------
125200
TEST(primal_OBBox, obb_test_clear)
126201
{

src/axom/slam/BivariateMap.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ class BivariateMap<T, BSet, IndPol, StrPol, IfacePol>::RangeIterator
802802
* index. Same as operator()
803803
*/
804804
template <typename... ComponentIndex>
805-
DataRefType value(ComponentIndex... comp) const
805+
AXOM_HOST_DEVICE DataRefType value(ComponentIndex... comp) const
806806
{
807807
return m_mapIterator(comp...);
808808
}

0 commit comments

Comments
 (0)