Skip to content

Commit

Permalink
small changes to array.h documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Haaaaron committed Sep 1, 2023
1 parent ef5e06e commit ceeac5a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion applications/hila_toy_codes/src/minmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) {
g[{4, 0, 0}] = 1.0;
g[{99,99, 99}] = 5;
g[{24,0, 2}] = 2.3;
g.set_element(4,{2,2,1});
//g.set_element(4,{2,2,1});

double val1, val2, val3, val4, val5, val6;
CoordinateVector loc1, loc2, loc3, loc4, loc5, loc6;
Expand Down
9 changes: 9 additions & 0 deletions libraries/datatypes/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@

/**
* @brief \f$ n\times m \f$ Array type
* @details Acts as array class which stores data in a simple C style array.
*
* Main functionality which the Array class offers is to supplement the fall backs of storing
* information in a Matrix data structure.
*
* For example assigning a value to each element with the Matrix class is not directly possible
* using the assignment operator=. This is because assignment with matrices is defined as
* \f$ M = a = a*I \f$ where M is a general matrix, a is a scalar and I an identity matrix. The
* result would only assign a to the diagonal elements.
*
* @tparam n - row length
* @tparam m - column length
Expand Down
7 changes: 4 additions & 3 deletions unit_tests/src/test_field.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "hila.h"
#include "catch.hpp"

using MyType = float;
using MyType = double;

class FieldTest {

Expand Down Expand Up @@ -133,8 +133,9 @@ TEST_CASE_METHOD(FieldTest, "Field mathematical operations", "[Field]") {
REQUIRE(dummy_field.product() == 1);
}
SECTION("MinMax") {
dummy_field[{2, 2, 2}] = 2.0;
dummy_field[{2, 2, 2}] = 2.0;
fill_dummy_field(0);
dummy_field.set_element({2, 2, 2},2.0);
dummy_field.set_element({2, 2, 1},1.0);
CoordinateVector loc_min, loc_max;
REQUIRE(dummy_field.min() == 0.0);
REQUIRE(dummy_field.max() == 2.0);
Expand Down

0 comments on commit ceeac5a

Please sign in to comment.