Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git workflow and pre-commit updates #21

Merged
merged 13 commits into from
Mar 12, 2024
95 changes: 58 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,59 @@
exclude: |
(?x)^(
src/perm-mv0\.h$ |
src/kperm-gray\.h$ |
src/swap\.h$
)

ci:
skip:
[cppcheck, cpplint, clang-format]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files # prevents giant files from being commit
- id: check-ast # Check whether files parse as valid python.
- id: check-case-conflict # Checks conflict case-insensitive
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks # Check for symlinks which don't point
- id: check-toml
- id: check-vcs-permalinks
- id: debug-statements # Check for debugger imports and py37 breakpt
- id: detect-private-key # Checks for the existence of private keys.
- id: destroyed-symlinks
- id: end-of-file-fixer # Makes sure files end in a newline
- id: fix-byte-order-marker # Removes UTF-8 byte order marker
- id: mixed-line-ending # Replaces or checks mixed line ending.
- id: pretty-format-json # Checks JSON are pretty
args: ["--autofix", "--no-sort-keys"]
- id: trailing-whitespace # Trims trailing whitespace.
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: remove-crlf
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.9'
hooks:
- id: ruff
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.3
hooks:
- id: check-github-workflows
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files # prevents giant files from being commit
- id: check-ast # Check whether files parse as valid python.
- id: check-case-conflict # Checks conflict case-insensitive
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks # Check for symlinks which don't point
- id: check-toml
- id: check-vcs-permalinks
- id: debug-statements # Check for debugger imports and py37 breakpt
- id: detect-private-key # Checks for the existence of private keys
- id: destroyed-symlinks
- id: end-of-file-fixer # Makes sure files end in a newline
- id: fix-byte-order-marker # Removes UTF-8 byte order marker
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: pretty-format-json # Checks JSON are pretty
args: ["--autofix", "--no-sort-keys"]
- id: trailing-whitespace # Trims trailing whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-crlf
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
hooks:
- id: ruff
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: cppcheck
args: ["--inline-suppr", "--suppress=missingIncludeSystem",
"--suppress=*:src/swap.h", "--suppress=*:src/perm-mv0.h", "--suppress=*:src/kperm-gray.h"]
- id: cpplint
args: ["--root=src", "--filter=-build/include_subdir"]
- id: clang-format
args: ["-i", "-style={BasedOnStyle: google, IndentWidth: 4}"]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[![Python 3](http://img.shields.io/badge/python-3-blue.svg)](https://docs.python.org/3/)
[![gcc](https://img.shields.io/badge/-C++-blue?logo=cplusplus)](https://gcc.gnu.org/)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/theochem/matrix-permanent/actions/workflows/pull_request.yml)
[![GNU GPLv3](https://img.shields.io/badge/license-%20%20GNU%20GPLv3%20-green?style=plastic)](https://www.gnu.org/licenses/gpl-3.0.en.html)


# Permanent

Expand Down
1 change: 0 additions & 1 deletion permanent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
r"""Module for computing the permanents of matrices."""


__all__ = [
"opt",
"combinatoric",
Expand Down
60 changes: 44 additions & 16 deletions src/permanent.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
#include <complex>
/* Copyright 2034 QC-Devs (GPLv3) */

#include "permanent.h"

#include <complex>

template double combinatoric<double>(const std::size_t, const std::size_t,
const double *);

template double combinatoric_rectangular<double>(const std::size_t,
const std::size_t,
const double *);

template double glynn<double>(const std::size_t, const std::size_t,
const double *);

template double glynn_rectangular<double>(const std::size_t, const std::size_t,
const double *);

template double ryser<double>(const std::size_t, const std::size_t,
const double *);

template double ryser_rectangular<double>(const std::size_t, const std::size_t,
const double *);

template double opt<double>(const std::size_t, const std::size_t,
const double *);

template std::complex<double> combinatoric<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);

template std::complex<double> combinatoric_rectangular<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);

template std::complex<double> glynn<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);

template std::complex<double> glynn_rectangular<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);

template std::complex<double> ryser<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);

template std::complex<double> ryser_rectangular<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);

template double combinatoric<double>(const std::size_t, const std::size_t, double *const);
template double combinatoric_rectangular<double>(const std::size_t, const std::size_t, double *const);
template double glynn<double>(const std::size_t, const std::size_t, double *const);
template double glynn_rectangular<double>(const std::size_t, const std::size_t, double *const);
template double ryser<double>(const std::size_t, const std::size_t, double *const);
template double ryser_rectangular<double>(const std::size_t, const std::size_t, double *const);
template double opt<double>(const std::size_t, const std::size_t, double *const);

template std::complex<double> combinatoric<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> combinatoric_rectangular<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> glynn<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> glynn_rectangular<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> ryser<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> ryser_rectangular<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> opt<std::complex<double>>(const std::size_t, const std::size_t, std::complex<double> *const);
template std::complex<double> opt<std::complex<double>>(
const std::size_t, const std::size_t, const std::complex<double> *);
Loading