Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19251150
test_Matrix.cc
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
test_Matrix.cc
View Options
#ifdef NDEBUG
#undef NDEBUG
#endif
#include
<cassert>
#include
<cmath>
#include
<iostream>
#include
"RHEJ/Matrix.hh"
int
main
(){
constexpr
size_t
dim
=
4
;
constexpr
double
ep
=
1e-16
;
auto
m
=
RHEJ
::
Matrix
{
dim
,
dim
};
assert
(
m
.
rows
()
==
dim
);
assert
(
m
.
columns
()
==
dim
);
m
(
0
,
0
)
=
0.35388638718713294
;
assert
(
m
(
0
,
0
)
==
0.35388638718713294
);
m
(
0
,
1
)
=
0.441472069363144
;
m
(
0
,
2
)
=
0.7821385102801595
;
m
(
0
,
3
)
=
0.4506533375385655
;
m
(
1
,
0
)
=
0.5954699211986723
;
m
(
1
,
1
)
=
0.7337301649423917
;
m
(
1
,
2
)
=
0.24953309317812855
;
m
(
1
,
3
)
=
0.5747608628993972
;
m
(
2
,
0
)
=
0.5241499726390944
;
m
(
2
,
1
)
=
0.5202946315779862
;
m
(
2
,
2
)
=
0.5178464229701134
;
m
(
2
,
3
)
=
0.22486555579427625
;
m
(
3
,
0
)
=
0.28294299023923397
;
m
(
3
,
1
)
=
0.23061982229765166
;
m
(
3
,
2
)
=
0.9472220498156341
;
m
(
3
,
3
)
=
0.68515373407338
;
auto
mcpy
=
m
;
assert
(
mcpy
.
rows
()
==
m
.
rows
());
assert
(
mcpy
.
columns
()
==
m
.
columns
());
assert
(
mcpy
(
0
,
0
)
==
0.35388638718713294
);
m
(
0
,
0
)
=
0
;
assert
(
m
(
0
,
0
)
==
0
);
assert
(
mcpy
(
0
,
0
)
==
0.35388638718713294
);
m
=
std
::
move
(
mcpy
);
assert
(
m
.
rows
()
==
dim
);
assert
(
m
.
columns
()
==
dim
);
assert
(
m
(
0
,
0
)
==
0.35388638718713294
);
assert
(
std
::
abs
(
det
(
m
)
+
0.028722124827027316
)
<
ep
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Sep 30, 5:48 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6541296
Default Alt Text
test_Matrix.cc (1 KB)
Attached To
Mode
rHEJ HEJ
Attached
Detach File
Event Timeline
Log In to Comment