mt19937-64.out.txt に掲載されている、1000 outputs of genrand64_int64() を、Fortran で読み取れるように、
バイナリデータは保持しつつ、unsigned long から signed long に変換するための C++ と Fortran のソースコード。
This file contains hidden or 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
| % [reference] | |
| % https://tex.stackexchange.com/questions/34424/how-do-i-calculate-n-modulo-3-in-latex | |
| \RequirePackage{plautopatch} | |
| \documentclass[uplatex]{jsarticle} | |
| \makeatletter | |
| \newcommand{\calcQuotient}[2]{{% | |
| \newcount\@quotient% |
This file contains hidden or 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
| FCFLAGS = -ffree-line-length-none -O2 -pedantic -std=f2008 -Wall -Wextra # -fbacktrace -fbounds-check | |
| OBJS = ./main.o | |
| main.exe: $(OBJS) | |
| gfortran $(FCFLAGS) -o ./main.exe $(OBJS) | |
| %.o: %.f08 | |
| gfortran $(FCFLAGS) -c $< | |
| clean: |
This file contains hidden or 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
| FCFLAGS = -ffree-line-length-none -O2 -pedantic -std=f2008 -Wall -Wextra # -fbacktrace -fbounds-check | |
| OBJS = ./mod_utility.o ./mod_eqn_func.o ./mod_solver.o ./main.o | |
| main.exe: $(OBJS) | |
| gfortran $(FCFLAGS) -o ./main.exe $(OBJS) | |
| %.o: %.f08 | |
| gfortran $(FCFLAGS) -c $< | |
| clean: |
This file contains hidden or 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
| FCFLAGS = -ffree-line-length-none -O2 -pedantic -std=f2008 -Wall -Wextra # -fbacktrace -fbounds-check | |
| OBJS = ./mod_is_even.o ./mod_test.o ./main.o | |
| main.exe: $(OBJS) | |
| gfortran $(FCFLAGS) -o ./main.exe $(OBJS) | |
| %.o: %.f08 | |
| gfortran $(FCFLAGS) -c $< | |
| clean: |
This file contains hidden or 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
| FCFLAGS= -fbacktrace -fbounds-check -ffree-line-length-none -O2 -pedantic -std=f2008 -Wall -Wextra | |
| main.exe: ./main.f08 | |
| gfortran $(FCFLAGS) -o ./main.exe $< | |
| clean: | |
| rm ./*.mod ./*.o ./*.dat |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| import numpy | |
| def read_int32(file_stream): | |
| return numpy.fromfile(file= file_stream, dtype= numpy.int32, count=1)[0] | |
| def read_real64(file_stream): | |
| return numpy.fromfile(file= file_stream, dtype= numpy.float64, count=1)[0] |
268435456 < length_data
This file contains hidden or 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
| program memorandum | |
| use, intrinsic :: iso_fortran_env | |
| implicit none | |
| integer(INT32) :: input_front = -17_INT32 | |
| integer(INT32) :: input_rear = +32_INT32 | |
| integer(INT64) :: retval |