Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ python3_add_library(_sparsediffengine MODULE

target_include_directories(_sparsediffengine PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/SparseDiffEngine/include
${CMAKE_CURRENT_SOURCE_DIR}/SparseDiffEngine/include/atoms
${CMAKE_CURRENT_SOURCE_DIR}/SparseDiffEngine/include/utils
${CMAKE_CURRENT_SOURCE_DIR}/SparseDiffEngine/include/old-code
${CMAKE_CURRENT_SOURCE_DIR}/SparseDiffEngine/src
${CMAKE_CURRENT_SOURCE_DIR}/sparsediffpy/_bindings
)
Expand Down
2 changes: 1 addition & 1 deletion SparseDiffEngine
Submodule SparseDiffEngine updated 168 files
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "sparsediffpy"
version = "0.1.5"
version = "0.1.6"
description = "Python bindings for SparseDiffEngine automatic differentiation"
requires-python = ">=3.11"
dependencies = ["numpy >= 2.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/asinh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_ASINH_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_asinh(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/atanh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_ATANH_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_restricted_dom.h"

static PyObject *py_make_atanh(PyObject *self, PyObject *args)
{
Expand Down
3 changes: 2 additions & 1 deletion sparsediffpy/_bindings/atoms/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include <numpy/arrayobject.h>

#include "affine.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"
#include "elementwise_restricted_dom.h"
#include "expr.h"

#define EXPR_CAPSULE_NAME "DNLP_EXPR"
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/const_scalar_mult.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_CONST_SCALAR_MULT_H
#define ATOM_CONST_SCALAR_MULT_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

/* Constant scalar multiplication: a * f(x) where a is a constant double */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/const_vector_mult.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_CONST_VECTOR_MULT_H
#define ATOM_CONST_VECTOR_MULT_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

/* Constant vector elementwise multiplication: a ∘ f(x) where a is a constant vector
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/cos.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_COS_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_cos(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/dense_matmul.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_DENSE_MATMUL_H
#define ATOM_DENSE_MATMUL_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

/* Dense left matrix multiplication: A @ f(x) where A is a dense matrix.
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/entr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_ENTR_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_restricted_dom.h"

static PyObject *py_make_entr(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/left_matmul.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_LEFT_MATMUL_H
#define ATOM_LEFT_MATMUL_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

/* Left matrix multiplication: A @ f(x) where A is a constant matrix */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/logistic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_LOGISTIC_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_logistic(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/matmul.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_MATMUL_H
#define ATOM_MATMUL_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

/* Matrix multiplication: Z = X @ Y */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/multiply.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_MULTIPLY_H
#define ATOM_MULTIPLY_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

static PyObject *py_make_multiply(PyObject *self, PyObject *args)
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_POWER_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_power(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/prod.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define ATOM_PROD_H

#include "common.h"
#include "other.h"
#include "non_elementwise_full_dom.h"

static PyObject *py_make_prod(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/prod_axis_one.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_PROD_AXIS_ONE_H

#include "common.h"
#include "other.h"
#include "non_elementwise_full_dom.h"

static PyObject *py_make_prod_axis_one(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/prod_axis_zero.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define ATOM_PROD_AXIS_ZERO_H

#include "common.h"
#include "other.h"
#include "non_elementwise_full_dom.h"

static PyObject *py_make_prod_axis_zero(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/quad_form.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_QUAD_FORM_H

#include "common.h"
#include "other.h"
#include "non_elementwise_full_dom.h"

/* Quadratic form: y = x' * Q * x where Q is a constant matrix */
static PyObject *py_make_quad_form(PyObject *self, PyObject *args)
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/quad_over_lin.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef ATOM_QUAD_OVER_LIN_H
#define ATOM_QUAD_OVER_LIN_H

#include "bivariate.h"
#include "bivariate_restricted_dom.h"
#include "common.h"

/* quad_over_lin: y = sum(x^2) / z where x is left, z is right (scalar) */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/rel_entr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef ATOM_REL_ENTR_H
#define ATOM_REL_ENTR_H

#include "bivariate.h"
#include "bivariate_restricted_dom.h"
#include "common.h"

/* rel_entr: rel_entr(x, y) = x * log(x/y) elementwise */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/rel_entr_scalar_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef ATOM_REL_ENTR_SCALAR_VECTOR_H
#define ATOM_REL_ENTR_SCALAR_VECTOR_H

#include "bivariate.h"
#include "bivariate_restricted_dom.h"
#include "common.h"

/* rel_entr_scalar_vector: rel_entr(x, y) where x is scalar, y is vector */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/rel_entr_vector_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef ATOM_REL_ENTR_VECTOR_SCALAR_H
#define ATOM_REL_ENTR_VECTOR_SCALAR_H

#include "bivariate.h"
#include "bivariate_restricted_dom.h"
#include "common.h"

/* rel_entr_vector_scalar: rel_entr(x, y) where x is vector, y is scalar */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/right_matmul.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ATOM_RIGHT_MATMUL_H
#define ATOM_RIGHT_MATMUL_H

#include "bivariate.h"
#include "bivariate_full_dom.h"
#include "common.h"

/* Right matrix multiplication: f(x) @ A where A is a constant matrix */
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/sin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_SIN_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_sin(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/sinh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_SINH_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_sinh(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/tan.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_TAN_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_restricted_dom.h"

static PyObject *py_make_tan(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/tanh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_TANH_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_tanh(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 1 addition & 1 deletion sparsediffpy/_bindings/atoms/xexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define ATOM_XEXP_H

#include "common.h"
#include "elementwise_univariate.h"
#include "elementwise_full_dom.h"

static PyObject *py_make_xexp(PyObject *self, PyObject *args)
{
Expand Down
2 changes: 0 additions & 2 deletions sparsediffpy/_bindings/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "atoms/hstack.h"
#include "atoms/index.h"
#include "atoms/left_matmul.h"
#include "atoms/linear.h"
#include "atoms/log.h"
#include "atoms/logistic.h"
#include "atoms/matmul.h"
Expand Down Expand Up @@ -72,7 +71,6 @@ static int ensure_numpy(void)
static PyMethodDef DNLPMethods[] = {
{"make_variable", py_make_variable, METH_VARARGS, "Create variable node"},
{"make_constant", py_make_constant, METH_VARARGS, "Create constant node"},
{"make_linear", py_make_linear, METH_VARARGS, "Create linear op node"},
{"make_log", py_make_log, METH_VARARGS, "Create log node"},
{"make_exp", py_make_exp, METH_VARARGS, "Create exp node"},
{"make_index", py_make_index, METH_VARARGS, "Create index node"},
Expand Down
Loading