-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from issp-center-dev/develop
Develop
- Loading branch information
Showing
1,059 changed files
with
242,558 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) | ||
project(StdFace C) | ||
|
||
option(UHF "Build uhf_dry.out" ON) | ||
option(UHF "Build uhf_dry.out" OFF) | ||
MESSAGE(STATUS "Build uhf_dry.out - ${UHF}") | ||
|
||
option(MVMC "Build mvmc_dry.out" ON) | ||
option(MVMC "Build mvmc_dry.out" OFF) | ||
MESSAGE(STATUS "Build mvmc_dry.out - ${MVMC}") | ||
|
||
option(HPHI "Build hphi_dry.out" ON) | ||
option(HPHI "Build hphi_dry.out" OFF) | ||
MESSAGE(STATUS "Build hphi_dry.out - ${HPHI}") | ||
|
||
option(HWAVE "Build hwave_dry.out" ON) | ||
option(HWAVE "Build hwave_dry.out" OFF) | ||
MESSAGE(STATUS "Build hwave_dry.out - ${HWAVE}") | ||
|
||
add_subdirectory(src) | ||
install(DIRECTORY samples DESTINATION share/stdface) | ||
|
||
enable_testing() | ||
add_subdirectory(test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if (HPHI) | ||
add_subdirectory(hphi) | ||
endif() | ||
|
||
if (MVMC) | ||
add_subdirectory(mvmc) | ||
endif() | ||
|
||
if (UHF) | ||
add_subdirectory(uhf) | ||
endif() | ||
|
||
if (HWAVE) | ||
add_subdirectory(hwave) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import sys | ||
|
||
#EPS = 0.0 | ||
EPS = 1.0e-12 | ||
|
||
if len(sys.argv) < 3: | ||
print("usage: {} file1 file2".format(sys.argv[0])) | ||
sys.exit(0) | ||
|
||
file_a = sys.argv[1] | ||
file_b = sys.argv[2] | ||
|
||
with open(file_a, "r") as fp: | ||
lines_a = fp.readlines() | ||
with open(file_b, "r") as fp: | ||
lines_b = fp.readlines() | ||
|
||
err = 0 | ||
for idx, (ta, tb) in enumerate(zip(lines_a, lines_b)): | ||
vas = ta.split() | ||
vbs = tb.split() | ||
if len(vas) != len(vbs): | ||
print("DIFF: line {}: number of keywords differ: {} {}".format(idx, len(vas), len(vbs))) | ||
continue | ||
for va, vb in zip(vas, vbs): | ||
# literally equal | ||
if va == vb: | ||
continue | ||
# try compare as intergers | ||
try: | ||
iva = int(va) | ||
ivb = int(vb) | ||
if iva == ivb: | ||
continue | ||
except ValueError: | ||
pass | ||
# try compare as floating point numbers | ||
try: | ||
fva = float(va) | ||
fvb = float(vb) | ||
if abs(fva) < EPS and abs(fvb) < EPS: | ||
r = abs(fva - fvb) | ||
else: | ||
r = abs(fva - fvb) / (abs(fva) + abs(fvb)) | ||
if r < EPS: | ||
continue | ||
except ValueError: | ||
pass | ||
# different anyway | ||
err += 1 | ||
print("DIFF: line {}: \"{}\" \"{}\"".format(idx, va, vb)) | ||
|
||
if err > 0: | ||
print("compare failed (err={})".format(err)) | ||
sys.exit(1) | ||
|
||
sys.exit(0) |
Oops, something went wrong.