Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
Finished tensor3
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Aug 31, 2017
1 parent e648ffe commit da128fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cppmat.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ exec_prefix=${prefix}
Name: cppmat
Description: Matrix/tensor library for C++
Requires:
Version: 0.2.5
Version: 0.2.7
Libs:
Cflags: -I${prefix}/include
10 changes: 5 additions & 5 deletions include/cppmat/pybind11_tensor3.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,14 @@ template <typename T> struct type_caster<cppmat::tensor3_2d<T>>
};

// =================================================================================================
// type caster: cppmat::vector <-> NumPy-array
// type caster: cppmat::vector3 <-> NumPy-array
// =================================================================================================

template <typename T> struct type_caster<cppmat::vector<T>>
template <typename T> struct type_caster<cppmat::vector3<T>>
{
public:

PYBIND11_TYPE_CASTER(cppmat::vector<T>, _("cppmat::vector<T>"));
PYBIND11_TYPE_CASTER(cppmat::vector3<T>, _("cppmat::vector3<T>"));

// Python -> C++
// -------------
Expand Down Expand Up @@ -351,7 +351,7 @@ template <typename T> struct type_caster<cppmat::vector<T>>
return false;

// - all checks passed: create the proper C++ variable
value = cppmat::vector<T>(buf.data());
value = cppmat::vector3<T>(buf.data());

// - signal successful variable creation
return true;
Expand All @@ -360,7 +360,7 @@ template <typename T> struct type_caster<cppmat::vector<T>>
// C++ -> Python
// -------------

static py::handle cast(const cppmat::vector<T>& src, py::return_value_policy policy,
static py::handle cast(const cppmat::vector3<T>& src, py::return_value_policy policy,
py::handle parent)
{
// - create "shape" array required by Python
Expand Down
4 changes: 2 additions & 2 deletions include/cppmat/tensor3.h
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,7 @@ tensor3_4<double> inline identity3_4rt()

// -------------------------------------------------------------------------------------------------

tensor3_4<double> inline identity3_4II()
tensor3_4<double> inline identity3_II()
{
tensor3_4<double> I(0.0);

Expand All @@ -2553,7 +2553,7 @@ tensor3_4<double> inline identity3_4s()
// -------------------------------------------------------------------------------------------------

tensor3_4<double> inline identity3_4d()
{ return identity3_4s()-identity3_4II()/static_cast<double>(3); }
{ return identity3_4s()-identity3_II()/static_cast<double>(3); }

// -------------------------------------------------------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from setuptools import setup

__version__ = '0.2.5'
__version__ = '0.2.7'

setup(
name = 'cppmat',
Expand All @@ -25,9 +25,9 @@
headers = [
'include/cppmat/matrix.h',
'include/cppmat/tensor.h',
'include/cppmat/tensor3d.h',
'include/cppmat/tensor3.h',
'include/cppmat/pybind11_matrix.h',
'include/cppmat/pybind11_tensor3d.h',
'include/cppmat/pybind11_tensor3.h',
],
install_requires = ['pybind11>=2.1.0'],
)

0 comments on commit da128fa

Please sign in to comment.