mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-22 12:23:56 +01:00
Merge branch 'main' into patch-1
This commit is contained in:
commit
920f1a01d2
19
.github/workflows/test-build.yml
vendored
Normal file
19
.github/workflows/test-build.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: test-build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install dependencies
|
||||
run: sudo apt-get install emacs
|
||||
- name: make
|
||||
run: make -C src/
|
@ -1,4 +1,7 @@
|
||||
# qmckl
|
||||
|
||||
![Build Status](https://github.com/TREX-CoE/qmckl/workflows/test-build/badge.svg?branch=main)
|
||||
|
||||
Quantum Monte Carlo Kernel Library.
|
||||
|
||||
See the [Wiki](https://github.com/TREX-CoE/qmckl/wiki) for more information.
|
||||
|
@ -4,17 +4,20 @@ CFLAGS=
|
||||
FC=gfortran
|
||||
FFLAGS=
|
||||
|
||||
SOURCE_FILES=$(wildcard *.org)
|
||||
ORG_SOURCE_FILES=qmckl_context.org
|
||||
OBJECT_FILES=$(patsubst %.org,%.o,$(ORG_SOURCE_FILES))
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
all: $(OBJECT_FILES)
|
||||
|
||||
%.c %.h: %.org
|
||||
emacs --quick --no-init-file --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "$^")'
|
||||
|
||||
%.c %.h %_f.f90: %.org
|
||||
emacs --quick --no-init-file --batch --eval "(require 'org)" --eval '(org-babel-tangle-file "$^")'
|
||||
|
||||
%.o: %.c
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $*.c -o $*.o
|
||||
|
||||
%.o: %.f90
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- mode: org -*-
|
||||
|
||||
#+TITLE: Context
|
||||
#+TITLE: Context
|
||||
|
||||
This file is written in C because it is more natural to express the context in
|
||||
C than in Fortran.
|
||||
@ -17,7 +17,7 @@ C than in Fortran.
|
||||
is stored in the following data structure, which can't be seen
|
||||
outside of the library.
|
||||
|
||||
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.h
|
||||
#define QMCKL_DEFAULT_PRECISION 53
|
||||
#define QMCKL_DEFAULT_RANGE 2
|
||||
@ -66,11 +66,11 @@ qmckl_context qmckl_context_create() {
|
||||
** =qmckl_context_copy=
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.h
|
||||
qmckl_context qmckl_context_copy(qmckl_context context);
|
||||
qmckl_context qmckl_context_copy(const qmckl_context context);
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||
qmckl_context qmckl_context_copy(qmckl_context context) {
|
||||
qmckl_context qmckl_context_copy(const qmckl_context context) {
|
||||
|
||||
qmckl_context_struct* old_context;
|
||||
qmckl_context_struct* new_context;
|
||||
@ -123,11 +123,11 @@ qmckl_context qmckl_context_destroy(qmckl_context context) {
|
||||
** =qmckl_context_set_precision=
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.h
|
||||
qmckl_context qmckl_context_set_precision(qmckl_context context, int precision);
|
||||
qmckl_context qmckl_context_set_precision(const qmckl_context context, int precision);
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||
qmckl_context qmckl_context_set_precision(qmckl_context context, int precision) {
|
||||
qmckl_context qmckl_context_set_precision(const qmckl_context context, int precision) {
|
||||
qmckl_context_struct* ctx;
|
||||
|
||||
if (precision < 2) return (qmckl_context) 0;
|
||||
@ -141,11 +141,11 @@ qmckl_context qmckl_context_set_precision(qmckl_context context, int precision)
|
||||
|
||||
** =qmckl_context_set_range=
|
||||
#+BEGIN_SRC C :tangle qmckl_context.h
|
||||
qmckl_context qmckl_context_set_range(qmckl_context context, int range);
|
||||
qmckl_context qmckl_context_set_range(const qmckl_context context, int range);
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||
qmckl_context qmckl_context_set_range(qmckl_context context, int range) {
|
||||
qmckl_context qmckl_context_set_range(const qmckl_context context, int range) {
|
||||
qmckl_context_struct* ctx;
|
||||
|
||||
if (range < 2) return (qmckl_context) 0;
|
||||
@ -162,11 +162,11 @@ qmckl_context qmckl_context_set_range(qmckl_context context, int range) {
|
||||
** =qmckl_context_get_precision=
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.h
|
||||
int qmckl_context_get_precision(qmckl_context context);
|
||||
int qmckl_context_get_precision(const qmckl_context context);
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||
int qmckl_context_get_precision(qmckl_context context) {
|
||||
int qmckl_context_get_precision(const qmckl_context context) {
|
||||
qmckl_context_struct* ctx;
|
||||
ctx = (qmckl_context_struct*) context;
|
||||
return ctx->precision;
|
||||
@ -176,11 +176,11 @@ int qmckl_context_get_precision(qmckl_context context) {
|
||||
** =qmckl_context_get_range=
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.h
|
||||
int qmckl_context_get_range(qmckl_context context);
|
||||
int qmckl_context_get_range(const qmckl_context context);
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||
int qmckl_context_get_range(qmckl_context context) {
|
||||
int qmckl_context_get_range(const qmckl_context context) {
|
||||
qmckl_context_struct* ctx;
|
||||
ctx = (qmckl_context_struct*) context;
|
||||
return ctx->range;
|
||||
|
Loading…
Reference in New Issue
Block a user